<?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.buss.mapper.DsTaskMapper">
|
|
<resultMap type="DsTask" id="DsTaskResult">
|
<id property="PKID" column="PKID" />
|
<result property="NAME" column="NAME" />
|
<result property="TYPE" column="TYPE" />
|
<result property="NOTES" column="NOTES" />
|
<result property="delFlag" column="DEL_FLAG" />
|
<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="status" column="STATUS" />
|
</resultMap>
|
|
<sql id="selectDsTaskVo">
|
select PKID, NAME, TYPE, NOTES, DEL_FLAG, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, STATUS from ds_task
|
</sql>
|
|
<select id="selectDsTaskListByParam" parameterType="com.ruoyi.buss.domain.dto.DsTaskQueryParam" resultMap="DsTaskResult">
|
<include refid="selectDsTaskVo"/>
|
<where>
|
<if test="name != null and name != ''"> and NAME like concat('%', #{name}, '%') </if>
|
<if test="type != null and type != ''"> and TYPE = #{type} </if>
|
<if test="notes != null and notes != ''"> and NOTES like concat('%', #{notes}, '%') </if>
|
<if test="stime != null"> and CREATE_TIME >= #{stime} </if>
|
<if test="etime != null"> and CREATE_TIME <= #{etime} </if>
|
<if test="status != null and status != ''"> and STATUS = #{status} </if>
|
<if test="deptId != null and deptId != ''">
|
and PKID in (select DISTINCT TASK_ID from DS_TASK_LIST where DEPT_ID = #{deptId} )
|
</if>
|
</where>
|
</select>
|
|
<select id="selectDsTaskList" parameterType="DsTask" resultMap="DsTaskResult">
|
<include refid="selectDsTaskVo"/>
|
<where>
|
<if test="PKID != null "> and PKID = #{PKID}</if>
|
<if test="NAME != null and NAME != ''"> and NAME like concat('%', #{NAME}, '%')</if>
|
<if test="TYPE != null and TYPE != ''"> and TYPE = #{TYPE}</if>
|
<if test="NOTES != null and NOTES != ''"> and NOTES = #{NOTES}</if>
|
<if test="delFlag != null and delFlag != ''"> and DEL_FLAG = #{delFlag}</if>
|
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
|
<if test="createTime != null "> and CREATE_TIME = #{createTime}</if>
|
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
|
<if test="updateTime != null "> and UPDATE_TIME = #{updateTime}</if>
|
<if test="status != null "> and STATUS = #{status}</if>
|
</where>
|
</select>
|
|
<select id="selectDsTaskByPKID" parameterType="Long" resultMap="DsTaskResult">
|
<include refid="selectDsTaskVo"/>
|
where PKID = #{PKID}
|
</select>
|
|
<select id="selectMaxTaskId" resultType="java.lang.Long">
|
select max(PKID) from DS_TASK
|
</select>
|
|
<insert id="insertDsTask" parameterType="DsTask" useGeneratedKeys="true" keyColumn="PKID" keyProperty="PKID">
|
insert into ds_task
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="NAME != null">NAME,</if>
|
<if test="TYPE != null">TYPE,</if>
|
<if test="NOTES != null">NOTES,</if>
|
<if test="delFlag != null">DEL_FLAG,</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="status != null">STATUS,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="NAME != null">#{NAME},</if>
|
<if test="TYPE != null">#{TYPE},</if>
|
<if test="NOTES != null">#{NOTES},</if>
|
<if test="delFlag != null">#{delFlag},</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="status != null">#{status},</if>
|
</trim>
|
</insert>
|
|
<update id="updateDsTask" parameterType="DsTask">
|
update ds_task
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="NAME != null">NAME = #{NAME},</if>
|
<if test="TYPE != null">TYPE = #{TYPE},</if>
|
<if test="NOTES != null">NOTES = #{NOTES},</if>
|
<if test="delFlag != null">DEL_FLAG = #{delFlag},</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="status != null">STATUS = #{status},</if>
|
</trim>
|
where PKID = #{PKID}
|
</update>
|
|
<delete id="deleteDsTaskByPKID" parameterType="Long">
|
delete from ds_task where PKID = #{PKID}
|
</delete>
|
|
<delete id="deleteDsTaskByPKIDs" parameterType="String">
|
delete from ds_task where PKID in
|
<foreach item="PKID" collection="array" open="(" separator="," close=")">
|
#{PKID}
|
</foreach>
|
</delete>
|
|
</mapper>
|