|
|
|
<?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.tc.mapper.AssetTaskMapper">
|
|
|
|
|
|
|
|
<resultMap type="com.ruoyi.tc.entity.AssetTask" id="AssetTaskMap">
|
|
|
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
|
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
|
|
|
|
<result property="taskTime" column="task_time" jdbcType="TIMESTAMP"/>
|
|
|
|
<result property="taskDeadline" column="task_deadline" jdbcType="VARCHAR"/>
|
|
|
|
<result property="taskFinishTime" column="task_finish_time" jdbcType="TIMESTAMP"/>
|
|
|
|
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
|
|
|
|
<result property="dwmc" column="dwmc" jdbcType="VARCHAR"/>
|
|
|
|
<result property="createId" column="create_id" jdbcType="INTEGER"/>
|
|
|
|
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
|
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
|
<result property="updateId" column="update_id" jdbcType="INTEGER"/>
|
|
|
|
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
|
|
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
|
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
|
|
|
<result property="deptId" column="dept_id" jdbcType="INTEGER"/>
|
|
|
|
<result property="version" column="version" jdbcType="VARCHAR"/>
|
|
|
|
<result property="reamark" column="reamark" jdbcType="VARCHAR"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!--查询单个-->
|
|
|
|
<select id="queryById" resultType="com.ruoyi.tc.entity.response.AssetTaskResponse">
|
|
|
|
select a.id,
|
|
|
|
a.task_name,
|
|
|
|
a.task_time,
|
|
|
|
a.task_deadline,
|
|
|
|
a.task_finish_time,
|
|
|
|
a.task_status,
|
|
|
|
a.dwmc,
|
|
|
|
a.create_id,
|
|
|
|
a.create_by,
|
|
|
|
a.create_time,
|
|
|
|
a.update_id,
|
|
|
|
a.update_by,
|
|
|
|
a.update_time,
|
|
|
|
a.user_id,
|
|
|
|
a.dept_id,
|
|
|
|
a.version,
|
|
|
|
a.reamark
|
|
|
|
|
|
|
|
from asset_task a
|
|
|
|
|
|
|
|
where a.id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!--查询指定行数据-->
|
|
|
|
<select id="queryAllByLimit" resultMap="AssetTaskMap">
|
|
|
|
select
|
|
|
|
id,task_name,task_time,task_deadline,task_finish_time,task_status,dwmc,create_id,create_by,create_time,update_id,update_by,update_time,user_id,dept_id,version,reamark
|
|
|
|
from asset_task
|
|
|
|
<where>
|
|
|
|
<if test="id != null">
|
|
|
|
and id = #{id}
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskName != null and taskName != ''">
|
|
|
|
and task_name = #{taskName}
|
|
|
|
</if>
|
|
|
|
<if test="taskTime != null">
|
|
|
|
and task_time = #{taskTime}
|
|
|
|
</if>
|
|
|
|
<if test="taskDeadline != null and taskDeadline != ''">
|
|
|
|
and task_deadline = #{taskDeadline}
|
|
|
|
</if>
|
|
|
|
<if test="taskFinishTime != null">
|
|
|
|
and task_finish_time = #{taskFinishTime}
|
|
|
|
</if>
|
|
|
|
<if test="taskStatus != null and taskStatus != ''">
|
|
|
|
and task_status = #{taskStatus}
|
|
|
|
</if>
|
|
|
|
<if test="dwmc != null">
|
|
|
|
and dwmc = #{dwmc}
|
|
|
|
</if>
|
|
|
|
<if test="createId != null">
|
|
|
|
and create_id = #{createId}
|
|
|
|
</if>
|
|
|
|
<if test="createBy != null and createBy != ''">
|
|
|
|
and create_by = #{createBy}
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
and create_time = #{createTime}
|
|
|
|
</if>
|
|
|
|
<if test="updateId != null">
|
|
|
|
and update_id = #{updateId}
|
|
|
|
</if>
|
|
|
|
<if test="updateBy != null and updateBy != ''">
|
|
|
|
and update_by = #{updateBy}
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
and update_time = #{updateTime}
|
|
|
|
</if>
|
|
|
|
<if test="userId != null">
|
|
|
|
and user_id = #{userId}
|
|
|
|
</if>
|
|
|
|
<if test="deptId != null">
|
|
|
|
and dept_id = #{deptId}
|
|
|
|
</if>
|
|
|
|
<if test="version != null and version != ''">
|
|
|
|
and version = #{version}
|
|
|
|
</if>
|
|
|
|
<if test="reamark != null and reamark != ''">
|
|
|
|
and reamark = #{reamark}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
limit #{pageable.offset}, #{pageable.pageSize}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!--统计总行数-->
|
|
|
|
<select id="count" resultType="java.lang.Long">
|
|
|
|
select count(1)
|
|
|
|
from asset_task
|
|
|
|
<where>
|
|
|
|
<if test="id != null">
|
|
|
|
and id = #{id}
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="taskName != null and taskName != ''">
|
|
|
|
and task_name = #{taskName}
|
|
|
|
</if>
|
|
|
|
<if test="taskTime != null">
|
|
|
|
and task_time = #{taskTime}
|
|
|
|
</if>
|
|
|
|
<if test="taskDeadline != null and taskDeadline != ''">
|
|
|
|
and task_deadline = #{taskDeadline}
|
|
|
|
</if>
|
|
|
|
<if test="taskFinishTime != null">
|
|
|
|
and task_finish_time = #{taskFinishTime}
|
|
|
|
</if>
|
|
|
|
<if test="taskStatus != null and taskStatus != ''">
|
|
|
|
and task_status = #{taskStatus}
|
|
|
|
</if>
|
|
|
|
<if test="dwmc != null">
|
|
|
|
and dwmc = #{dwmc}
|
|
|
|
</if>
|
|
|
|
<if test="createId != null">
|
|
|
|
and create_id = #{createId}
|
|
|
|
</if>
|
|
|
|
<if test="createBy != null and createBy != ''">
|
|
|
|
and create_by = #{createBy}
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
and create_time = #{createTime}
|
|
|
|
</if>
|
|
|
|
<if test="updateId != null">
|
|
|
|
and update_id = #{updateId}
|
|
|
|
</if>
|
|
|
|
<if test="updateBy != null and updateBy != ''">
|
|
|
|
and update_by = #{updateBy}
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
and update_time = #{updateTime}
|
|
|
|
</if>
|
|
|
|
<if test="userId != null">
|
|
|
|
and user_id = #{userId}
|
|
|
|
</if>
|
|
|
|
<if test="deptId != null">
|
|
|
|
and dept_id = #{deptId}
|
|
|
|
</if>
|
|
|
|
<if test="version != null and version != ''">
|
|
|
|
and version = #{version}
|
|
|
|
</if>
|
|
|
|
<if test="reamark != null and reamark != ''">
|
|
|
|
and reamark = #{reamark}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="queryByPage" resultType="com.ruoyi.tc.entity.AssetTask">
|
|
|
|
select
|
|
|
|
id,task_name,task_time,task_deadline,task_finish_time,task_status,dwmc,create_id,create_by,create_time,update_id,update_by,update_time,user_id,dept_id,version,reamark
|
|
|
|
from asset_task
|
|
|
|
<where>
|
|
|
|
<if test="req.taskName != null and req.taskName != ''">
|
|
|
|
and task_name = #{req.taskName}
|
|
|
|
</if>
|
|
|
|
<if test="req.begainTime != null">
|
|
|
|
and task_finish_time >= #{req.begainTime}
|
|
|
|
</if>
|
|
|
|
<if test="req.endTime != null">
|
|
|
|
and task_finish_time <= #{req.endTime}
|
|
|
|
</if>
|
|
|
|
<if test="req.taskStatus != null and req.taskStatus != ''">
|
|
|
|
and task_status = #{req.taskStatus}
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="findByDwmcAssetCurrent" resultType="com.ruoyi.tc.entity.po.AssetCurrentCpPo">
|
|
|
|
select * from asset_current
|
|
|
|
<where>
|
|
|
|
del_flag = '0' and isbf = '0'
|
|
|
|
<if test="dwmc!=null and dwmc!='' ">
|
|
|
|
and dwmc like concat('%',#{dwmc},'%')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="zcHc" resultType="com.ruoyi.tc.entity.response.AssestTaskXqresponse">
|
|
|
|
select b.xtlx,
|
|
|
|
b.xtmc,
|
|
|
|
b.dwmc as zcdwmc,
|
|
|
|
b.status,
|
|
|
|
b.id ,
|
|
|
|
b.task_id
|
|
|
|
from asset_task a
|
|
|
|
LEFT JOIN
|
|
|
|
asset_current_cp b ON FIND_IN_SET(b.dwmc, a.dwmc)
|
|
|
|
<where>
|
|
|
|
<if test="req.dwmc!=null and req.dwmc!='' ">
|
|
|
|
and b.dwmc like concat('%',#{req.dwmc},'%')
|
|
|
|
</if>
|
|
|
|
<if test="req.taskId !=null ">
|
|
|
|
and a.id = #{req.taskId}
|
|
|
|
</if>
|
|
|
|
<if test="req.status!=null ">
|
|
|
|
and b.status =#{req.status}
|
|
|
|
</if>
|
|
|
|
<if test="req.xtlx!=null and req.xtlx!='' ">
|
|
|
|
and b.xtlx = #{req.xtlx}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="findBytaskIdandAssestId" resultType="com.ruoyi.tc.entity.po.AssetCurrentCpPo">
|
|
|
|
select *
|
|
|
|
from asset_current_cp
|
|
|
|
where task_id = #{taskId}
|
|
|
|
and id = #{assetId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!--新增所有列-->
|
|
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
|
insert into asset_task(task_name, task_time, task_deadline, task_finish_time, task_status, dwmc,
|
|
|
|
create_id, create_by, create_time, update_id, update_by, update_time, user_id, dept_id,
|
|
|
|
version, reamark)
|
|
|
|
values (#{taskName}, #{taskTime}, #{taskDeadline}, #{taskFinishTime}, #{taskStatus}, #{dwmc},
|
|
|
|
#{createId}, #{createBy}, #{createTime}, #{updateId}, #{updateBy}, #{updateTime}, #{userId}, #{deptId},
|
|
|
|
#{version}, #{reamark})
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
|
insert into
|
|
|
|
asset_task(task_name,task_time,task_deadline,task_finish_time,task_status,dwmc,create_id,create_by,create_time,update_id,update_by,update_time,user_id,dept_id,version,reamark)
|
|
|
|
values
|
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
|
(#{entity.taskName},#{entity.taskTime},#{entity.taskDeadline},#{entity.taskFinishTime},#{entity.taskStatus},#{entity.dwmc},#{entity.createId},#{entity.createBy},#{entity.createTime},#{entity.updateId},#{entity.updateBy},#{entity.updateTime},#{entity.userId},#{entity.deptId},#{entity.version},#{entity.reamark})
|
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
|
insert into
|
|
|
|
asset_task(task_name,task_time,task_deadline,task_finish_time,task_status,dwmc,create_id,create_by,create_time,update_id,update_by,update_time,user_id,dept_id,version,reamark)
|
|
|
|
values
|
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
|
(#{entity.taskName},#{entity.taskTime},#{entity.taskDeadline}#{entity.taskFinishTime}#{entity.taskStatus}#{entity.dwmc}#{entity.createId}#{entity.createBy}#{entity.createTime}#{entity.updateId}#{entity.updateBy}#{entity.updateTime}#{entity.userId}#{entity.deptId}#{entity.version}#{entity.reamark})
|
|
|
|
</foreach>
|
|
|
|
on duplicate key update
|
|
|
|
task_name = values(task_name)task_time = values(task_time)task_deadline =
|
|
|
|
values(task_deadline)task_finish_time = values(task_finish_time)task_status = values(task_status)dwmc =
|
|
|
|
values(dwmc)create_id = values(create_id)create_by = values(create_by)create_time =
|
|
|
|
values(create_time)update_id = values(update_id)update_by = values(update_by)update_time =
|
|
|
|
values(update_time)user_id = values(user_id)dept_id = values(dept_id)version = values(version)reamark =
|
|
|
|
values(reamark)
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<!--通过主键修改数据-->
|
|
|
|
<update id="update">
|
|
|
|
update asset_task
|
|
|
|
<set>
|
|
|
|
|
|
|
|
<if test="taskName != null and taskName != ''">
|
|
|
|
task_name = #{taskName},
|
|
|
|
</if>
|
|
|
|
<if test="taskTime != null">
|
|
|
|
task_time = #{taskTime},
|
|
|
|
</if>
|
|
|
|
<if test="taskDeadline != null and taskDeadline != ''">
|
|
|
|
task_deadline = #{taskDeadline},
|
|
|
|
</if>
|
|
|
|
<if test="taskFinishTime != null">
|
|
|
|
task_finish_time = #{taskFinishTime},
|
|
|
|
</if>
|
|
|
|
<if test="taskStatus != null and taskStatus != ''">
|
|
|
|
task_status = #{taskStatus},
|
|
|
|
</if>
|
|
|
|
<if test="dwmc != null">
|
|
|
|
dwmc = #{dwmc},
|
|
|
|
</if>
|
|
|
|
<if test="createId != null">
|
|
|
|
create_id = #{createId},
|
|
|
|
</if>
|
|
|
|
<if test="createBy != null and createBy != ''">
|
|
|
|
create_by = #{createBy},
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
create_time = #{createTime},
|
|
|
|
</if>
|
|
|
|
<if test="updateId != null">
|
|
|
|
update_id = #{updateId},
|
|
|
|
</if>
|
|
|
|
<if test="updateBy != null and updateBy != ''">
|
|
|
|
update_by = #{updateBy},
|
|
|
|
</if>
|
|
|
|
<if test="updateTime != null">
|
|
|
|
update_time = #{updateTime},
|
|
|
|
</if>
|
|
|
|
<if test="userId != null">
|
|
|
|
user_id = #{userId},
|
|
|
|
</if>
|
|
|
|
<if test="deptId != null">
|
|
|
|
dept_id = #{deptId},
|
|
|
|
</if>
|
|
|
|
<if test="version != null and version != ''">
|
|
|
|
version = #{version},
|
|
|
|
</if>
|
|
|
|
<if test="reamark != null and reamark != ''">
|
|
|
|
reamark = #{reamark},
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
<update id="sh" parameterType="com.ruoyi.tc.entity.request.AssetCurrentShRequest">
|
|
|
|
update asset_current_cp
|
|
|
|
<set>
|
|
|
|
<if test="req.status != null ">
|
|
|
|
status = #{req.status},
|
|
|
|
</if>
|
|
|
|
</set>
|
|
|
|
where id = #{req.assetId} and task_id = #{req.taskId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!--通过主键删除-->
|
|
|
|
<delete id="deleteById">
|
|
|
|
delete
|
|
|
|
from asset_task
|
|
|
|
where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|