<?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="org.springblade.modules.taskinfo.mapper.TaskInfoMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="taskinfoResultMap" type="org.springblade.modules.taskinfo.entity.TaskInfoEntity">
|
<result column="id" property="id"/>
|
<result column="title" property="title"/>
|
<result column="start_time" property="startTime"/>
|
<result column="end_time" property="endTime"/>
|
<result column="content" property="content"/>
|
<result column="to_user_id" property="toUserId"/>
|
<result column="route_range" property="routeRange"/>
|
<result column="state" property="state"/>
|
<result column="source" property="source"/>
|
<result column="create_user" property="createUser"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_user" property="updateUser"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="status" property="status"/>
|
<result column="is_deleted" property="isDeleted"/>
|
</resultMap>
|
|
<select id="getTaskInfoOne" resultMap="taskinfoResultMap">
|
select id,title,start_time,end_time,content,to_user_id,ST_ASTEXT(route_range) as route_range,
|
state,source,create_user,create_time,update_user,update_time,status,is_deleted from ins_taskinfo
|
where id = #{id} and is_deleted = 0
|
</select>
|
|
<select id="selectTaskInfoPage" resultMap="taskinfoResultMap">
|
select id,title,start_time,end_time,content,to_user_id,ST_ASTEXT(route_range) as route_range,state,source,create_user,create_time,update_user,update_time,status,is_deleted from ins_taskinfo where is_deleted = 0
|
<if test="taskinfo.title != null and taskinfo.title != '' ">
|
and title like concat('%',#{taskinfo.title},'%')
|
</if>
|
<if test="taskinfo.state != null and taskinfo.state != '' ">
|
and state = #{taskinfo.state}
|
</if>
|
<if test="taskinfo.toUserId != null and taskinfo.toUserId != '' ">
|
and to_user_id = #{taskinfo.toUserId}
|
</if>
|
<if test="taskinfo.startTime != null ">
|
and start_time >= #{taskinfo.startTime}
|
</if>
|
<if test="taskinfo.endTime != null ">
|
and end_time <= #{taskinfo.endTime}
|
</if>
|
</select>
|
|
<!--自定义新增数据-->
|
<insert id="saveTask">
|
INSERT INTO ins_taskinfo (id, title, start_time, end_time, content,to_user_id,
|
<if test="taskInfo.routeRange!=null and taskInfo.routeRange!=''">
|
route_range,
|
</if>
|
state, source, create_user, create_dept, create_time,
|
update_user, update_time, status, is_deleted, tenant_id)
|
VALUES
|
(#{taskInfo.id},#{taskInfo.title},#{taskInfo.startTime},#{taskInfo.endTime},#{taskInfo.content},#{taskInfo.toUserId},
|
<if test="taskInfo.routeRange!=null and taskInfo.routeRange!=''">
|
ST_GeomFromText(${taskInfo.routeRange}),
|
</if>
|
#{taskInfo.state},#{taskInfo.source},#{taskInfo.createUser},#{taskInfo.createDept},#{taskInfo.createTime},
|
#{taskInfo.updateUser},#{taskInfo.updateTime},#{taskInfo.status},#{taskInfo.isDeleted},#{taskInfo.tenantId})
|
</insert>
|
|
<update id="updateTask">
|
UPDATE ins_taskinfo SET
|
title = #{taskInfo.title},
|
start_time = #{taskInfo.startTime},
|
end_time = #{taskInfo.endTime},
|
content = #{taskInfo.content},
|
to_user_id = #{taskInfo.toUserId},
|
<if test="taskInfo.routeRange!=null and taskInfo.routeRange!=''">
|
route_range = ST_GeomFromText(${taskInfo.routeRange}),
|
</if>
|
state = #{taskInfo.state},
|
source = #{taskInfo.source},
|
tenant_id = #{taskInfo.tenantId},
|
create_user = #{taskInfo.createUser},
|
create_dept = #{taskInfo.createDept},
|
create_time = #{taskInfo.createTime},
|
update_user = #{taskInfo.updateUser},
|
update_time = #{taskInfo.updateTime},
|
status = #{taskInfo.status}
|
WHERE id = #{taskInfo.id} AND is_deleted = 0
|
</update>
|
|
|
</mapper>
|