117 lines
6.5 KiB
XML
117 lines
6.5 KiB
XML
|
<?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.yanzhu.jh.project.mapper.SurProjectWorkSpecialMapper">
|
||
|
|
||
|
<resultMap type="SurProjectWorkSpecial" id="SurProjectWorkSpecialResult">
|
||
|
<result property="id" column="id" />
|
||
|
<result property="projectId" column="project_id" />
|
||
|
<result property="deptId" column="dept_id" />
|
||
|
<result property="name" column="name" />
|
||
|
<result property="sex" column="sex" />
|
||
|
<result property="age" column="age" />
|
||
|
<result property="idNumber" column="id_number" />
|
||
|
<result property="isCredential" column="is_credential" />
|
||
|
<result property="credentialNumber" column="credential_number" />
|
||
|
<result property="credentialExpirationTime" column="credential_expiration_time" />
|
||
|
<result property="isDel" column="is_del" />
|
||
|
<result property="createBy" column="create_by" />
|
||
|
<result property="createTime" column="create_time" />
|
||
|
<result property="updateBy" column="update_by" />
|
||
|
<result property="updateTime" column="update_time" />
|
||
|
<result property="remark" column="remark" />
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectSurProjectWorkSpecialVo">
|
||
|
select id, project_id, dept_id, name, sex, age, id_number, is_credential, credential_number, credential_expiration_time, is_del, create_by, create_time, update_by, update_time, remark from sur_project_work_special
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectSurProjectWorkSpecialList" parameterType="SurProjectWorkSpecial" resultMap="SurProjectWorkSpecialResult">
|
||
|
<include refid="selectSurProjectWorkSpecialVo"/>
|
||
|
<where>
|
||
|
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||
|
<if test="isCredential != null and isCredential != ''"> and is_credential = #{isCredential}</if>
|
||
|
<if test="params.beginCredentialExpirationTime != null and params.beginCredentialExpirationTime != '' and params.endCredentialExpirationTime != null and params.endCredentialExpirationTime != ''"> and credential_expiration_time between #{params.beginCredentialExpirationTime} and #{params.endCredentialExpirationTime}</if>
|
||
|
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectSurProjectWorkSpecialById" parameterType="Long" resultMap="SurProjectWorkSpecialResult">
|
||
|
<include refid="selectSurProjectWorkSpecialVo"/>
|
||
|
where id = #{id}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertSurProjectWorkSpecial" parameterType="SurProjectWorkSpecial" useGeneratedKeys="true" keyProperty="id">
|
||
|
insert into sur_project_work_special
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="projectId != null">project_id,</if>
|
||
|
<if test="deptId != null">dept_id,</if>
|
||
|
<if test="name != null">name,</if>
|
||
|
<if test="sex != null">sex,</if>
|
||
|
<if test="age != null">age,</if>
|
||
|
<if test="idNumber != null">id_number,</if>
|
||
|
<if test="isCredential != null">is_credential,</if>
|
||
|
<if test="credentialNumber != null">credential_number,</if>
|
||
|
<if test="credentialExpirationTime != null">credential_expiration_time,</if>
|
||
|
<if test="isDel != null">is_del,</if>
|
||
|
<if test="createBy != null">create_by,</if>
|
||
|
<if test="createTime != null">create_time,</if>
|
||
|
<if test="updateBy != null">update_by,</if>
|
||
|
<if test="updateTime != null">update_time,</if>
|
||
|
<if test="remark != null">remark,</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="projectId != null">#{projectId},</if>
|
||
|
<if test="deptId != null">#{deptId},</if>
|
||
|
<if test="name != null">#{name},</if>
|
||
|
<if test="sex != null">#{sex},</if>
|
||
|
<if test="age != null">#{age},</if>
|
||
|
<if test="idNumber != null">#{idNumber},</if>
|
||
|
<if test="isCredential != null">#{isCredential},</if>
|
||
|
<if test="credentialNumber != null">#{credentialNumber},</if>
|
||
|
<if test="credentialExpirationTime != null">#{credentialExpirationTime},</if>
|
||
|
<if test="isDel != null">#{isDel},</if>
|
||
|
<if test="createBy != null">#{createBy},</if>
|
||
|
<if test="createTime != null">#{createTime},</if>
|
||
|
<if test="updateBy != null">#{updateBy},</if>
|
||
|
<if test="updateTime != null">#{updateTime},</if>
|
||
|
<if test="remark != null">#{remark},</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateSurProjectWorkSpecial" parameterType="SurProjectWorkSpecial">
|
||
|
update sur_project_work_special
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="projectId != null">project_id = #{projectId},</if>
|
||
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
||
|
<if test="name != null">name = #{name},</if>
|
||
|
<if test="sex != null">sex = #{sex},</if>
|
||
|
<if test="age != null">age = #{age},</if>
|
||
|
<if test="idNumber != null">id_number = #{idNumber},</if>
|
||
|
<if test="isCredential != null">is_credential = #{isCredential},</if>
|
||
|
<if test="credentialNumber != null">credential_number = #{credentialNumber},</if>
|
||
|
<if test="credentialExpirationTime != null">credential_expiration_time = #{credentialExpirationTime},</if>
|
||
|
<if test="isDel != null">is_del = #{isDel},</if>
|
||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteSurProjectWorkSpecialById" parameterType="Long">
|
||
|
delete from sur_project_work_special where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteSurProjectWorkSpecialByIds" parameterType="String">
|
||
|
delete from sur_project_work_special where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
</mapper>
|