Bonus-Cloud-Material/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml

170 lines
11 KiB
XML
Raw Normal View History

2024-09-27 15:26:57 +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.lease.mapper.LeaseApplyInfoMapper">
<resultMap type="com.bonus.material.lease.domain.LeaseApplyInfo" id="LeaseApplyInfoResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="taskId" column="task_id" />
<result property="leasePerson" column="lease_person" />
<result property="phone" column="phone" />
<result property="type" column="type" />
<result property="companyAuditBy" column="company_audit_by" />
<result property="companyAuditTime" column="company_audit_time" />
<result property="companyAuditRemark" column="company_audit_remark" />
<result property="deptAuditBy" column="dept_audit_by" />
<result property="deptAuditTime" column="dept_audit_time" />
<result property="deptAuditRemark" column="dept_audit_remark" />
<result property="directAuditBy" column="direct_audit_by" />
<result property="directAuditTime" column="direct_audit_time" />
<result property="directAuditRemark" column="direct_audit_remark" />
<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" />
<result property="status" column="status" />
<result property="directId" column="direct_id" />
<result property="leaseType" column="lease_type" />
<result property="estimateLeaseTime" column="estimate_lease_time" />
<result property="costBearingParty" column="cost_bearing_party" />
</resultMap>
<sql id="selectLeaseApplyInfoVo">
select id, code, task_id, lease_person, phone, type, company_audit_by, company_audit_time, company_audit_remark, dept_audit_by, dept_audit_time, dept_audit_remark, direct_audit_by, direct_audit_time, direct_audit_remark, create_by, create_time, update_by, update_time, remark, company_id, status, direct_id, lease_type, estimate_lease_time, cost_bearing_party from lease_apply_info
</sql>
<select id="selectLeaseApplyInfoList" parameterType="com.bonus.material.lease.domain.LeaseApplyInfo" resultMap="LeaseApplyInfoResult">
<include refid="selectLeaseApplyInfoVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="leasePerson != null and leasePerson != ''"> and lease_person = #{leasePerson}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="companyAuditBy != null "> and company_audit_by = #{companyAuditBy}</if>
<if test="companyAuditTime != null "> and company_audit_time = #{companyAuditTime}</if>
<if test="companyAuditRemark != null and companyAuditRemark != ''"> and company_audit_remark = #{companyAuditRemark}</if>
<if test="deptAuditBy != null "> and dept_audit_by = #{deptAuditBy}</if>
<if test="deptAuditTime != null "> and dept_audit_time = #{deptAuditTime}</if>
<if test="deptAuditRemark != null and deptAuditRemark != ''"> and dept_audit_remark = #{deptAuditRemark}</if>
<if test="directAuditBy != null "> and direct_audit_by = #{directAuditBy}</if>
<if test="directAuditTime != null "> and direct_audit_time = #{directAuditTime}</if>
<if test="directAuditRemark != null and directAuditRemark != ''"> and direct_audit_remark = #{directAuditRemark}</if>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="directId != null "> and direct_id = #{directId}</if>
<if test="leaseType != null and leaseType != ''"> and lease_type = #{leaseType}</if>
<if test="estimateLeaseTime != null "> and estimate_lease_time = #{estimateLeaseTime}</if>
<if test="costBearingParty != null and costBearingParty != ''"> and cost_bearing_party = #{costBearingParty}</if>
</where>
</select>
<select id="selectLeaseApplyInfoById" parameterType="Long" resultMap="LeaseApplyInfoResult">
<include refid="selectLeaseApplyInfoVo"/>
where id = #{id}
</select>
<insert id="insertLeaseApplyInfo" parameterType="com.bonus.material.lease.domain.LeaseApplyInfo" useGeneratedKeys="true" keyProperty="id">
insert into lease_apply_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null">code,</if>
<if test="taskId != null">task_id,</if>
<if test="leasePerson != null">lease_person,</if>
<if test="phone != null">phone,</if>
<if test="type != null">type,</if>
<if test="companyAuditBy != null">company_audit_by,</if>
<if test="companyAuditTime != null">company_audit_time,</if>
<if test="companyAuditRemark != null">company_audit_remark,</if>
<if test="deptAuditBy != null">dept_audit_by,</if>
<if test="deptAuditTime != null">dept_audit_time,</if>
<if test="deptAuditRemark != null">dept_audit_remark,</if>
<if test="directAuditBy != null">direct_audit_by,</if>
<if test="directAuditTime != null">direct_audit_time,</if>
<if test="directAuditRemark != null">direct_audit_remark,</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>
<if test="status != null">status,</if>
<if test="directId != null">direct_id,</if>
<if test="leaseType != null">lease_type,</if>
<if test="estimateLeaseTime != null">estimate_lease_time,</if>
<if test="costBearingParty != null">cost_bearing_party,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null">#{code},</if>
<if test="taskId != null">#{taskId},</if>
<if test="leasePerson != null">#{leasePerson},</if>
<if test="phone != null">#{phone},</if>
<if test="type != null">#{type},</if>
<if test="companyAuditBy != null">#{companyAuditBy},</if>
<if test="companyAuditTime != null">#{companyAuditTime},</if>
<if test="companyAuditRemark != null">#{companyAuditRemark},</if>
<if test="deptAuditBy != null">#{deptAuditBy},</if>
<if test="deptAuditTime != null">#{deptAuditTime},</if>
<if test="deptAuditRemark != null">#{deptAuditRemark},</if>
<if test="directAuditBy != null">#{directAuditBy},</if>
<if test="directAuditTime != null">#{directAuditTime},</if>
<if test="directAuditRemark != null">#{directAuditRemark},</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>
<if test="status != null">#{status},</if>
<if test="directId != null">#{directId},</if>
<if test="leaseType != null">#{leaseType},</if>
<if test="estimateLeaseTime != null">#{estimateLeaseTime},</if>
<if test="costBearingParty != null">#{costBearingParty},</if>
</trim>
</insert>
<update id="updateLeaseApplyInfo" parameterType="com.bonus.material.lease.domain.LeaseApplyInfo">
update lease_apply_info
<trim prefix="SET" suffixOverrides=",">
<if test="code != null">code = #{code},</if>
<if test="taskId != null">task_id = #{taskId},</if>
<if test="leasePerson != null">lease_person = #{leasePerson},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="type != null">type = #{type},</if>
<if test="companyAuditBy != null">company_audit_by = #{companyAuditBy},</if>
<if test="companyAuditTime != null">company_audit_time = #{companyAuditTime},</if>
<if test="companyAuditRemark != null">company_audit_remark = #{companyAuditRemark},</if>
<if test="deptAuditBy != null">dept_audit_by = #{deptAuditBy},</if>
<if test="deptAuditTime != null">dept_audit_time = #{deptAuditTime},</if>
<if test="deptAuditRemark != null">dept_audit_remark = #{deptAuditRemark},</if>
<if test="directAuditBy != null">direct_audit_by = #{directAuditBy},</if>
<if test="directAuditTime != null">direct_audit_time = #{directAuditTime},</if>
<if test="directAuditRemark != null">direct_audit_remark = #{directAuditRemark},</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>
<if test="status != null">status = #{status},</if>
<if test="directId != null">direct_id = #{directId},</if>
<if test="leaseType != null">lease_type = #{leaseType},</if>
<if test="estimateLeaseTime != null">estimate_lease_time = #{estimateLeaseTime},</if>
<if test="costBearingParty != null">cost_bearing_party = #{costBearingParty},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteLeaseApplyInfoById" parameterType="Long">
delete from lease_apply_info where id = #{id}
</delete>
<delete id="deleteLeaseApplyInfoByIds" parameterType="String">
delete from lease_apply_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>