|
@@ -1981,4 +1981,69 @@
|
|
|
<include refid="pageListSql" />
|
|
|
ORDER BY frf.pay_datetime DESC
|
|
|
</select>
|
|
|
+
|
|
|
+ <sql id="realAmountClaimedSQL">
|
|
|
+ SELECT
|
|
|
+ claimd.id,
|
|
|
+ fr.amount,
|
|
|
+ fr.payer,
|
|
|
+ fr.pay_datetime,
|
|
|
+ fr.remark,
|
|
|
+ claimd.claimAmount,
|
|
|
+ claimd.claimDate,
|
|
|
+ u.NAME AS creator,
|
|
|
+ u1.NAME AS claimUser
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ frf.id,
|
|
|
+ sum( fc.claim_amount ) claimAmount,
|
|
|
+ max( fc.claim_datetime ) claimDate,
|
|
|
+ fc.claim_user_id
|
|
|
+ FROM
|
|
|
+ finance_claim fc
|
|
|
+ LEFT JOIN finance_real_fund frf ON frf.id = fc.real_fund_id
|
|
|
+ WHERE
|
|
|
+ frf.deleted = 0
|
|
|
+ AND fc.deleted = 0
|
|
|
+ GROUP BY
|
|
|
+ frf.id
|
|
|
+ ) claimd
|
|
|
+ LEFT JOIN finance_real_fund fr ON fr.id = claimd.id
|
|
|
+ LEFT JOIN user u ON u.id = fr.creator_id
|
|
|
+ LEFT JOIN user u1 ON u1.id = claimd.claim_user_id
|
|
|
+ <where>
|
|
|
+ <if test="keyword!=null and keyword!='' ">
|
|
|
+ and (
|
|
|
+ fr.payer like concat ('%',#{keyword},'%')
|
|
|
+ or u1.name like concat('%',#{keyword},'%')
|
|
|
+ or claimd.claimAmount = #{keyword}
|
|
|
+ or fr.amount = #{keyword}
|
|
|
+ or fr.remark like concat('%',#{keyword},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="vo!=null and vo.startDate!=null and vo.startDate!=''">
|
|
|
+ and fr.pay_datetime >= #{vo.startDate}
|
|
|
+ </if>
|
|
|
+ <if test="vo!=null and vo.endDate!=null and vo.endDate!=''">
|
|
|
+ and fr.pay_datetime <= #{vo.endDate}
|
|
|
+ </if>
|
|
|
+ <if test="vo!=null and vo.xStartDate!=null and vo.xStartDate!=''">
|
|
|
+ and claimd.claimDate >= #{vo.xStartDate}
|
|
|
+ </if>
|
|
|
+ <if test="vo!=null and vo.xEndDate!=null and vo.xEndDate!=''">
|
|
|
+ and claimd.claimDate <= #{vo.xEndDate}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY
|
|
|
+ claimd.claimDate DESC
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="realAmountClaimed" parameterType="com.dayou.vo.FinanceRealFundVO" resultType="com.dayou.vo.FinanceRealFundVO">
|
|
|
+ <include refid="realAmountClaimedSQL" />
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="realClaimedExport" parameterType="com.dayou.vo.FinanceRealFundVO" resultType="com.dayou.dto.FinanceRealFundExportDTO">
|
|
|
+ <include refid="realAmountClaimedSQL" />
|
|
|
+ </select>
|
|
|
</mapper>
|