| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <?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.fs.sop.mapper.QwSopTempMapper">
- <resultMap type="QwSopTemp" id="QwSopTempResult">
- <result property="id" column="id" />
- <result property="name" column="name" />
- <result property="setting" column="setting" />
- <result property="status" column="status" />
- <result property="sort" column="sort" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="companyId" column="company_id" />
- <result property="gap" column="gap" />
- <result property="sendType" column="send_type" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectQwSopTempVo">
- select * from qw_sop_temp
- </sql>
- <select id="selectQwSopTempList" resultType="QwSopTemp" resultMap="QwSopTempResult">
- <include refid="selectQwSopTempVo"/>
- <where>
- <if test="id != null "> and id = #{id}</if>
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
- <if test="setting != null and setting != ''"> and setting = #{setting}</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="sort != null "> and sort = #{sort}</if>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="sendType != null "> and send_type = #{sendType}</if>
- </where>
- </select>
- <select id="selectQwSopTempListNew" resultType="QwSopTemp" resultMap="QwSopTempResult">
- select * from qw_sop_temp
- <where>
- <if test="id != null "> and id = #{id}</if>
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="sort != null "> and sort = #{sort}</if>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="sendType != null "> and send_type = #{sendType}</if>
- <if test="createBy != null "> and create_by = #{createBy}</if>
- <if test="cuDeptIdList != null and !cuDeptIdList.isEmpty()">
- AND create_by_dept IN
- <foreach collection='cuDeptIdList' item='item' open='(' separator=',' close=')'>
- #{item}
- </foreach>
- </if>
- </where>
- order by sort,create_time desc
- </select>
- <select id="selectQwSopTempById" parameterType="String" resultMap="QwSopTempResult">
- <include refid="selectQwSopTempVo"/>
- where id = #{id}
- </select>
- <select id="listTemp" resultType="com.fs.sop.domain.QwSopTemp">
- select * from qw_sop_temp_temp
- </select>
- <select id="selectListByIds" resultType="com.fs.sop.domain.QwSopTemp">
- select * from qw_sop_temp where id in
- <foreach item="id" collection="ids" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
- <insert id="insertQwSopTemp" parameterType="QwSopTemp" useGeneratedKeys="true" keyProperty="id">
- insert into qw_sop_temp
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="data.id != null">id,</if>
- <if test="data.name != null">name,</if>
- <if test="data.setting != null">setting,</if>
- <if test="data.status != null">status,</if>
- <if test="data.sort != null">sort,</if>
- <if test="data.createTime != null">create_time,</if>
- <if test="data.createBy != null">create_by,</if>
- <if test="data.companyId != null">company_id,</if>
- <if test="data.gap != null">gap,</if>
- <if test="data.sendType != null">send_type,</if>
- <if test="data.updateTime != null">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="data.id != null">#{data.id},</if>
- <if test="data.name != null">#{data.name},</if>
- <if test="data.setting != null">#{data.setting},</if>
- <if test="data.status != null">#{data.status},</if>
- <if test="data.sort != null">#{data.sort},</if>
- <if test="data.createTime != null">#{data.createTime},</if>
- <if test="data.createBy != null">#{data.createBy},</if>
- <if test="data.companyId != null">#{data.companyId},</if>
- <if test="data.gap != null">#{data.gap},</if>
- <if test="data.sendType != null">#{data.sendType},</if>
- <if test="data.updateTime != null">#{data.updateTime},</if>
- </trim>
- </insert>
- <update id="updateQwSopTemp" parameterType="QwSopTemp" useGeneratedKeys="false" keyProperty="id" >
- update qw_sop_temp
- <trim prefix="SET" suffixOverrides=",">
- <if test="data.name != null">name = #{data.name},</if>
- <if test="data.setting != null">setting = #{data.setting},</if>
- <if test="data.status != null">status = #{data.status},</if>
- <if test="data.sort != null">sort = #{data.sort},</if>
- <if test="data.createTime != null">create_time = #{data.createTime},</if>
- <if test="data.createBy != null">create_by = #{data.createBy},</if>
- <if test="data.companyId != null">company_id = #{data.companyId},</if>
- <if test="data.gap != null">gap = #{data.gap},</if>
- <if test="data.sendType != null">send_type = #{data.sendType},</if>
- <if test="data.updateTime != null">update_time = #{data.updateTime},</if>
- </trim>
- where id = #{data.id}
- </update>
- <delete id="deleteQwSopTempById" parameterType="String">
- delete from qw_sop_temp where id = #{id}
- </delete>
- <delete id="deleteQwSopTempByIds" parameterType="String">
- delete from qw_sop_temp where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <!-- <update id="updateQwSopTempByIds" parameterType="String">-->
- <!-- ALTER TABLE qw_sop_temp-->
- <!-- UPDATE status = 0-->
- <!-- WHERE id IN-->
- <!-- <foreach item="id" collection="ids" open="(" separator="," close=")">-->
- <!-- CAST(#{id} AS UUID)-->
- <!-- </foreach>-->
- <!-- </update>-->
- <update id="updateQwSopTempByIds" parameterType="String">
- UPDATE qw_sop_temp set status = 2
- WHERE id IN
- <foreach item="id" collection="ids" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- </mapper>
|