XcglAssoZxfjkcMapper.xml 7.53 KB
Newer Older
yuquan.zhu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
<?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="cn.timer.api.dao.xcgl.XcglAssoZxfjkcMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.xcgl.XcglAssoZxfjkc" >
                <id column="id" property="id" />
                <result column="userid" property="userid" />
                <result column="taxmonth" property="taxmonth" />
                <result column="childrenedu" property="childrenedu" />
                <result column="houseloans" property="houseloans" />
                <result column="houserents" property="houserents" />
                <result column="supportolder" property="supportolder" />
                <result column="continueedu" property="continueedu" />
                <result column="totalmoney" property="totalmoney" />
                <result column="addtime" property="addtime" />
                <result column="qyid" property="qyid" />
    </resultMap>
    
    <resultMap id="AdditionalDeductionMap" type="cn.timer.api.dto.xcgl.AdditionalDeductionDto" >
                <result column="zxfjid" property="zxfjid" />
                <result column="name" property="name" />
                <result column="empNum" property="empNum" />
                <result column="zljy" property="zljy" />
                <result column="zfdk" property="zfdk" />
                <result column="zfzj" property="zfzj" />
                <result column="sylr" property="sylr" />
                <result column="jxjy" property="jxjy" />
                <result column="lj" property="lj" />
    </resultMap>

    <sql id="Base_Column_List">
                id,
                userid,
                taxmonth,
                childrenedu,
                houseloans,
                houserents,
                supportolder,
                continueedu,
                totalmoney,
                addtime,
                qyid
    </sql>
    
    <sql id="Base_Column_List_Alias">
                id XcglAssoZxfjkc_id,
                userid XcglAssoZxfjkc_userid,
                taxmonth XcglAssoZxfjkc_taxmonth,
                childrenedu XcglAssoZxfjkc_childrenedu,
                houseloans XcglAssoZxfjkc_houseloans,
                houserents XcglAssoZxfjkc_houserents,
                supportolder XcglAssoZxfjkc_supportolder,
                continueedu XcglAssoZxfjkc_continueedu,
                totalmoney XcglAssoZxfjkc_totalmoney,
                addtime XcglAssoZxfjkc_addtime,
                qyid XcglAssoZxfjkc_qyid
    </sql>
	
	<select id="selectAdditionalDeduction" resultMap="AdditionalDeductionMap">
		select emp.`name` as name,
			emp.emp_num as empNum,
			zxfj.id as zxfjid,
			zxfj.childrenedu as zljy,
			zxfj.houseloans as zfdk,
			zxfj.houserents as zfzj,
			zxfj.supportolder as sylr,
			zxfj.continueedu as jxjy,
			zxfj.totalmoney as lj
		from yggl_main_emp emp
		LEFT JOIN xcgl_asso_zxfjkc as zxfj on zxfj.userid = emp.emp_num 
		<if test="datetime != ''" >
			and zxfj.taxmonth = #{datetime}
		</if>
		where emp.org_code = #{orgcode}
		
		<if test="status != ''" >
			and emp.job_status = #{status}
		</if>
		<if test="text != ''" >
			and (emp.`name` like CONCAT('%',#{text},'%') or emp.emp_num = #{text})
		</if>
	</select>

    <insert id="insertXcglAssoZxfjkc" parameterType="cn.timer.api.bean.xcgl.XcglAssoZxfjkc" useGeneratedKeys="true" keyProperty="id">
        INSERT INTO xcgl_asso_zxfjkc
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != userid'>
                        userid,
                        </if>
                        <if test ='null != taxmonth'>
                        taxmonth,
                        </if>
                        <if test ='null != childrenedu'>
                        childrenedu,
                        </if>
                        <if test ='null != houseloans'>
                        houseloans,
                        </if>
                        <if test ='null != houserents'>
                        houserents,
                        </if>
                        <if test ='null != supportolder'>
                        supportolder,
                        </if>
                        <if test ='null != continueedu'>
                        continueedu,
                        </if>
                        <if test ='null != totalmoney'>
                        totalmoney,
                        </if>
                        <if test ='null != addtime'>
                        addtime,
                        </if>
                        <if test ='null != qyid'>
                        qyid
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != userid'>
                        #{userid},
                        </if>
                        <if test ='null != taxmonth'>
                        #{taxmonth},
                        </if>
                        <if test ='null != childrenedu'>
                        #{childrenedu},
                        </if>
                        <if test ='null != houseloans'>
                        #{houseloans},
                        </if>
                        <if test ='null != houserents'>
                        #{houserents},
                        </if>
                        <if test ='null != supportolder'>
                        #{supportolder},
                        </if>
                        <if test ='null != continueedu'>
                        #{continueedu},
                        </if>
                        <if test ='null != totalmoney'>
                        #{totalmoney},
                        </if>
                        <if test ='null != addtime'>
                        #{addtime},
                        </if>
                        <if test ='null != qyid'>
                        #{qyid}
                        </if>
        </trim>
    </insert>

153
    <!-- <delete id="delete" >
yuquan.zhu committed
154 155
        DELETE FROM xcgl_asso_zxfjkc
        WHERE id = #{id}
156
    </delete> -->
yuquan.zhu committed
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175

    <update id="updateXcglAssoZxfjkc" parameterType="cn.timer.api.bean.xcgl.XcglAssoZxfjkc">
        UPDATE xcgl_asso_zxfjkc
        <set>
                    <if test ='null != userid'>userid = #{userid},</if>
                    <if test ='null != taxmonth'>taxmonth = #{taxmonth},</if>
                    <if test ='null != childrenedu'>childrenedu = #{childrenedu},</if>
                    <if test ='null != houseloans'>houseloans = #{houseloans},</if>
                    <if test ='null != houserents'>houserents = #{houserents},</if>
                    <if test ='null != supportolder'>supportolder = #{supportolder},</if>
                    <if test ='null != continueedu'>continueedu = #{continueedu},</if>
                    <if test ='null != totalmoney'>totalmoney = #{totalmoney},</if>
                    <if test ='null != addtime'>addtime = #{addtime},</if>
                    <if test ='null != qyid'>qyid = #{qyid}</if>
        </set>
        WHERE id = #{id}
    </update>


176
   <!--  <select id="load" resultMap="BaseResultMap">
yuquan.zhu committed
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
        SELECT <include refid="Base_Column_List" />
        FROM xcgl_asso_zxfjkc
        WHERE id = #{id}
    </select>

    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM xcgl_asso_zxfjkc
        LIMIT #{offset}, #{pageSize}
    </select>

    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM xcgl_asso_zxfjkc
    </select>
192
 -->
yuquan.zhu committed
193 194

</mapper>