xiaoyong931011
2022-09-22 d4801f6c6d821c3b1ebd6174498149ee0e0159ee
src/main/resources/mapper/modules/MallMoneyFlowMapper.xml
@@ -136,4 +136,26 @@
        select a.* from mall_money_flow a
        where a.order_no = #{rechargeNo} and a.member_id = #{memberId}
    </select>
    <select id="selectAmountByFlowtypeAndType" resultType="java.math.BigDecimal">
        select ifnull(sum(a.amount),0) from mall_money_flow a
        <where>
            a.member_id = #{memberId}
            <if test="flowType!=null and flowType!=''">
                and  a.flow_type = #{flowType}
            </if>
            <if test="type!=null and type!=''">
                and  a.type = #{type}
            </if>
            <if test="status!=null and status!=''">
                and  a.status = #{status}
            </if>
            <if test="dateDay!=null">
                and date_format(a.created_time, '%Y-%m-%d') = date_format(#{dateDay}, '%Y-%m-%d')
            </if>
            <if test="dateMonth!=null">
                and date_format(a.created_time, '%Y-%m') = date_format(#{dateMonth}, '%Y-%m')
            </if>
        </where>
    </select>
</mapper>