123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <?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.qw.mapper.QwWorkTaskMapper">
- <resultMap type="QwWorkTask" id="QwWorkTaskResult">
- <result property="id" column="id" />
- <result property="extId" column="ext_id" />
- <result property="qwUserId" column="qw_user_id" />
- <result property="type" column="type" />
- <result property="status" column="status" />
- <result property="remark" column="remark" />
- <result property="score" column="score" />
- <result property="sopId" column="sop_id" />
- <result property="companyId" column="company_id" />
- <result property="companyUserId" column="company_user_id" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="title" column="title" />
- </resultMap>
- <sql id="selectQwWorkTaskVo">
- select id, ext_id, qw_user_id, type,title, status, remark, score, sop_id, company_id, company_user_id, create_time, update_time from qw_work_task
- </sql>
- <select id="selectQwWorkTaskList" parameterType="QwWorkTask" resultMap="QwWorkTaskResult">
- <include refid="selectQwWorkTaskVo"/>
- <where>
- <if test="extId != null "> and ext_id = #{extId}</if>
- <if test="qwUserId != null "> and qw_user_id = #{qwUserId}</if>
- <if test="type != null "> and type = #{type}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="score != null "> and score = #{score}</if>
- <if test="sopId != null and sopId != ''"> and sop_id = #{sopId}</if>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
- </where>
- </select>
- <select id="selectQwWorkTaskById" parameterType="Long" resultMap="QwWorkTaskResult">
- <include refid="selectQwWorkTaskVo"/>
- where id = #{id}
- </select>
- <select id="selectQwWorkTaskListVONew" resultType="com.fs.qw.vo.QwWorkTaskListVO">
- select t.* from qw_work_task t
- <where>
- DATE(t.create_time) = CURDATE()
- <if test="extId != null "> and t.ext_id = #{extId}</if>
- <if test="qwUserId != null "> and t.qw_user_id = #{qwUserId}</if>
- <if test="type != null "> and t.type = #{type}</if>
- <if test="status != null "> and t.status = #{status}</if>
- <if test="score != null "> and t.score = #{score}</if>
- <if test="sopId != null and sopId != ''"> and t.sop_id = #{sopId}</if>
- <if test="companyId != null "> and t.company_id = #{companyId}</if>
- <if test="companyUserId != null "> and t.company_user_id = #{companyUserId}</if>
- </where>
- order by t.score desc,t.id desc
- </select>
- <insert id="insertQwWorkTask" parameterType="QwWorkTask" useGeneratedKeys="true" keyProperty="id">
- insert into qw_work_task
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="extId != null">ext_id,</if>
- <if test="qwUserId != null">qw_user_id,</if>
- <if test="type != null">type,</if>
- <if test="status != null">status,</if>
- <if test="remark != null">remark,</if>
- <if test="score != null">score,</if>
- <if test="sopId != null">sop_id,</if>
- <if test="companyId != null">company_id,</if>
- <if test="companyUserId != null">company_user_id,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="title != null">title,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="extId != null">#{extId},</if>
- <if test="qwUserId != null">#{qwUserId},</if>
- <if test="type != null">#{type},</if>
- <if test="status != null">#{status},</if>
- <if test="remark != null">#{remark},</if>
- <if test="score != null">#{score},</if>
- <if test="sopId != null">#{sopId},</if>
- <if test="companyId != null">#{companyId},</if>
- <if test="companyUserId != null">#{companyUserId},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="title != null">#{title},</if>
- </trim>
- </insert>
- <update id="updateQwWorkTask" parameterType="QwWorkTask">
- update qw_work_task
- <trim prefix="SET" suffixOverrides=",">
- <if test="extId != null">ext_id = #{extId},</if>
- <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
- <if test="type != null">type = #{type},</if>
- <if test="status != null">status = #{status},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="score != null">score = #{score},</if>
- <if test="sopId != null">sop_id = #{sopId},</if>
- <if test="companyId != null">company_id = #{companyId},</if>
- <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="title != null">title = #{title},</if>
- </trim>
- where id = #{id}
- </update>
- <insert id="insertQwWorkTaskBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO qw_work_task (
- ext_id,
- qw_user_id,
- status,
- type,
- title,
- remark,
- score,
- sop_id,
- company_id,
- company_user_id,
- create_time,
- update_time
- )
- VALUES
- <foreach collection="qwWorkTasks" item="log" separator=",">
- (
- #{log.extId},
- #{log.qwUserId},
- #{log.status},
- #{log.type},
- #{log.title},
- #{log.remark},
- #{log.score},
- #{log.sopId},
- #{log.companyId},
- #{log.companyUserId},
- #{log.createTime},
- #{log.updateTime}
- )
- </foreach>
- </insert>
- <delete id="deleteQwWorkTaskById" parameterType="Long">
- delete from qw_work_task where id = #{id}
- </delete>
- <delete id="deleteQwWorkTaskByIds" parameterType="String">
- delete from qw_work_task where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|