2023-12-16 21:50:54 +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">
|
|
|
|
|
<mapper namespace="com.bonus.sgzb.material.mapper.TmTaskAgreementMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="com.bonus.sgzb.material.domain.TmTaskAgreement" id="TmTaskAgreementResult">
|
|
|
|
|
<result property="taskId" column="task_id" />
|
|
|
|
|
<result property="agreementId" column="agreement_id" />
|
|
|
|
|
<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="selectTmTaskAgreementVo">
|
|
|
|
|
select task_id, agreement_id, create_by, create_time, update_by, update_time, remark, company_id from tm_task_agreement
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectTmTaskAgreementList" parameterType="com.bonus.sgzb.material.domain.TmTaskAgreement" resultMap="TmTaskAgreementResult">
|
|
|
|
|
<include refid="selectTmTaskAgreementVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="agreementId != null "> and agreement_id = #{agreementId}</if>
|
|
|
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectTmTaskAgreementByTaskId" parameterType="Long" resultMap="TmTaskAgreementResult">
|
|
|
|
|
<include refid="selectTmTaskAgreementVo"/>
|
|
|
|
|
where task_id = #{taskId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertTmTaskAgreement" parameterType="com.bonus.sgzb.material.domain.TmTaskAgreement" useGeneratedKeys="true" keyProperty="taskId">
|
|
|
|
|
insert into tm_task_agreement
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
2024-01-12 17:11:47 +08:00
|
|
|
<if test="task_id != null">task_id,</if>
|
2023-12-16 21:50:54 +08:00
|
|
|
<if test="agreementId != null">agreement_id,</if>
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
2023-12-24 15:11:02 +08:00
|
|
|
create_time,
|
2023-12-16 21:50:54 +08:00
|
|
|
<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=",">
|
2024-01-12 17:11:47 +08:00
|
|
|
<if test="task_id != null">#{taskId},</if>
|
2023-12-16 21:50:54 +08:00
|
|
|
<if test="agreementId != null">#{agreementId},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
2023-12-24 15:11:02 +08:00
|
|
|
now(),
|
2023-12-16 21:50:54 +08:00
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
<update id="updateTmTaskAgreement" parameterType="com.bonus.sgzb.material.domain.TmTaskAgreement">
|
|
|
|
|
update tm_task_agreement
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="agreementId != null">agreement_id = #{agreementId},</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="deleteTmTaskAgreementByTaskId" parameterType="Long">
|
|
|
|
|
delete from tm_task_agreement where task_id = #{taskId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteTmTaskAgreementByTaskIds" parameterType="String">
|
|
|
|
|
delete from tm_task_agreement where task_id in
|
|
|
|
|
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{taskId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|