devicesmgt/sgzb-modules/sgzb-system/src/main/resources/mapper/system/BmStorageLogMapper.xml

231 lines
11 KiB
XML
Raw Normal View History

2024-08-06 14:56:02 +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.sgzb.system.mapper.BmStorageLogMapper">
<resultMap id="BaseResultMap" type="com.bonus.sgzb.base.api.domain.BmStorageLog">
<!--@mbg.generated-->
<!--@Table bm_storage_log-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="model_title" jdbcType="VARCHAR" property="modelTitle" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="task_id" jdbcType="VARCHAR" property="taskId" />
<result column="agreement_id" jdbcType="INTEGER" property="agreementId" />
<result column="task_name" jdbcType="VARCHAR" property="taskName" />
<result column="type_id" jdbcType="INTEGER" property="typeId" />
<result column="type_name" jdbcType="VARCHAR" property="typeName" />
<result column="type_parent_name" jdbcType="VARCHAR" property="typeParentName" />
<result column="pre_store_num" jdbcType="INTEGER" property="preStoreNum" />
<result column="in_num" jdbcType="INTEGER" property="inNum" />
<result column="out_num" jdbcType="INTEGER" property="outNum" />
<result column="back_num" jdbcType="INTEGER" property="backNum" />
<result column="pass_num" jdbcType="INTEGER" property="passNum" />
<result column="maintenance_num" jdbcType="INTEGER" property="maintenanceNum" />
<result column="scrap_num" jdbcType="INTEGER" property="scrapNum" />
<result column="post_store_num" jdbcType="INTEGER" property="postStoreNum" />
<result column="json_result" jdbcType="VARCHAR" property="jsonResult" />
<result column="result_code" jdbcType="INTEGER" property="resultCode" />
<result column="result_msg" jdbcType="VARCHAR" property="resultMsg" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="status" jdbcType="TINYINT" property="status" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, model_title, `method`, task, type_id, num, `description`, json_result, `time`, creator,
remark, `status`
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
bsl.id, bsl.model_title, bsl.`method`, bsl.task_id, bsl.type_id, bsl.pre_store_num, bsl.in_num, bsl.out_num,bsl.post_store_num,bsl.result_code,bsl.result_msg,
bsl.back_num, bsl.pass_num, bsl.maintenance_num, bsl.scrap_num, bsl.json_result, bsl.create_time, bsl.creator, bsl.manage_type, bsl.agreement_id,
bsl.remark, bsl.`status`, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name
from bm_storage_log bsl
left join ma_type mt on bsl.type_id = mt.type_id
inner join ma_type mt1 on mt.parent_id = mt1.type_id
left join tm_task tt on bsl.task_id = tt.task_id
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
bsl.id, bsl.model_title, bsl.`method`, bsl.task_id, bsl.type_id, bsl.pre_store_num, bsl.in_num, bsl.out_num,bsl.post_store_num,bsl.result_code,bsl.result_msg,
bsl.back_num, bsl.pass_num, bsl.maintenance_num, bsl.scrap_num, bsl.json_result, bsl.create_time, bsl.creator, bsl.manage_type, bsl.agreement_id,
bsl.remark, bsl.`status`, mt.type_name, mt1.type_name as type_parent_name, tt.code as task_name
from bm_storage_log bsl
left join ma_type mt on bsl.type_id = mt.type_id
inner join ma_type mt1 on mt.parent_id = mt1.type_id
left join tm_task tt on bsl.task_id = tt.task_id
<where>
<if test="modelTitle != null and modelTitle != ''">
and bsl.model_title like concat('%', #{modelTitle}, '%')
</if>
<if test="typeName != null and typeName != ''">
and mt1.type_name like concat('%', #{typeName}, '%')
</if>
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from bm_storage_log
where id = #{id,jdbcType=INTEGER}
</delete>
<!-- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.system.api.domain.BmStorageLog" useGeneratedKeys="true">-->
<!-- &lt;!&ndash;@mbg.generated&ndash;&gt;-->
<!-- insert into bm_storage_log (model_title, `method`, task_id, type_id,-->
<!-- description, json_result, create_time, creator, remark,-->
<!-- pre_num, input_num, out_num, audit_num, manage_type,-->
<!-- type_name, type_model_name, pre_store_num, in_num,-->
<!-- back_num, pass_num, maintenance_num, scrap_num, `status`, post_store_num-->
<!-- )-->
<!-- values (#{modelTitle,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, #{typeId,jdbcType=INTEGER},-->
<!-- #{description,jdbcType=VARCHAR}, #{jsonResult,jdbcType=VARCHAR}, now(), #{creator,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},-->
<!-- #{preNum,jdbcType=VARCHAR}, #{inputNum,jdbcType=VARCHAR}, #{outNum,jdbcType=VARCHAR}, #{auditNum,jdbcType=VARCHAR}, #{manageType,jdbcType=VARCHAR},-->
<!-- #{typeName,jdbcType=VARCHAR}, #{typeModelName,jdbcType=VARCHAR}, #{preStoreNum,jdbcType=VARCHAR}, #{inNum,jdbcType=VARCHAR},-->
<!-- #{backNum,jdbcType=VARCHAR}, #{passNum,jdbcType=VARCHAR}, #{maintenanceNum,jdbcType=VARCHAR}, #{scrapNum,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},-->
<!-- #{postStoreNum,jdbcType=VARCHAR}-->
<!-- )-->
<!-- </insert>-->
2024-08-06 17:05:54 +08:00
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.base.api.domain.BmStorageLog" useGeneratedKeys="true">
2024-08-06 14:56:02 +08:00
insert into bm_storage_log (model_title, `method`, task_id, type_id,
create_time, creator, remark, out_num, manage_type,
type_name, type_model_name, pre_store_num, in_num,
back_num, pass_num, maintenance_num, agreement_id,
scrap_num, `status`, post_store_num, result_code, result_msg, json_result
) values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.modelTitle,jdbcType=VARCHAR}, #{item.method,jdbcType=VARCHAR}, #{item.taskId,jdbcType=VARCHAR}, #{item.typeId,jdbcType=INTEGER},
now(), #{item.creator,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.outNum,jdbcType=INTEGER}, #{item.manageType,jdbcType=VARCHAR},
#{item.typeName,jdbcType=VARCHAR}, #{item.typeModelName,jdbcType=VARCHAR}, #{item.preStoreNum,jdbcType=INTEGER}, #{item.inNum,jdbcType=INTEGER},
#{item.backNum,jdbcType=INTEGER}, #{item.passNum,jdbcType=INTEGER}, #{item.maintenanceNum,jdbcType=INTEGER}, #{item.agreementId,jdbcType=INTEGER},
#{item.scrapNum,jdbcType=INTEGER}, #{item.status,jdbcType=VARCHAR}, #{item.postStoreNum,jdbcType=INTEGER},
#{item.resultCode,jdbcType=INTEGER}, #{item.resultMsg,jdbcType=VARCHAR}, #{item.jsonResult,jdbcType=VARCHAR}
)
</foreach>
</insert>
2024-08-06 17:05:54 +08:00
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.base.api.domain.BmStorageLog" useGeneratedKeys="true">
2024-08-06 14:56:02 +08:00
<!--@mbg.generated-->
insert into bm_storage_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="modelTitle != null and modelTitle != ''">
model_title,
</if>
<if test="method != null and method != ''">
`method`,
</if>
<if test="task != null and task != ''">
task,
</if>
<if test="typeId != null">
type_id,
</if>
<if test="num != null and num != ''">
num,
</if>
<if test="description != null and description != ''">
`description`,
</if>
<if test="jsonResult != null and jsonResult != ''">
json_result,
</if>
<if test="time != null">
`time`,
</if>
<if test="creator != null and creator != ''">
creator,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="modelTitle != null and modelTitle != ''">
#{modelTitle,jdbcType=VARCHAR},
</if>
<if test="method != null and method != ''">
#{method,jdbcType=VARCHAR},
</if>
<if test="task != null and task != ''">
#{task,jdbcType=VARCHAR},
</if>
<if test="typeId != null">
#{typeId,jdbcType=INTEGER},
</if>
<if test="num != null and num != ''">
#{num,jdbcType=VARCHAR},
</if>
<if test="description != null and description != ''">
#{description,jdbcType=VARCHAR},
</if>
<if test="jsonResult != null and jsonResult != ''">
#{jsonResult,jdbcType=VARCHAR},
</if>
<if test="time != null">
#{time,jdbcType=TIMESTAMP},
</if>
<if test="creator != null and creator != ''">
#{creator,jdbcType=VARCHAR},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
2024-08-06 17:05:54 +08:00
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.sgzb.base.api.domain.BmStorageLog">
2024-08-06 14:56:02 +08:00
<!--@mbg.generated-->
update bm_storage_log
<set>
<if test="modelTitle != null and modelTitle != ''">
model_title = #{modelTitle,jdbcType=VARCHAR},
</if>
<if test="method != null and method != ''">
`method` = #{method,jdbcType=VARCHAR},
</if>
<if test="task != null and task != ''">
task = #{task,jdbcType=VARCHAR},
</if>
<if test="typeId != null">
type_id = #{typeId,jdbcType=INTEGER},
</if>
<if test="description != null and description != ''">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="jsonResult != null and jsonResult != ''">
json_result = #{jsonResult,jdbcType=VARCHAR},
</if>
<if test="time != null">
`time` = #{time,jdbcType=TIMESTAMP},
</if>
<if test="creator != null and creator != ''">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
2024-08-06 17:05:54 +08:00
<update id="updateByPrimaryKey" parameterType="com.bonus.sgzb.base.api.domain.BmStorageLog">
2024-08-06 14:56:02 +08:00
<!--@mbg.generated-->
update bm_storage_log
set model_title = #{modelTitle,jdbcType=VARCHAR},
`method` = #{method,jdbcType=VARCHAR},
task = #{task,jdbcType=VARCHAR},
type_id = #{typeId,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
json_result = #{jsonResult,jdbcType=VARCHAR},
`time` = #{time,jdbcType=TIMESTAMP},
creator = #{creator,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>