You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.8 KiB
XML
83 lines
2.8 KiB
XML
3 years ago
|
<?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.glxp.api.admin.dao.thrsys.ThrSubInvWarehouseDao">
|
||
|
<select id="filterThrInvWarehouse" parameterType="com.glxp.api.admin.req.thrsys.FilterThrInvWarehouseRequest"
|
||
|
resultType="com.glxp.api.admin.entity.thrsys.ThrSubInvWarehouseEntity">
|
||
|
SELECT *
|
||
|
FROM thr_inv_warehouse_sub
|
||
|
<where>
|
||
|
<if test="id != '' and id != null">
|
||
|
AND id = #{id}
|
||
|
</if>
|
||
|
<if test="code != '' and code != null">
|
||
|
AND code = #{code}
|
||
|
</if>
|
||
|
<if test="name != '' and name != null">
|
||
|
AND `name` = #{name}
|
||
|
</if>
|
||
|
<if test="parentId != '' and parentId != null">
|
||
|
AND parentId = #{parentId}
|
||
|
</if>
|
||
|
<if test="thirdSysFk != null">
|
||
|
and thirdSysFk = #{thirdSysFk}
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectById" parameterType="Map"
|
||
|
resultType="com.glxp.api.admin.entity.thrsys.ThrSubInvWarehouseEntity">
|
||
|
SELECT *
|
||
|
FROM thr_inv_warehouse_sub
|
||
|
WHERE id = #{id}
|
||
|
</select>
|
||
|
|
||
|
|
||
|
<insert id="insertThrInvWarehouse" keyProperty="id"
|
||
|
parameterType="com.glxp.api.admin.entity.thrsys.ThrSubInvWarehouseEntity">
|
||
|
replace
|
||
|
INTO thr_inv_warehouse_sub
|
||
|
(id, code, `name`, parentId, remark, thirdSysFk)
|
||
|
values (
|
||
|
#{id},
|
||
|
#{code},
|
||
|
#{name},
|
||
|
#{parentId},
|
||
|
#{remark},
|
||
|
#{thirdSysFk}
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
<insert id="insertThrInvWarehouses" parameterType="java.util.List">
|
||
|
replace INTO thr_inv_warehouse_sub
|
||
|
(id, code, `name`, parentId, remark, thirdSysFk)
|
||
|
VALUES
|
||
|
<foreach collection="thrInvWarehouseEntitys" item="item" index="index"
|
||
|
separator=",">
|
||
|
(
|
||
|
#{id}, #{item.code},
|
||
|
#{item.name}, #{parentId}
|
||
|
#{item.remark}, #{item.thirdSysFk})
|
||
|
</foreach>
|
||
|
</insert>
|
||
|
|
||
|
<delete id="deleteById" parameterType="Map">
|
||
|
DELETE
|
||
|
FROM thr_inv_warehouse_sub
|
||
|
WHERE id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<update id="updateThrInvWarehouse" parameterType="com.glxp.api.admin.entity.thrsys.ThrSubInvWarehouseEntity">
|
||
|
UPDATE thr_inv_warehouse_sub
|
||
|
<trim prefix="set" suffixOverrides=",">
|
||
|
<if test="name != null">`name`=#{name},</if>
|
||
|
<if test="code != null">code=#{code},</if>
|
||
|
<if test="parentId != null">parentId=#{parentId},</if>
|
||
|
<if test="remark != null">remark=#{remark},</if>
|
||
|
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
||
|
</trim>
|
||
|
WHERE id = #{id}
|
||
|
</update>
|
||
|
|
||
|
|
||
|
</mapper>
|