McBasicMoneyMapper.xml 17.3 KB
<?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.chinagas.modules.schsf.mapper.McBasicMoneyMapper">

    <resultMap type="com.chinagas.modules.schsf.domain.McBasicMoney" id="McBasicMoneyResult">
        <result property="id"    column="id"    />
        <result property="fiscalYear"    column="fiscal_year"    />
        <result property="regionName"    column="region_name"    />
        <result property="groupName"    column="group_name"    />
        <result property="companyName"    column="company_name"    />
        <result property="companyCode"    column="company_code"    />
        <result property="province"    column="province"    />
        <result property="city"    column="city"    />
        <result property="district"    column="district"    />
        <result property="street"    column="street"    />
        <result property="vlgOrCmty"    column="vlg_or_cmty"    />
        <result property="respPerson"    column="resp_person"    />
        <result property="urbRurCls"    column="urb_rur_cls"    />
        <result property="budgConfPrev"    column="budg_conf_prev"    />
        <result property="budgConfNew"    column="budg_conf_new"    />
        <result property="budgTotal"    column="budg_total"    />
        <result property="quarterlyTarget"    column="quarterly_target"    />
        <result property="cnyGsgCharged"    column="cny_gsg_charged"    />
        <result property="cnyGsgUncharged"    column="cny_gsg_uncharged"    />
        <result property="cnyGsgTotal"    column="cny_gsg_total"    />
        <result property="cnyYrFull"    column="cny_yr_full"    />
        <result property="cnyYrInstal"    column="cny_yr_instal"    />
        <result property="cnyPrevFull"    column="cny_prev_full"    />
        <result property="cnyPrevInstall"    column="cny_prev_install"    />
        <result property="cnyMarketCumr"    column="cny_market_cumr"    />
        <result property="cnyFyCumReturn"    column="cny_fy_cum_return"    />
        <result property="cnyFpCumReturn"    column="cny_fp_cum_return"    />
        <result property="cnyInstCumReturn"    column="cny_inst_cum_return"    />
        <result property="cnyNewCumReturn"    column="cny_new_cum_return"    />
        <result property="cnyRcvblsCumReturn"    column="cny_rcvbls_cum_return"    />
        <result property="cnyBdgtCmplRate"    column="cny_bdgt_cmpl_rate"    />
        <result property="cnyRcvblsCmplRate"    column="cny_rcvbls_cmpl_rate"    />
        <result property="cnyCynCmplRate"    column="cny_cyn_cmpl_rate"    />
        <result property="cnyPtCmplRate"    column="cny_pt_cmpl_rate"    />
        <result property="remark"    column="remark"    />
        <result property="createTime"    column="create_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="defFlag"    column="def_flag"    />
    </resultMap>

    <sql id="selectMcBasicMoneyVo">
        select t.id, t.fiscal_year, t.region_name, t.group_name, t.company_name, t.company_code, t.province,
               t.city, t.district, t.street, t.vlg_or_cmty, t.resp_person, t.urb_rur_cls, t.budg_conf_prev,
               t.budg_conf_new, t.budg_total, t.quarterly_target, t.cny_gsg_charged, t.cny_gsg_uncharged,
               t.cny_gsg_total, t.cny_yr_full, t.cny_yr_instal, t.cny_prev_full,
               t.cny_prev_install, t.cny_market_cumr, t.cny_fy_cum_return,
               t.cny_fp_cum_return, t.cny_inst_cum_return, t.cny_new_cum_return,
               t.cny_rcvbls_cum_return, t.cny_bdgt_cmpl_rate,
               t.cny_rcvbls_cmpl_rate, t.cny_cyn_cmpl_rate,
               t.cny_pt_cmpl_rate, t.remark, t.create_time, t.create_by,
               t.update_time, t.update_by, t.def_flag
        from mc_basic_money t
        left join sys_user u on u.user_id = t.create_by
        left join sys_dept d on d.dept_id = t.company_code
    </sql>

    <select id="selectMcBasicMoneyList" parameterType="com.chinagas.modules.schsf.domain.vo.McBasicMoneyVo" resultMap="McBasicMoneyResult">
        <include refid="selectMcBasicMoneyVo"/>
        <where>
            <if test="fiscalYear != null "> and t.fiscal_year = #{fiscalYear}</if>
            <if test="regionName != null  and regionName != ''"> and t.region_name like concat('%', #{regionName}, '%')</if>
            <if test="groupName != null  and groupName != ''"> and t.group_name like concat('%', #{groupName}, '%')</if>
            <if test="companyName != null  and companyName != ''"> and t.company_name like concat('%', #{companyName}, '%')</if>
            <if test="companyCode != null  and companyCode != ''"> and t.company_code = #{companyCode}</if>
            <if test="province != null  and province != ''"> and t.province = #{province}</if>
            <if test="city != null  and city != ''"> and t.city = #{city}</if>
            <if test="district != null  and district != ''"> and t.district = #{district}</if>
            <if test="street != null  and street != ''"> and t.street = #{street}</if>
            <if test="vlgOrCmty != null  and vlgOrCmty != ''"> and t.vlg_or_cmty = #{vlgOrCmty}</if>
            <if test="respPerson != null  and respPerson != ''"> and t.resp_person = #{respPerson}</if>
            <if test="urbRurCls != null  and urbRurCls != ''"> and t.urb_rur_cls = #{urbRurCls}</if>
            <if test="budgConfPrev != null "> and t.budg_conf_prev = #{budgConfPrev}</if>
            <if test="budgConfNew != null "> and t.budg_conf_new = #{budgConfNew}</if>
            <if test="budgTotal != null "> and t.budg_total = #{budgTotal}</if>
            <if test="quarterlyTarget != null "> and t.quarterly_target = #{quarterlyTarget}</if>
            <if test="cnyGsgCharged != null "> and t.cny_gsg_charged = #{cnyGsgCharged}</if>
            <if test="cnyGsgUncharged != null "> and t.cny_gsg_uncharged = #{cnyGsgUncharged}</if>
            <if test="cnyGsgTotal != null "> and t.cny_gsg_total = #{cnyGsgTotal}</if>
            <if test="cnyYrFull != null "> and t.cny_yr_full = #{cnyYrFull}</if>
            <if test="cnyYrInstal != null "> and t.cny_yr_instal = #{cnyYrInstal}</if>
            <if test="cnyPrevFull != null "> and t.cny_prev_full = #{cnyPrevFull}</if>
            <if test="cnyPrevInstall != null "> and t.cny_prev_install = #{cnyPrevInstall}</if>
            <if test="cnyMarketCumr != null "> and t.cny_market_cumr = #{cnyMarketCumr}</if>
            <if test="cnyFyCumReturn != null "> and t.cny_fy_cum_return = #{cnyFyCumReturn}</if>
            <if test="cnyFpCumReturn != null "> and t.cny_fp_cum_return = #{cnyFpCumReturn}</if>
            <if test="cnyInstCumReturn != null "> and t.cny_inst_cum_return = #{cnyInstCumReturn}</if>
            <if test="cnyNewCumReturn != null "> and t.cny_new_cum_return = #{cnyNewCumReturn}</if>
            <if test="cnyRcvblsCumReturn != null "> and t.cny_rcvbls_cum_return = #{cnyRcvblsCumReturn}</if>
            <if test="cnyBdgtCmplRate != null "> and t.cny_bdgt_cmpl_rate = #{cnyBdgtCmplRate}</if>
            <if test="cnyRcvblsCmplRate != null "> and t.cny_rcvbls_cmpl_rate = #{cnyRcvblsCmplRate}</if>
            <if test="cnyCynCmplRate != null "> and t.cny_cyn_cmpl_rate = #{cnyCynCmplRate}</if>
            <if test="cnyPtCmplRate != null "> and t.cny_pt_cmpl_rate = #{cnyPtCmplRate}</if>
            <if test="defFlag != null  and defFlag != ''"> and t.def_flag = #{defFlag}</if>
            <if test="startFiscalYear != null  and startFiscalYear != ''"> and t.fiscal_year &gt;= #{startFiscalYear}</if>
            <if test="finishFiscalYear != null  and finishFiscalYear != ''"> and t.fiscal_year &lt;= #{finishFiscalYear}</if>
            <!-- 数据范围过滤 -->
            ${params.dataScope}
        </where>
    </select>

    <select id="selectMcBasicMoneyById" parameterType="Long" resultMap="McBasicMoneyResult">
        <include refid="selectMcBasicMoneyVo"/>
        where id = #{id}
    </select>

    <insert id="insertMcBasicMoney" parameterType="com.chinagas.modules.schsf.domain.McBasicMoney">
        insert into mc_basic_money
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="fiscalYear != null">fiscal_year,</if>
            <if test="regionName != null and regionName != ''">region_name,</if>
            <if test="groupName != null and groupName != ''">group_name,</if>
            <if test="companyName != null and companyName != ''">company_name,</if>
            <if test="companyCode != null and companyCode != ''">company_code,</if>
            <if test="province != null">province,</if>
            <if test="city != null">city,</if>
            <if test="district != null">district,</if>
            <if test="street != null">street,</if>
            <if test="vlgOrCmty != null">vlg_or_cmty,</if>
            <if test="respPerson != null">resp_person,</if>
            <if test="urbRurCls != null">urb_rur_cls,</if>
            <if test="budgConfPrev != null">budg_conf_prev,</if>
            <if test="budgConfNew != null">budg_conf_new,</if>
            <if test="budgTotal != null">budg_total,</if>
            <if test="quarterlyTarget != null">quarterly_target,</if>
            <if test="cnyGsgCharged != null">cny_gsg_charged,</if>
            <if test="cnyGsgUncharged != null">cny_gsg_uncharged,</if>
            <if test="cnyGsgTotal != null">cny_gsg_total,</if>
            <if test="cnyYrFull != null">cny_yr_full,</if>
            <if test="cnyYrInstal != null">cny_yr_instal,</if>
            <if test="cnyPrevFull != null">cny_prev_full,</if>
            <if test="cnyPrevInstall != null">cny_prev_install,</if>
            <if test="cnyMarketCumr != null">cny_market_cumr,</if>
            <if test="cnyFyCumReturn != null">cny_fy_cum_return,</if>
            <if test="cnyFpCumReturn != null">cny_fp_cum_return,</if>
            <if test="cnyInstCumReturn != null">cny_inst_cum_return,</if>
            <if test="cnyNewCumReturn != null">cny_new_cum_return,</if>
            <if test="cnyRcvblsCumReturn != null">cny_rcvbls_cum_return,</if>
            <if test="cnyBdgtCmplRate != null">cny_bdgt_cmpl_rate,</if>
            <if test="cnyRcvblsCmplRate != null">cny_rcvbls_cmpl_rate,</if>
            <if test="cnyCynCmplRate != null">cny_cyn_cmpl_rate,</if>
            <if test="cnyPtCmplRate != null">cny_pt_cmpl_rate,</if>
            <if test="remark != null">remark,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createBy != null and createBy != ''">create_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateBy != null and updateBy != ''">update_by,</if>
            <if test="defFlag != null and defFlag != ''">def_flag,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="fiscalYear != null">#{fiscalYear},</if>
            <if test="regionName != null and regionName != ''">#{regionName},</if>
            <if test="groupName != null and groupName != ''">#{groupName},</if>
            <if test="companyName != null and companyName != ''">#{companyName},</if>
            <if test="companyCode != null and companyCode != ''">#{companyCode},</if>
            <if test="province != null">#{province},</if>
            <if test="city != null">#{city},</if>
            <if test="district != null">#{district},</if>
            <if test="street != null">#{street},</if>
            <if test="vlgOrCmty != null">#{vlgOrCmty},</if>
            <if test="respPerson != null">#{respPerson},</if>
            <if test="urbRurCls != null">#{urbRurCls},</if>
            <if test="budgConfPrev != null">#{budgConfPrev},</if>
            <if test="budgConfNew != null">#{budgConfNew},</if>
            <if test="budgTotal != null">#{budgTotal},</if>
            <if test="quarterlyTarget != null">#{quarterlyTarget},</if>
            <if test="cnyGsgCharged != null">#{cnyGsgCharged},</if>
            <if test="cnyGsgUncharged != null">#{cnyGsgUncharged},</if>
            <if test="cnyGsgTotal != null">#{cnyGsgTotal},</if>
            <if test="cnyYrFull != null">#{cnyYrFull},</if>
            <if test="cnyYrInstal != null">#{cnyYrInstal},</if>
            <if test="cnyPrevFull != null">#{cnyPrevFull},</if>
            <if test="cnyPrevInstall != null">#{cnyPrevInstall},</if>
            <if test="cnyMarketCumr != null">#{cnyMarketCumr},</if>
            <if test="cnyFyCumReturn != null">#{cnyFyCumReturn},</if>
            <if test="cnyFpCumReturn != null">#{cnyFpCumReturn},</if>
            <if test="cnyInstCumReturn != null">#{cnyInstCumReturn},</if>
            <if test="cnyNewCumReturn != null">#{cnyNewCumReturn},</if>
            <if test="cnyRcvblsCumReturn != null">#{cnyRcvblsCumReturn},</if>
            <if test="cnyBdgtCmplRate != null">#{cnyBdgtCmplRate},</if>
            <if test="cnyRcvblsCmplRate != null">#{cnyRcvblsCmplRate},</if>
            <if test="cnyCynCmplRate != null">#{cnyCynCmplRate},</if>
            <if test="cnyPtCmplRate != null">#{cnyPtCmplRate},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createBy != null and createBy != ''">#{createBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
            <if test="defFlag != null and defFlag != ''">#{defFlag},</if>
         </trim>
    </insert>

    <update id="updateMcBasicMoney" parameterType="com.chinagas.modules.schsf.domain.McBasicMoney">
        update mc_basic_money
        <trim prefix="SET" suffixOverrides=",">
            <if test="fiscalYear != null">fiscal_year = #{fiscalYear},</if>
            <if test="regionName != null and regionName != ''">region_name = #{regionName},</if>
            <if test="groupName != null and groupName != ''">group_name = #{groupName},</if>
            <if test="companyName != null and companyName != ''">company_name = #{companyName},</if>
            <if test="companyCode != null and companyCode != ''">company_code = #{companyCode},</if>
            <if test="province != null">province = #{province},</if>
            <if test="city != null">city = #{city},</if>
            <if test="district != null">district = #{district},</if>
            <if test="street != null">street = #{street},</if>
            <if test="vlgOrCmty != null">vlg_or_cmty = #{vlgOrCmty},</if>
            <if test="respPerson != null">resp_person = #{respPerson},</if>
            <if test="urbRurCls != null">urb_rur_cls = #{urbRurCls},</if>
            <if test="budgConfPrev != null">budg_conf_prev = #{budgConfPrev},</if>
            <if test="budgConfNew != null">budg_conf_new = #{budgConfNew},</if>
            <if test="budgTotal != null">budg_total = #{budgTotal},</if>
            <if test="quarterlyTarget != null">quarterly_target = #{quarterlyTarget},</if>
            <if test="cnyGsgCharged != null">cny_gsg_charged = #{cnyGsgCharged},</if>
            <if test="cnyGsgUncharged != null">cny_gsg_uncharged = #{cnyGsgUncharged},</if>
            <if test="cnyGsgTotal != null">cny_gsg_total = #{cnyGsgTotal},</if>
            <if test="cnyYrFull != null">cny_yr_full = #{cnyYrFull},</if>
            <if test="cnyYrInstal != null">cny_yr_instal = #{cnyYrInstal},</if>
            <if test="cnyPrevFull != null">cny_prev_full = #{cnyPrevFull},</if>
            <if test="cnyPrevInstall != null">cny_prev_install = #{cnyPrevInstall},</if>
            <if test="cnyMarketCumr != null">cny_market_cumr = #{cnyMarketCumr},</if>
            <if test="cnyFyCumReturn != null">cny_fy_cum_return = #{cnyFyCumReturn},</if>
            <if test="cnyFpCumReturn != null">cny_fp_cum_return = #{cnyFpCumReturn},</if>
            <if test="cnyInstCumReturn != null">cny_inst_cum_return = #{cnyInstCumReturn},</if>
            <if test="cnyNewCumReturn != null">cny_new_cum_return = #{cnyNewCumReturn},</if>
            <if test="cnyRcvblsCumReturn != null">cny_rcvbls_cum_return = #{cnyRcvblsCumReturn},</if>
            <if test="cnyBdgtCmplRate != null">cny_bdgt_cmpl_rate = #{cnyBdgtCmplRate},</if>
            <if test="cnyRcvblsCmplRate != null">cny_rcvbls_cmpl_rate = #{cnyRcvblsCmplRate},</if>
            <if test="cnyCynCmplRate != null">cny_cyn_cmpl_rate = #{cnyCynCmplRate},</if>
            <if test="cnyPtCmplRate != null">cny_pt_cmpl_rate = #{cnyPtCmplRate},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            <if test="defFlag != null and defFlag != ''">def_flag = #{defFlag},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteMcBasicMoneyById" parameterType="Long">
        delete from mc_basic_money where id = #{id}
    </delete>

    <delete id="deleteMcBasicMoneyByIds" parameterType="String">
        delete from mc_basic_money where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>