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.LeaseApplyDetailsMapper">
|
|
|
|
|
<resultMap type="com.bonus.material.lease.domain.LeaseApplyDetails" id="LeaseApplyDetailsResult">
|
|
|
|
|
<result property="id" column="id" />
|
2024-11-11 10:18:32 +08:00
|
|
|
<result property="parentId" column="parent_id" />
|
2024-09-27 15:26:57 +08:00
|
|
|
<result property="typeId" column="type_id" />
|
|
|
|
|
<result property="preNum" column="pre_num" />
|
|
|
|
|
<result property="auditNum" column="audit_num" />
|
|
|
|
|
<result property="alNum" column="al_num" />
|
|
|
|
|
<result property="status" column="status" />
|
|
|
|
|
<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="selectLeaseApplyDetailsVo">
|
2024-11-11 10:18:32 +08:00
|
|
|
select id, parent_id, type_id, pre_num, audit_num, al_num, status, create_by, create_time, update_by, update_time, remark, company_id from lease_apply_details
|
2024-09-27 15:26:57 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectLeaseApplyDetailsList" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" resultMap="LeaseApplyDetailsResult">
|
|
|
|
|
<include refid="selectLeaseApplyDetailsVo"/>
|
|
|
|
|
<where>
|
2024-11-11 10:18:32 +08:00
|
|
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
2024-09-27 15:26:57 +08:00
|
|
|
<if test="typeId != null "> and type_id = #{typeId}</if>
|
|
|
|
|
<if test="preNum != null "> and pre_num = #{preNum}</if>
|
|
|
|
|
<if test="auditNum != null "> and audit_num = #{auditNum}</if>
|
|
|
|
|
<if test="alNum != null "> and al_num = #{alNum}</if>
|
|
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectLeaseApplyDetailsById" parameterType="Long" resultMap="LeaseApplyDetailsResult">
|
|
|
|
|
<include refid="selectLeaseApplyDetailsVo"/>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertLeaseApplyDetails" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into lease_apply_details
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
2024-11-11 10:18:32 +08:00
|
|
|
<if test="parentId != null">parent_id,</if>
|
2024-09-27 15:26:57 +08:00
|
|
|
<if test="typeId != null">type_id,</if>
|
|
|
|
|
<if test="preNum != null">pre_num,</if>
|
|
|
|
|
<if test="auditNum != null">audit_num,</if>
|
|
|
|
|
<if test="alNum != null">al_num,</if>
|
|
|
|
|
<if test="status != null">status,</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=",">
|
2024-11-11 10:18:32 +08:00
|
|
|
<if test="parentId != null">#{parentId},</if>
|
2024-09-27 15:26:57 +08:00
|
|
|
<if test="typeId != null">#{typeId},</if>
|
|
|
|
|
<if test="preNum != null">#{preNum},</if>
|
|
|
|
|
<if test="auditNum != null">#{auditNum},</if>
|
|
|
|
|
<if test="alNum != null">#{alNum},</if>
|
|
|
|
|
<if test="status != null">#{status},</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-11-11 10:08:01 +08:00
|
|
|
<insert id="insertLeaseApplyDetailsList" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
|
|
|
|
insert into lease_apply_details
|
2024-11-11 10:18:32 +08:00
|
|
|
(parent_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
|
2024-11-11 10:08:01 +08:00
|
|
|
update_time, remark, company_id)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
2024-11-11 10:18:32 +08:00
|
|
|
(#{item.parentId,jdbcType=INTEGER}, #{item.typeId,jdbcType=INTEGER}, #{item.preNum,jdbcType=INTEGER},
|
2024-11-11 10:08:01 +08:00
|
|
|
#{item.alNum,jdbcType=INTEGER}, #{item.status,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
|
|
|
|
|
NOW(), #{item.updateBy,jdbcType=VARCHAR}, NOW(),
|
|
|
|
|
#{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER})
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
|
2024-09-27 15:26:57 +08:00
|
|
|
<update id="updateLeaseApplyDetails" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
|
|
|
|
update lease_apply_details
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
2024-11-11 10:18:32 +08:00
|
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
2024-09-27 15:26:57 +08:00
|
|
|
<if test="typeId != null">type_id = #{typeId},</if>
|
|
|
|
|
<if test="preNum != null">pre_num = #{preNum},</if>
|
|
|
|
|
<if test="auditNum != null">audit_num = #{auditNum},</if>
|
|
|
|
|
<if test="alNum != null">al_num = #{alNum},</if>
|
|
|
|
|
<if test="status != null">status = #{status},</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 id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteLeaseApplyDetailsById" parameterType="Long">
|
|
|
|
|
delete from lease_apply_details where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteLeaseApplyDetailsByIds" parameterType="String">
|
|
|
|
|
delete from lease_apply_details where id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
2024-11-11 10:18:32 +08:00
|
|
|
|
|
|
|
|
<delete id="deleteLeaseApplyDetailsByParentIds" parameterType="Long">
|
|
|
|
|
delete from lease_apply_details where parent_id in (
|
|
|
|
|
select task_id
|
|
|
|
|
from lease_apply_info
|
|
|
|
|
where
|
|
|
|
|
id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</delete>
|
2024-09-27 15:26:57 +08:00
|
|
|
</mapper>
|