2023-12-13 18:08:38 +08:00
|
|
|
<?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">
|
2023-12-14 09:37:38 +08:00
|
|
|
<mapper namespace="com.bonus.sgzb.material.mapper.TaskMapper">
|
2024-01-16 20:06:21 +08:00
|
|
|
<resultMap type="com.bonus.sgzb.material.domain.TmTask" id="TmTaskResult">
|
2023-12-13 18:08:38 +08:00
|
|
|
<result property="taskId" column="task_id" />
|
|
|
|
|
<result property="taskType" column="task_type" />
|
|
|
|
|
<result property="taskStatus" column="task_status" />
|
|
|
|
|
<result property="code" column="code" />
|
|
|
|
|
<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="remark" column="remark" />
|
|
|
|
|
<result property="companyId" column="company_id" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectTmTaskVo">
|
|
|
|
|
select task_id, task_type, task_status, code, create_by, create_time, update_by, update_time, remark, company_id from tm_task
|
|
|
|
|
</sql>
|
|
|
|
|
|
2024-01-16 20:06:21 +08:00
|
|
|
<select id="selectTmTaskList" parameterType="com.bonus.sgzb.material.domain.TmTask" resultMap="TmTaskResult">
|
2023-12-13 18:08:38 +08:00
|
|
|
<include refid="selectTmTaskVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="taskType != null "> and task_type = #{taskType}</if>
|
|
|
|
|
<if test="taskStatus != null "> and task_status = #{taskStatus}</if>
|
|
|
|
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
|
|
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectTmTaskByTaskId" parameterType="Long" resultMap="TmTaskResult">
|
|
|
|
|
<include refid="selectTmTaskVo"/>
|
|
|
|
|
where task_id = #{taskId}
|
|
|
|
|
</select>
|
|
|
|
|
|
2024-01-16 20:06:21 +08:00
|
|
|
<insert id="insertTmTask" parameterType="com.bonus.sgzb.material.domain.TmTask" useGeneratedKeys="true" keyProperty="taskId">
|
2023-12-13 18:08:38 +08:00
|
|
|
insert into tm_task
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="taskType != null">task_type,</if>
|
|
|
|
|
<if test="taskStatus != null">task_status,</if>
|
|
|
|
|
<if test="code != null">code,</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="remark != null">remark,</if>
|
|
|
|
|
<if test="companyId != null">company_id,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="taskType != null">#{taskType},</if>
|
|
|
|
|
<if test="taskStatus != null">#{taskStatus},</if>
|
|
|
|
|
<if test="code != null">#{code},</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="remark != null">#{remark},</if>
|
|
|
|
|
<if test="companyId != null">#{companyId},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
2024-03-07 16:30:39 +08:00
|
|
|
<insert id="insertSelective" keyColumn="task_id" keyProperty="id" parameterType="com.bonus.sgzb.material.domain.TmTask" useGeneratedKeys="true">
|
|
|
|
|
insert into tm_task
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="taskType != null">
|
|
|
|
|
task_type,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="taskStatus != null">
|
|
|
|
|
task_status,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="code != null and code != ''">
|
|
|
|
|
code,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">
|
|
|
|
|
create_by,
|
|
|
|
|
</if>
|
|
|
|
|
create_time,
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">
|
|
|
|
|
update_by,
|
|
|
|
|
</if>
|
|
|
|
|
update_time,
|
|
|
|
|
<if test="remark != null and remark != ''">
|
|
|
|
|
remark,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="companyId != null">
|
|
|
|
|
company_id,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="taskType != null">
|
|
|
|
|
#{taskType,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="taskStatus != null">
|
|
|
|
|
#{taskStatus,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="code != null and code != ''">
|
|
|
|
|
#{code,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">
|
|
|
|
|
#{createBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
now(),
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">
|
|
|
|
|
#{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
now(),
|
|
|
|
|
<if test="remark != null and remark != ''">
|
|
|
|
|
#{remark,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="companyId != null">
|
|
|
|
|
#{companyId,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertAgreement">
|
|
|
|
|
INSERT INTO tm_task_agreement ( `task_id`, `agreement_id`, `create_by`, `create_time`, `company_id` )
|
|
|
|
|
VALUES(#{id},#{agreementId},#{createBy},NOW(),#{companyId})
|
|
|
|
|
</insert>
|
2024-03-13 10:56:43 +08:00
|
|
|
<insert id="insertTmTaskByBackInfo" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.material.domain.BackApplyInfo" useGeneratedKeys="true">
|
|
|
|
|
insert into tm_task (
|
|
|
|
|
<if test="taskType != null">task_type, </if>
|
|
|
|
|
<if test="taskStatus != null">task_status, </if>
|
|
|
|
|
<if test="code != null and code != ''">code, </if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">create_by, </if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by, </if>
|
|
|
|
|
<if test="updateTime != null">update_time, </if>
|
|
|
|
|
<if test="remark != null and remark != ''">remark, </if>
|
|
|
|
|
<if test="companyId != null">company_id, </if>
|
|
|
|
|
create_time
|
|
|
|
|
) values (
|
|
|
|
|
<if test="taskType != null">#{taskType}, </if>
|
|
|
|
|
<if test="taskStatus != null">#{taskStatus}, </if>
|
|
|
|
|
<if test="code != null and code != ''">#{code}, </if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">#{createBy}, </if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy}, </if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime}, </if>
|
|
|
|
|
<if test="remark != null and remark != ''">#{remark}, </if>
|
|
|
|
|
<if test="companyId != null">#{companyId}, </if>
|
|
|
|
|
NOW()
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertAgreementByBackInfo">
|
|
|
|
|
insert into tm_task_agreement
|
|
|
|
|
(
|
|
|
|
|
<if test="taskId != null">
|
|
|
|
|
task_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="agreementId != null">
|
|
|
|
|
agreement_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">
|
|
|
|
|
create_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">
|
|
|
|
|
update_by,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
update_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="remark != null and remark != ''">
|
|
|
|
|
remark,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="companyId != null">
|
|
|
|
|
company_id,
|
|
|
|
|
</if>
|
|
|
|
|
create_time
|
|
|
|
|
) values (
|
|
|
|
|
<if test="taskId != null">
|
|
|
|
|
#{taskId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="agreementId != null">
|
|
|
|
|
#{agreementId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">
|
|
|
|
|
#{createBy},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">
|
|
|
|
|
#{updateBy},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
#{updateTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="remark != null and remark != ''">
|
|
|
|
|
#{remark},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="companyId != null">
|
|
|
|
|
#{companyId},
|
|
|
|
|
</if>
|
|
|
|
|
NOW()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
</insert>
|
2023-12-13 18:08:38 +08:00
|
|
|
|
2024-01-16 20:06:21 +08:00
|
|
|
<update id="updateTmTask" parameterType="com.bonus.sgzb.material.domain.TmTask">
|
2023-12-13 18:08:38 +08:00
|
|
|
update tm_task
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="taskType != null">task_type = #{taskType},</if>
|
|
|
|
|
<if test="taskStatus != null">task_status = #{taskStatus},</if>
|
|
|
|
|
<if test="code != null">code = #{code},</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="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="companyId != null">company_id = #{companyId},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where task_id = #{taskId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteTmTaskByTaskId" parameterType="Long">
|
|
|
|
|
delete from tm_task where task_id = #{taskId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteTmTaskByTaskIds" parameterType="String">
|
|
|
|
|
delete from tm_task where task_id in
|
|
|
|
|
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{taskId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
2023-12-15 09:16:47 +08:00
|
|
|
|
|
|
|
|
<select id="selectTaskNumByMonth" resultType="java.lang.Integer">
|
2023-12-17 19:43:10 +08:00
|
|
|
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType}
|
2023-12-15 09:16:47 +08:00
|
|
|
</select>
|
2023-12-13 18:08:38 +08:00
|
|
|
</mapper>
|