This commit is contained in:
GatsbyH 2024-02-12 21:59:15 +08:00
parent bf87f96d63
commit 1c563154e2
5 changed files with 28 additions and 1 deletions

View File

@ -61,4 +61,12 @@ public class AppCategoryController {
}
@GetMapping("/getCountItemOneMonth")
public AjaxResult getCountItemOneMonth(Accounttb accounttb)
{
Integer countItemOneMonth = accounttbService.getCountItemOneMonth(accounttb);
return AjaxResult.success(countItemOneMonth);
}
}

View File

@ -62,4 +62,6 @@ public interface AccounttbMapper
public int deleteAccounttbByIds(Long[] ids);
Float getSumMoneyOneDay(Accounttb accounttb);
Integer getCountItemOneMonth(Accounttb accounttb);
}

View File

@ -62,4 +62,6 @@ public interface IAccounttbService
public int deleteAccounttbById(Long id);
Float getSumMoneyOneDay(Accounttb accounttb);
Integer getCountItemOneMonth(Accounttb accounttb);
}

View File

@ -98,4 +98,9 @@ public class AccounttbServiceImpl implements IAccounttbService
public Float getSumMoneyOneDay(Accounttb accounttb) {
return accounttbMapper.getSumMoneyOneDay(accounttb);
}
@Override
public Integer getCountItemOneMonth(Accounttb accounttb) {
return accounttbMapper.getCountItemOneMonth(accounttb);
}
}

View File

@ -52,6 +52,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</select>
<select id="getCountItemOneMonth" resultType="java.lang.Integer">
SELECT COUNT(*) AS count
FROM accounttb
WHERE
<trim prefix="(" suffix=")" suffixOverrides="AND">
<if test="year != null">year = #{year} AND</if>
<if test="month != null">month = #{month} AND</if>
<if test="kind != null">kind = #{kind} AND</if>
</trim>
</select>
<insert id="insertAccounttb" parameterType="Accounttb" useGeneratedKeys="true" keyProperty="id">
insert into accounttb
<trim prefix="(" suffix=")" suffixOverrides=",">