devicesmgt/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml

519 lines
19 KiB
XML
Raw Normal View History

<?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.app.mapper.LeaseApplyDetailsMapper">
2023-12-14 09:37:38 +08:00
<resultMap id="BaseResultMap" type="com.bonus.sgzb.base.api.domain.LeaseApplyDetails">
<!--@mbg.generated-->
<!--@Table lease_apply_details-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="parennt_id" jdbcType="INTEGER" property="parenntId" />
<result column="type_id" jdbcType="INTEGER" property="typeId" />
<result column="pre_num" jdbcType="FLOAT" property="preNum" />
<result column="al_num" jdbcType="FLOAT" property="alNum" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
update_time, remark, company_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from lease_apply_details
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from lease_apply_details
where id = #{id,jdbcType=INTEGER}
</delete>
2023-12-14 09:37:38 +08:00
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into lease_apply_details (parennt_id, type_id, pre_num,
al_num, `status`, create_by,
create_time, update_by, update_time,
remark, company_id)
values (#{parenntId,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{preNum,jdbcType=FLOAT},
#{alNum,jdbcType=FLOAT}, #{status,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER})
</insert>
2023-12-14 09:37:38 +08:00
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into lease_apply_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parenntId != null">
parennt_id,
</if>
<if test="typeId != null">
type_id,
</if>
<if test="preNum != null">
pre_num,
</if>
<if test="alNum != null">
al_num,
</if>
<if test="status != null and status != ''">
`status`,
</if>
<if test="createBy != null and createBy != ''">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null and updateBy != ''">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
<if test="companyId != null">
company_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parenntId != null">
#{parenntId,jdbcType=INTEGER},
</if>
<if test="typeId != null">
#{typeId,jdbcType=INTEGER},
</if>
<if test="preNum != null">
#{preNum,jdbcType=FLOAT},
</if>
<if test="alNum != null">
#{alNum,jdbcType=FLOAT},
</if>
<if test="status != null and status != ''">
#{status,jdbcType=VARCHAR},
</if>
<if test="createBy != null and createBy != ''">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
</trim>
</insert>
2023-12-14 09:37:38 +08:00
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails">
<!--@mbg.generated-->
update lease_apply_details
<set>
<if test="parenntId != null">
parennt_id = #{parenntId,jdbcType=INTEGER},
</if>
<if test="typeId != null">
type_id = #{typeId,jdbcType=INTEGER},
</if>
<if test="preNum != null">
pre_num = #{preNum,jdbcType=FLOAT},
</if>
<if test="alNum != null">
al_num = #{alNum,jdbcType=FLOAT},
</if>
<if test="status != null and status != ''">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="createBy != null and createBy != ''">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
2023-12-14 09:37:38 +08:00
<update id="updateByPrimaryKey" parameterType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails">
<!--@mbg.generated-->
update lease_apply_details
set parennt_id = #{parenntId,jdbcType=INTEGER},
type_id = #{typeId,jdbcType=INTEGER},
pre_num = #{preNum,jdbcType=FLOAT},
al_num = #{alNum,jdbcType=FLOAT},
`status` = #{status,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update lease_apply_details
<trim prefix="set" suffixOverrides=",">
<trim prefix="parennt_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.parenntId,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="type_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.typeId,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="pre_num = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.preNum,jdbcType=FLOAT}
</foreach>
</trim>
<trim prefix="al_num = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.alNum,jdbcType=FLOAT}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.companyId,jdbcType=INTEGER}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update lease_apply_details
<trim prefix="set" suffixOverrides=",">
<trim prefix="parennt_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.parenntId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.parenntId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="type_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.typeId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.typeId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="pre_num = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.preNum != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.preNum,jdbcType=FLOAT}
</if>
</foreach>
</trim>
<trim prefix="al_num = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.alNum != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.alNum,jdbcType=FLOAT}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.companyId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into lease_apply_details
(parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
update_time, remark, company_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.parenntId,jdbcType=INTEGER}, #{item.typeId,jdbcType=INTEGER}, #{item.preNum,jdbcType=FLOAT},
#{item.alNum,jdbcType=FLOAT}, #{item.status,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER})
</foreach>
</insert>
2023-12-14 09:37:38 +08:00
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into lease_apply_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
parennt_id,
type_id,
pre_num,
al_num,
`status`,
create_by,
create_time,
update_by,
update_time,
remark,
company_id,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{parenntId,jdbcType=INTEGER},
#{typeId,jdbcType=INTEGER},
#{preNum,jdbcType=FLOAT},
#{alNum,jdbcType=FLOAT},
#{status,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR},
#{companyId,jdbcType=INTEGER},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
parennt_id = #{parenntId,jdbcType=INTEGER},
type_id = #{typeId,jdbcType=INTEGER},
pre_num = #{preNum,jdbcType=FLOAT},
al_num = #{alNum,jdbcType=FLOAT},
`status` = #{status,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=INTEGER},
</trim>
</insert>
2023-12-14 09:37:38 +08:00
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into lease_apply_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="parenntId != null">
parennt_id,
</if>
<if test="typeId != null">
type_id,
</if>
<if test="preNum != null">
pre_num,
</if>
<if test="alNum != null">
al_num,
</if>
<if test="status != null and status != ''">
`status`,
</if>
<if test="createBy != null and createBy != ''">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null and updateBy != ''">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
<if test="companyId != null">
company_id,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="parenntId != null">
#{parenntId,jdbcType=INTEGER},
</if>
<if test="typeId != null">
#{typeId,jdbcType=INTEGER},
</if>
<if test="preNum != null">
#{preNum,jdbcType=FLOAT},
</if>
<if test="alNum != null">
#{alNum,jdbcType=FLOAT},
</if>
<if test="status != null and status != ''">
#{status,jdbcType=VARCHAR},
</if>
<if test="createBy != null and createBy != ''">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="parenntId != null">
parennt_id = #{parenntId,jdbcType=INTEGER},
</if>
<if test="typeId != null">
type_id = #{typeId,jdbcType=INTEGER},
</if>
<if test="preNum != null">
pre_num = #{preNum,jdbcType=FLOAT},
</if>
<if test="alNum != null">
al_num = #{alNum,jdbcType=FLOAT},
</if>
<if test="status != null and status != ''">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="createBy != null and createBy != ''">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
</trim>
</insert>
</mapper>