<?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="org.springblade.customer.mapper.FctCsIrregularMoneyMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="org.springblade.customer.entity.FctCsIrregularMoney">
        <result column="THEMONTH" property="themonth" />
        <result column="SPCODE" property="spcode" />
        <result column="SPCODENAME" property="spcodename" />
        <result column="BTYPE" property="btype" />
        <result column="PARTNERTYPE" property="partnertype" />
        <result column="SPTYPE" property="sptype" />
        <result column="COMPLAINT_MONTH" property="complaintMonth" />
        <result column="MONEY" property="money" />
        <result column="AREATYPE" property="areatype" />
        <result column="PROVINCE" property="province" />
        <result column="RESULT" property="result" />
        <result column="REASON" property="reason" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        THEMONTH, SPCODE, SPCODENAME, BTYPE, PARTNERTYPE, SPTYPE, COMPLAINT_MONTH, MONEY, AREATYPE, PROVINCE, RESULT, REASON
    </sql>

    <update id="setMoney1">
        update FCT_CS_IRREGULAR_SLICE2 set money=(select sum(money) from FCT_CS_IRREGULAR_money where SPCODE='88226' and themonth=#{complaintMonth})
        where  dtype='MONTH' and thedvalue=#{complaintMonth}  and SPCODE='88226'
    </update>

    <update id="setMoney2">
        update FCT_CS_IRREGULAR_SLICE2 set money=(select sum(money) from FCT_CS_IRREGULAR_money where SPCODE='91932' and themonth=#{complaintMonth})
        where  dtype='MONTH' and thedvalue=#{complaintMonth}  and SPCODE='91932'
    </update>

    <update id="setMoney3">
        update FCT_CS_IRREGULAR_SLICE2 set money=(select sum(money) from FCT_CS_IRREGULAR_money where SPCODE='90120' and themonth=#{complaintMonth})
        where  dtype='MONTH' and thedvalue=#{complaintMonth}  and SPCODE='90120'
    </update>

</mapper>
