<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<mapper namespace="com.ruoyi.account.mapper.AccountIncomeMapper">
|
|
<select id="accountIncomeListPage" resultType="com.ruoyi.account.pojo.AccountIncome">
|
SELECT
|
*
|
FROM account_income
|
where
|
1=1
|
<if test="accountIncome.entryDateStart != null and accountIncome.entryDateStart != '' ">
|
AND income_date >= DATE_FORMAT(#{accountIncome.entryDateStart},'%Y-%m-%d')
|
</if>
|
<if test="accountIncome.entryDateEnd != null and accountIncome.entryDateEnd != '' ">
|
AND income_date <= DATE_FORMAT(#{accountIncome.entryDateEnd},'%Y-%m-%d')
|
</if>
|
<if test="accountIncome.incomeType != null and accountIncome.incomeType != '' ">
|
AND income_type = #{accountIncome.incomeType}
|
</if>
|
<if test="accountIncome.incomeMethod != null and accountIncome.incomeMethod != '' ">
|
AND income_method = #{accountIncome.incomeMethod}
|
</if>
|
</select>
|
<select id="accountIncomeExport" resultType="com.ruoyi.account.pojo.AccountIncome">
|
SELECT
|
*
|
FROM account_income
|
where
|
1=1
|
<if test="accountIncome.entryDateStart != null and accountIncome.entryDateStart != '' ">
|
AND income_date >= DATE_FORMAT(#{accountIncome.entryDateStart},'%Y-%m-%d')
|
</if>
|
<if test="accountIncome.entryDateEnd != null and accountIncome.entryDateEnd != '' ">
|
AND income_date <= DATE_FORMAT(#{accountIncome.entryDateEnd},'%Y-%m-%d')
|
</if>
|
<if test="accountIncome.incomeType != null and accountIncome.incomeType != '' ">
|
AND income_type = #{accountIncome.incomeType}
|
</if>
|
<if test="accountIncome.incomeMethod != null and accountIncome.incomeMethod != '' ">
|
AND income_method = #{accountIncome.incomeMethod}
|
</if>
|
</select>
|
<select id="report" resultType="com.ruoyi.account.dto.AccountDto2">
|
SELECT
|
sdd.dict_label typeName,
|
sum(income_money) account
|
FROM account_income ai
|
left join sys_dict_data sdd on ai.income_type = sdd.dict_value and sdd.dict_type='income_types'
|
where
|
1=1
|
<if test="dateQueryDto.entryDateStart != null and dateQueryDto.entryDateStart != '' ">
|
AND income_date >= DATE_FORMAT(#{dateQueryDto.entryDateStart},'%Y-%m-%d')
|
</if>
|
<if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
|
AND income_date <= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
|
</if>
|
group by income_type
|
</select>
|
</mapper>
|