123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?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.ruoyi.project.production.mapper.TPpeCmldefLockerMapper">
- <resultMap type="TPpeCmldefLocker" id="TPpeCmldefLockerResult">
- <result property="id" column="id" />
- <result property="ppeType" column="ppe_type" />
- <result property="usePost" column="use_post" />
- <result property="isEquip" column="is_equip" />
- <result property="isPollution" column="is_pollution" />
- <result property="putAsRequired" column="put_as_required" />
- <result property="isIdentification" column="is_identification" />
- <result property="mainId" column="main_id" />
- <result property="delFlag" column="del_flag" />
- <result property="createrCode" column="creater_code" />
- <result property="createdate" column="createdate" />
- <result property="updaterCode" column="updater_code" />
- <result property="updatedate" column="updatedate" />
- <result property="remarks" column="remarks" />
- <result property="deptId" column="dept_id" />
- <result property="deptName" column="dept_name" />
- </resultMap>
- <sql id="selectTPpeCmldefLockerVo">
- select d.id, d.ppe_type, d.use_post, d.is_equip, d.is_pollution, d.put_as_required, d.is_identification, d.main_id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id ,s.dept_name from t_ppe_cmldef_locker d
- left join sys_dept s on s.dept_id = d.dept_id
- </sql>
- <select id="selectTPpeCmldefLockerList" parameterType="TPpeCmldefLocker" resultMap="TPpeCmldefLockerResult">
- <include refid="selectTPpeCmldefLockerVo"/>
- <where>
- <if test="ppeType != null and ppeType != ''"> and ppe_type = #{ppeType}</if>
- <if test="usePost != null and usePost != ''"> and use_post = #{usePost}</if>
- <if test="isEquip != null and isEquip != ''"> and is_equip = #{isEquip}</if>
- <if test="isPollution != null and isPollution != ''"> and is_pollution = #{isPollution}</if>
- <if test="putAsRequired != null and putAsRequired != ''"> and put_as_required = #{putAsRequired}</if>
- <if test="isIdentification != null and isIdentification != ''"> and is_identification = #{isIdentification}</if>
- <if test="mainId != null "> and main_id = #{mainId}</if>
- <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
- <if test="createdate != null "> and createdate = #{createdate}</if>
- <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
- <if test="updatedate != null "> and updatedate = #{updatedate}</if>
- <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
- <if test="deptId != null "> and dept_id = #{deptId}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- order by createdate asc
- </select>
- <select id="selectTPpeCmldefLockerById" parameterType="Long" resultMap="TPpeCmldefLockerResult">
- <include refid="selectTPpeCmldefLockerVo"/>
- where id = #{id}
- </select>
- <select id="selectTPpeCmldefLockerListByMainId" parameterType="Long" resultMap="TPpeCmldefLockerResult">
- <include refid="selectTPpeCmldefLockerVo"/>
- where main_id = #{mainId}
- order by createdate
- </select>
- <insert id="insertTPpeCmldefLocker" parameterType="TPpeCmldefLocker">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_ppe_cmldef_locker.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_ppe_cmldef_locker
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="ppeType != null">ppe_type,</if>
- <if test="usePost != null">use_post,</if>
- <if test="isEquip != null">is_equip,</if>
- <if test="isPollution != null">is_pollution,</if>
- <if test="putAsRequired != null">put_as_required,</if>
- <if test="isIdentification != null">is_identification,</if>
- <if test="mainId != null">main_id,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createrCode != null">creater_code,</if>
- <if test="createdate != null">createdate,</if>
- <if test="updaterCode != null">updater_code,</if>
- <if test="updatedate != null">updatedate,</if>
- <if test="remarks != null">remarks,</if>
- <if test="deptId != null">dept_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="ppeType != null">#{ppeType},</if>
- <if test="usePost != null">#{usePost},</if>
- <if test="isEquip != null">#{isEquip},</if>
- <if test="isPollution != null">#{isPollution},</if>
- <if test="putAsRequired != null">#{putAsRequired},</if>
- <if test="isIdentification != null">#{isIdentification},</if>
- <if test="mainId != null">#{mainId},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createrCode != null">#{createrCode},</if>
- <if test="createdate != null">#{createdate},</if>
- <if test="updaterCode != null">#{updaterCode},</if>
- <if test="updatedate != null">#{updatedate},</if>
- <if test="remarks != null">#{remarks},</if>
- <if test="deptId != null">#{deptId},</if>
- </trim>
- </insert>
- <update id="updateTPpeCmldefLocker" parameterType="TPpeCmldefLocker">
- update t_ppe_cmldef_locker
- <trim prefix="SET" suffixOverrides=",">
- <if test="ppeType != null">ppe_type = #{ppeType},</if>
- <if test="usePost != null">use_post = #{usePost},</if>
- <if test="isEquip != null">is_equip = #{isEquip},</if>
- <if test="isPollution != null">is_pollution = #{isPollution},</if>
- <if test="putAsRequired != null">put_as_required = #{putAsRequired},</if>
- <if test="isIdentification != null">is_identification = #{isIdentification},</if>
- <if test="mainId != null">main_id = #{mainId},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createrCode != null">creater_code = #{createrCode},</if>
- <if test="createdate != null">createdate = #{createdate},</if>
- <if test="updaterCode != null">updater_code = #{updaterCode},</if>
- <if test="updatedate != null">updatedate = #{updatedate},</if>
- <if test="remarks != null">remarks = #{remarks},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="deleteTPpeCmldefLockerById" parameterType="Long">
- update t_ppe_cmldef_locker set del_flag = 2 where id = #{id}
- </update>
- <update id="deleteTPpeCmldefLockerByIds" parameterType="String">
- update t_ppe_cmldef_locker set del_flag = 2 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- </mapper>
|