145 lines
8.4 KiB
XML
145 lines
8.4 KiB
XML
|
|
<?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.basic.mapper.BmAgreementInfoMapper">
|
||
|
|
<resultMap type="com.bonus.material.basic.domain.BmAgreementInfo" id="BmAgreementInfoResult">
|
||
|
|
<result property="agreementId" column="agreement_id" />
|
||
|
|
<result property="agreementCode" column="agreement_code" />
|
||
|
|
<result property="signTime" column="sign_time" />
|
||
|
|
<result property="unitId" column="unit_id" />
|
||
|
|
<result property="projectId" column="project_id" />
|
||
|
|
<result property="createBy" column="create_by" />
|
||
|
|
<result property="leaseDay" column="lease_day" />
|
||
|
|
<result property="planStartTime" column="plan_start_time" />
|
||
|
|
<result property="contractCode" column="contract_code" />
|
||
|
|
<result property="authPerson" column="auth_person" />
|
||
|
|
<result property="phone" column="phone" />
|
||
|
|
<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" />
|
||
|
|
<result property="fileName" column="file_name" />
|
||
|
|
<result property="fileUrl" column="file_url" />
|
||
|
|
<result property="status" column="status" />
|
||
|
|
<result property="protocol" column="protocol" />
|
||
|
|
<result property="isSlt" column="is_slt" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectBmAgreementInfoVo">
|
||
|
|
select agreement_id, agreement_code, sign_time, unit_id, project_id, create_by, lease_day, plan_start_time, contract_code, auth_person, phone, create_time, update_by, update_time, remark, company_id, file_name, file_url, status, protocol, is_slt from bm_agreement_info
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectBmAgreementInfoList" parameterType="com.bonus.material.basic.domain.BmAgreementInfo" resultMap="BmAgreementInfoResult">
|
||
|
|
<include refid="selectBmAgreementInfoVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="agreementCode != null and agreementCode != ''"> and agreement_code = #{agreementCode}</if>
|
||
|
|
<if test="signTime != null "> and sign_time = #{signTime}</if>
|
||
|
|
<if test="unitId != null "> and unit_id = #{unitId}</if>
|
||
|
|
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||
|
|
<if test="leaseDay != null "> and lease_day = #{leaseDay}</if>
|
||
|
|
<if test="planStartTime != null "> and plan_start_time = #{planStartTime}</if>
|
||
|
|
<if test="contractCode != null and contractCode != ''"> and contract_code = #{contractCode}</if>
|
||
|
|
<if test="authPerson != null and authPerson != ''"> and auth_person = #{authPerson}</if>
|
||
|
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
||
|
|
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||
|
|
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||
|
|
<if test="protocol != null and protocol != ''"> and protocol = #{protocol}</if>
|
||
|
|
<if test="isSlt != null "> and is_slt = #{isSlt}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectBmAgreementInfoByAgreementId" parameterType="Long" resultMap="BmAgreementInfoResult">
|
||
|
|
<include refid="selectBmAgreementInfoVo"/>
|
||
|
|
where agreement_id = #{agreementId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertBmAgreementInfo" parameterType="com.bonus.material.basic.domain.BmAgreementInfo" useGeneratedKeys="true" keyProperty="agreementId">
|
||
|
|
insert into bm_agreement_info
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="agreementCode != null">agreement_code,</if>
|
||
|
|
<if test="signTime != null">sign_time,</if>
|
||
|
|
<if test="unitId != null">unit_id,</if>
|
||
|
|
<if test="projectId != null">project_id,</if>
|
||
|
|
<if test="createBy != null">create_by,</if>
|
||
|
|
<if test="leaseDay != null">lease_day,</if>
|
||
|
|
<if test="planStartTime != null">plan_start_time,</if>
|
||
|
|
<if test="contractCode != null">contract_code,</if>
|
||
|
|
<if test="authPerson != null">auth_person,</if>
|
||
|
|
<if test="phone != null">phone,</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>
|
||
|
|
<if test="fileName != null">file_name,</if>
|
||
|
|
<if test="fileUrl != null">file_url,</if>
|
||
|
|
<if test="status != null">status,</if>
|
||
|
|
<if test="protocol != null">protocol,</if>
|
||
|
|
<if test="isSlt != null">is_slt,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="agreementCode != null">#{agreementCode},</if>
|
||
|
|
<if test="signTime != null">#{signTime},</if>
|
||
|
|
<if test="unitId != null">#{unitId},</if>
|
||
|
|
<if test="projectId != null">#{projectId},</if>
|
||
|
|
<if test="createBy != null">#{createBy},</if>
|
||
|
|
<if test="leaseDay != null">#{leaseDay},</if>
|
||
|
|
<if test="planStartTime != null">#{planStartTime},</if>
|
||
|
|
<if test="contractCode != null">#{contractCode},</if>
|
||
|
|
<if test="authPerson != null">#{authPerson},</if>
|
||
|
|
<if test="phone != null">#{phone},</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>
|
||
|
|
<if test="fileName != null">#{fileName},</if>
|
||
|
|
<if test="fileUrl != null">#{fileUrl},</if>
|
||
|
|
<if test="status != null">#{status},</if>
|
||
|
|
<if test="protocol != null">#{protocol},</if>
|
||
|
|
<if test="isSlt != null">#{isSlt},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateBmAgreementInfo" parameterType="com.bonus.material.basic.domain.BmAgreementInfo">
|
||
|
|
update bm_agreement_info
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="agreementCode != null">agreement_code = #{agreementCode},</if>
|
||
|
|
<if test="signTime != null">sign_time = #{signTime},</if>
|
||
|
|
<if test="unitId != null">unit_id = #{unitId},</if>
|
||
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
||
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||
|
|
<if test="leaseDay != null">lease_day = #{leaseDay},</if>
|
||
|
|
<if test="planStartTime != null">plan_start_time = #{planStartTime},</if>
|
||
|
|
<if test="contractCode != null">contract_code = #{contractCode},</if>
|
||
|
|
<if test="authPerson != null">auth_person = #{authPerson},</if>
|
||
|
|
<if test="phone != null">phone = #{phone},</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>
|
||
|
|
<if test="fileName != null">file_name = #{fileName},</if>
|
||
|
|
<if test="fileUrl != null">file_url = #{fileUrl},</if>
|
||
|
|
<if test="status != null">status = #{status},</if>
|
||
|
|
<if test="protocol != null">protocol = #{protocol},</if>
|
||
|
|
<if test="isSlt != null">is_slt = #{isSlt},</if>
|
||
|
|
</trim>
|
||
|
|
where agreement_id = #{agreementId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteBmAgreementInfoByAgreementId" parameterType="Long">
|
||
|
|
delete from bm_agreement_info where agreement_id = #{agreementId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteBmAgreementInfoByAgreementIds" parameterType="String">
|
||
|
|
delete from bm_agreement_info where agreement_id in
|
||
|
|
<foreach item="agreementId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{agreementId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|