2024-09-27 15:48:39 +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.material.task.mapper.TmTaskAgreementMapper">
|
|
|
|
|
<resultMap type="com.bonus.material.task.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.material.task.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.material.task.domain.TmTaskAgreement" useGeneratedKeys="true" keyProperty="taskId">
|
2024-11-19 18:20:07 +08:00
|
|
|
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="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="remark != null and remark != ''">
|
|
|
|
|
#{remark},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="companyId != null">
|
|
|
|
|
#{companyId},
|
|
|
|
|
</if>
|
|
|
|
|
NOW()
|
|
|
|
|
)
|
2024-09-27 15:48:39 +08:00
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateTmTaskAgreement" parameterType="com.bonus.material.task.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>
|
2024-11-19 10:33:56 +08:00
|
|
|
|
|
|
|
|
<select id="getAgreementId" resultType="java.lang.String">
|
|
|
|
|
select agreement_id
|
|
|
|
|
from tm_task_agreement
|
|
|
|
|
where task_id = #{taskId}
|
|
|
|
|
</select>
|
2024-12-17 16:58:29 +08:00
|
|
|
|
|
|
|
|
<select id="selectAgreementIdByTaskId" resultType="java.lang.Long">
|
2024-12-26 17:10:21 +08:00
|
|
|
select agreement_id from tm_task_agreement where task_id = #{taskId}
|
2024-12-17 16:58:29 +08:00
|
|
|
</select>
|
2025-03-06 14:37:32 +08:00
|
|
|
|
|
|
|
|
<select id="selectAgreementId" resultType="java.lang.String">
|
2025-03-08 15:59:33 +08:00
|
|
|
SELECT DISTINCT bai.agreement_id
|
2025-03-06 14:37:32 +08:00
|
|
|
FROM bm_agreement_info bai
|
|
|
|
|
LEFT JOIN lease_publish_details lpd ON bai.unit_id = lpd.unit_id
|
|
|
|
|
AND bai.project_id = lpd.project_id
|
|
|
|
|
WHERE lpd.publish_task = #{publishTask}
|
|
|
|
|
</select>
|
2024-09-27 15:48:39 +08:00
|
|
|
</mapper>
|