| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- <?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.ydtech.modules.esm.dao.EsmSocialSecurityDao">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.esm.model.EsmSocialSecurity">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="dept_id" jdbcType="VARCHAR" property="deptId"/>
- <result column="dept_name" jdbcType="VARCHAR" property="deptName"/>
- <result column="user_id" jdbcType="VARCHAR" property="userId"/>
- <result column="user_name" jdbcType="VARCHAR" property="userName"/>
- <result column="pay_year" jdbcType="VARCHAR" property="payYear"/>
- <result column="pay_month" jdbcType="VARCHAR" property="payMonth"/>
- <result column="pension_com" jdbcType="VARCHAR" property="pensionCom"/>
- <result column="pension_self" jdbcType="VARCHAR" property="pensionSelf"/>
- <result column="pension_com2" jdbcType="VARCHAR" property="pensionCom2"/>
- <result column="pension_self2" jdbcType="VARCHAR" property="pensionSelf2"/>
- <result column="medical_com" jdbcType="VARCHAR" property="medicalCom"/>
- <result column="medical_self" jdbcType="VARCHAR" property="medicalSelf"/>
- <result column="medical_com2" jdbcType="VARCHAR" property="medicalCom2"/>
- <result column="medical_self2" jdbcType="VARCHAR" property="medicalSelf2"/>
- <result column="dabing_com" jdbcType="VARCHAR" property="dabingCom"/>
- <result column="dabing_com2" jdbcType="VARCHAR" property="dabingCom2"/>
- <result column="injury_com" jdbcType="VARCHAR" property="injuryCom"/>
- <result column="injury_com2" jdbcType="VARCHAR" property="injuryCom2"/>
- <result column="bear_com" jdbcType="VARCHAR" property="bearCom"/>
- <result column="bear_com2" jdbcType="VARCHAR" property="bearCom2"/>
- <result column="jobless_com" jdbcType="VARCHAR" property="joblessCom"/>
- <result column="jobless_self" jdbcType="VARCHAR" property="joblessSelf"/>
- <result column="jobless_com2" jdbcType="VARCHAR" property="joblessCom2"/>
- <result column="jobless_self2" jdbcType="VARCHAR" property="joblessSelf2"/>
- <result column="accu_fund_com" jdbcType="VARCHAR" property="accuFundCom"/>
- <result column="accu_fund_self" jdbcType="VARCHAR" property="accuFundSelf"/>
- <result column="accu_fund_com2" jdbcType="VARCHAR" property="accuFundCom2"/>
- <result column="accu_fund_self2" jdbcType="VARCHAR" property="accuFundSelf2"/>
- <result column="comment" jdbcType="VARCHAR" property="comment"/>
- <result column="create_user" jdbcType="VARCHAR" property="createUser"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="reviewer" jdbcType="VARCHAR" property="reviewer"/>
- <result column="review_time" jdbcType="TIMESTAMP" property="reviewTime"/>
- <result column="review_status" jdbcType="VARCHAR" property="reviewStatus"/>
- <result column="submit_time" jdbcType="TIMESTAMP" property="submittime"/>
- <result column="submit_checkid" jdbcType="VARCHAR" property="submitcheckid"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, dept_id, dept_name, user_id, user_name, pay_year, pay_month, pension_com, pension_self,
- pension_com2, pension_self2, medical_com, medical_self, medical_com2, medical_self2, dabing_com, dabing_com2,
- injury_com, injury_com2, bear_com, bear_com2, jobless_com, jobless_self, jobless_com2, jobless_self2, accu_fund_com,
- accu_fund_self, accu_fund_com2, accu_fund_self2, comment, create_user, create_time,
- reviewer, review_time, review_status, submit_time, submit_checkid
- </sql>
- <delete id="batchDelete">
- delete from esm_social_security where (pay_year, pay_month, user_id) in
- <foreach collection="voList" item="item" index="index" separator="," open="(" close=")">
- (#{item.payYear, jdbcType=VARCHAR}, cast(#{item.payMonth, jdbcType=VARCHAR} AS SIGNED),
- #{item.userId, jdbcType=VARCHAR} )
- </foreach>
- </delete>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from esm_social_security
- where id = #{id,jdbcType=BIGINT}
- </select>
- <insert id="batchInsert">
- insert into esm_social_security (dept_id, dept_name,
- user_id, user_name, pay_year,
- pay_month, pension_com, pension_self,
- pension_com2, pension_self2, medical_com,
- medical_self, medical_com2, medical_self2,dabing_com, dabing_com2,
- injury_com, injury_com2, bear_com,
- bear_com2, jobless_com, jobless_self, jobless_com2, jobless_self2,
- accu_fund_com, accu_fund_self, accu_fund_com2,
- accu_fund_self2, comment, create_user
- ) VALUES
- <foreach collection="list" index="i" item="item" separator=",">
- (
- #{item.deptId},
- #{item.deptName},
- #{item.userId},
- #{item.userName},
- #{item.payYear},
- #{item.payMonth},
- #{item.pensionCom},
- #{item.pensionSelf},
- #{item.pensionCom2},
- #{item.pensionSelf2},
- #{item.medicalCom},
- #{item.medicalSelf},
- #{item.medicalCom2},
- #{item.medicalSelf2},
- #{item.dabingCom},
- #{item.dabingCom2},
- #{item.injuryCom},
- #{item.injuryCom2},
- #{item.bearCom},
- #{item.bearCom2},
- #{item.joblessCom},
- #{item.joblessSelf},
- #{item.joblessCom2},
- #{item.joblessSelf2},
- #{item.accuFundCom},
- #{item.accuFundSelf},
- #{item.accuFundCom2},
- #{item.accuFundSelf2},
- #{item.comment},
- #{createUser}
- )
- </foreach>
- </insert>
- <select id="listPage" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from esm_social_security
- <where>
- <trim prefixOverrides="and">
- <if test='reviewStatus != null and reviewStatus != ""'>
- review_status = #{reviewStatus}
- </if>
- <if test='userName != null and userName != ""'>
- and user_name like CONCAT('%', #{userName}, '%')
- </if>
- <if test='payYearList != null'>
- and pay_year in
- <foreach collection="payYearList" index="i" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test='payMonthList != null'>
- and pay_month in
- <foreach collection="payMonthList" index="i" item="item" separator="," open="(" close=")">
- cast(#{item} AS SIGNED)
- </foreach>
- </if>
- <if test='deptId != null and deptId != ""'>
- and dept_id like CONCAT(#{deptId}, '%')
- </if>
- </trim>
- </where>
- order by create_time desc
- </select>
- <select id="getSocialByUserIdAndYearAndMonth" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from esm_social_security
- <where>
- review_status != '2' and
- <trim prefixOverrides="and">
- <if test='userId != null and userId != ""'>
- and user_id = #{userId}
- </if>
- <if test='payYear != null and payYear != ""'>
- and pay_year = #{payYear}
- </if>
- <if test='payMonth != null and payMonth != ""'>
- and pay_month = cast(#{payMonth} AS SIGNED)
- </if>
- </trim>
- </where>
- </select>
- <select id="batchSelect" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from
- esm_social_security
- where review_status in('0','1')
- and id in
- <foreach collection="ids" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </select>
- <select id="listSocialCheck" resultType="com.ydtech.modules.esm.model.vo.res.EsmSocialSecurityRes">
- select
- distinct
- SUBSTR(dept_id, 1, 5) deptId,
- IF(SUBSTR(dept_id, 1, 5) like '%D%',
- (select a.name from sys_dept a where a.parent_id ='100' and a.id=dept_id),
- (select a.name from sys_dept a where a.parent_id ='100' and a.id=(SUBSTR(dept_id, 1, 5)))) deptName,
- /*pay_year payYear,
- pay_month payMonth,*/
- create_user createUser,
- (select name from sys_user where id = create_user)createUserName,
- submit_time submittime,
- submit_checkid submitcheckid,
- reviewer reviewer,
- (select name from sys_user where id = reviewer)reviewerName,
- review_time reviewTime,
- review_status reviewStatus
- from esm_social_security
- <where>
- <trim prefixOverrides="and">
- <if test='reviewStatus != null and reviewStatus != ""'>
- review_status = #{reviewStatus}
- </if>
- <if test='payYearList != null'>
- and pay_year in
- <foreach collection="payYearList" index="i" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test='payMonthList != null'>
- and pay_month in
- <foreach collection="payMonthList" index="i" item="item" separator="," open="(" close=")">
- cast(#{item} AS SIGNED)
- </foreach>
- </if>
- <if test='deptId != null and deptId != ""'>
- and dept_id like CONCAT(#{deptId}, '%')
- </if>
- </trim>
- </where>
- order by submit_checkid desc
- </select>
- <select id="selectByCheckId" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from esm_social_security
- where submit_checkid=#{submitcheckid}
- </select>
- <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.esm.model.EsmSocialSecurity">
- update esm_social_security
- <set>
- <if test="deptId != null">
- dept_id = #{deptId,jdbcType=VARCHAR},
- </if>
- <if test="deptName != null">
- dept_name = #{deptName,jdbcType=VARCHAR},
- </if>
- <if test="userId != null">
- user_id = #{userId,jdbcType=VARCHAR},
- </if>
- <if test="userName != null">
- user_name = #{userName,jdbcType=VARCHAR},
- </if>
- <if test="payYear != null">
- pay_year = #{payYear,jdbcType=VARCHAR},
- </if>
- <if test="payMonth != null">
- pay_month = cast(#{payMonth,jdbcType=VARCHAR} AS SIGNED),
- </if>
- <if test="pensionCom != null">
- pension_com = #{pensionCom,jdbcType=VARCHAR},
- </if>
- <if test="pensionSelf != null">
- pension_self = #{pensionSelf,jdbcType=VARCHAR},
- </if>
- <if test="pensionCom2 != null">
- pension_com2 = #{pensionCom2,jdbcType=VARCHAR},
- </if>
- <if test="pensionSelf2 != null">
- pension_self2 = #{pensionSelf2,jdbcType=VARCHAR},
- </if>
- <if test="medicalCom != null">
- medical_com = #{medicalCom,jdbcType=VARCHAR},
- </if>
- <if test="medicalSelf != null">
- medical_self = #{medicalSelf,jdbcType=VARCHAR},
- </if>
- <if test="medicalCom2 != null">
- medical_com2 = #{medicalCom2,jdbcType=VARCHAR},
- </if>
- <if test="medicalSelf2 != null">
- medical_self2 = #{medicalSelf2,jdbcType=VARCHAR},
- </if>
- <if test="dabingCom != null">
- dabing_com = #{dabingCom,jdbcType=VARCHAR},
- </if>
- <if test="dabingCom2 != null">
- dabing_com2 = #{dabingCom2,jdbcType=VARCHAR},
- </if>
- <if test="injuryCom != null">
- injury_com = #{injuryCom,jdbcType=VARCHAR},
- </if>
- <if test="injuryCom2 != null">
- injury_com2 = #{injuryCom2,jdbcType=VARCHAR},
- </if>
- <if test="bearCom != null">
- bear_com = #{bearCom,jdbcType=VARCHAR},
- </if>
- <if test="bearCom2 != null">
- bear_com2 = #{bearCom2,jdbcType=VARCHAR},
- </if>
- <if test="joblessCom != null">
- jobless_com = #{joblessCom,jdbcType=VARCHAR},
- </if>
- <if test="joblessSelf != null">
- jobless_self = #{joblessSelf,jdbcType=VARCHAR},
- </if>
- <if test="joblessCom2 != null">
- jobless_com2 = #{joblessCom2,jdbcType=VARCHAR},
- </if>
- <if test="joblessSelf2 != null">
- jobless_self2 = #{joblessSelf2,jdbcType=VARCHAR},
- </if>
- <if test="accuFundCom != null">
- accu_fund_com = #{accuFundCom,jdbcType=VARCHAR},
- </if>
- <if test="accuFundSelf != null">
- accu_fund_self = #{accuFundSelf,jdbcType=VARCHAR},
- </if>
- <if test="accuFundCom2 != null">
- accu_fund_com2 = #{accuFundCom2,jdbcType=VARCHAR},
- </if>
- <if test="accuFundSelf2 != null">
- accu_fund_self2 = #{accuFundSelf2,jdbcType=VARCHAR},
- </if>
- <if test="comment != null">
- comment = #{comment,jdbcType=VARCHAR},
- </if>
- <if test="createUser != null">
- create_user = #{createUser,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="reviewer != null">
- reviewer = #{reviewer,jdbcType=VARCHAR},
- </if>
- <if test="reviewTime != null">
- review_time = #{reviewTime,jdbcType=TIMESTAMP},
- </if>
- <if test="reviewStatus != null">
- review_status = #{reviewStatus,jdbcType=VARCHAR},
- </if>
- <if test="submittime != null">
- submit_time = #{submittime,jdbcType=TIMESTAMP},
- </if>
- <if test="submitcheckid != null">
- submit_checkid = #{submitcheckid,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateReview" parameterType="com.ydtech.modules.esm.model.EsmSocialSecurity">
- update esm_social_security
- set reviewer = #{model.reviewer},
- review_status = #{model.reviewStatus},
- review_time = #{model.reviewTime}
- where submit_checkid = #{model.submitcheckid}
- </update>
- <update id="submitAuditSocial">
- update esm_social_security set
- review_status = '0',
- submit_time = #{social.submittime,jdbcType=TIMESTAMP },
- submit_checkid = #{social.submitcheckid,jdbcType=VARCHAR }
- where id in
- <foreach collection="idList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </update>
- </mapper>
|