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); public int deleteAccounttbByIds(Long[] ids);
Float getSumMoneyOneDay(Accounttb accounttb); Float getSumMoneyOneDay(Accounttb accounttb);
Integer getCountItemOneMonth(Accounttb accounttb);
} }

View File

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

View File

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

View File

@ -52,7 +52,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
</select> </select>
<insert id="insertAccounttb" parameterType="Accounttb" useGeneratedKeys="true" keyProperty="id"> <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 insert into accounttb
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typename != null">typename,</if> <if test="typename != null">typename,</if>