JNBusiness/ruoyi-system/src/main/resources/mapper/storageLocation/StorageLocationMapper.xml

109 lines
5.2 KiB
XML
Raw Normal View History

2024-03-15 09:05:05 +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.ruoyi.storageLocation.mapper.StorageLocationMapper">
<resultMap type="StorageLocation" id="StorageLocationResult">
2024-03-18 09:45:03 +08:00
<result property="userName" column="userName" />
2024-03-15 09:05:05 +08:00
<result property="materialBh" column="materialBh" />
2024-03-15 11:00:31 +08:00
<result property="materialZlh" column="materialZlh" />
2024-03-15 09:05:05 +08:00
<result property="materialXingh" column="materialXingh" />
<result property="materialGuig" column="materialGuig" />
<result property="materialDiany" column="materialDiany" />
<result property="materialMs" column="materialMs" />
<result property="materialState" column="materialState" />
</resultMap>
<select id="selectStorageLocationAList" parameterType="StorageLocation" resultMap="StorageLocationResult">
2024-03-15 11:00:31 +08:00
select materialBh, materialZlh, materialXingh, materialGuig, materialDiany, materialMs, materialState
2024-03-15 09:05:05 +08:00
from storageLocation where materialBh like 'A%'
</select>
<select id="selectStorageLocationBList" parameterType="StorageLocation" resultMap="StorageLocationResult">
2024-03-15 11:00:31 +08:00
select materialBh, materialZlh, materialXingh, materialGuig, materialDiany, materialMs, materialState
2024-03-15 09:05:05 +08:00
from storageLocation where materialBh like 'B%'
</select>
<select id="selectStorageLocationCList" parameterType="StorageLocation" resultMap="StorageLocationResult">
2024-03-15 11:00:31 +08:00
select materialBh, materialZlh, materialXingh, materialGuig, materialDiany, materialMs, materialState
2024-03-15 09:05:05 +08:00
from storageLocation where materialBh like 'C%'
</select>
<update id="addStorageLocation" parameterType="StorageLocation">
update storageLocation
<trim prefix="SET" suffixOverrides=",">
2024-03-15 11:00:31 +08:00
<if test="materialZlh != null and materialZlh != ''">materialZlh = #{materialZlh},</if>
2024-03-15 09:05:05 +08:00
<if test="materialXingh != null and materialXingh != ''">materialXingh = #{materialXingh},</if>
<if test="materialGuig != null and materialGuig != ''">materialGuig = #{materialGuig},</if>
<if test="materialDiany != null and materialDiany != ''">materialDiany = #{materialDiany},</if>
<if test="materialMs != null and materialMs != ''">materialMs = #{materialMs},</if>
materialState = '1'
</trim>
where materialBh = #{materialBh}
</update>
2024-03-18 12:40:22 +08:00
<update id="confirmStorageLocation" parameterType="java.util.List">
2024-03-18 16:21:52 +08:00
update storageLocation set materialState = '0',materialZlh = null,materialXingh = null,materialGuig = null,
materialDiany = null, materialMs = null
2024-03-15 15:41:34 +08:00
<where>
materialBh
2024-03-18 12:40:22 +08:00
<foreach collection="list" item="item" index="index" open="in (" close=")" separator=",">
#{item}
2024-03-15 15:41:34 +08:00
</foreach>
</where>
</update>
2024-03-18 09:45:03 +08:00
<select id="hasStorageLocation" parameterType="java.lang.String" resultType="StorageSelected">
select user_name, material_bh
from storageSelected where material_bh = #{materialBh}
</select>
<insert id="saveStorageLocation" parameterType="java.lang.String">
insert into storageSelected (user_name,material_bh) values (#{userName},#{materialBh})
</insert>
<delete id="deleteStorageLocation">
delete from storageSelected where user_name = #{userName} and material_bh = #{materialBh}
</delete>
<select id="selectStorageSelectedLocationAList" parameterType="java.lang.String" resultMap="StorageLocationResult">
select a.user_name userName,b.materialBh,b.materialXingh,
b.materialGuig,b.materialDiany,
b.materialMs,b.materialZlh
from storageSelected a
left join storageLocation b
on a.material_Bh = b.materialBh
where a.user_name = #{userName} and a.material_bh like 'A%'
</select>
<select id="selectStorageSelectedLocationBList" parameterType="java.lang.String" resultMap="StorageLocationResult">
select a.user_name userName,b.materialBh,b.materialXingh,
b.materialGuig,b.materialDiany,
b.materialMs,b.materialZlh
from storageSelected a
left join storageLocation b
on a.material_Bh = b.materialBh
where a.user_name = #{userName} and a.material_bh like 'B%'
</select>
<select id="selectStorageSelectedLocationCList" parameterType="java.lang.String" resultMap="StorageLocationResult">
select a.user_name userName,b.materialBh,b.materialXingh,
b.materialGuig,b.materialDiany,
b.materialMs,b.materialZlh
from storageSelected a
left join storageLocation b
on a.material_Bh = b.materialBh
where a.user_name = #{userName} and a.material_bh like 'C%'
</select>
2024-03-15 15:41:34 +08:00
2024-03-18 09:45:03 +08:00
<select id="selectStorageSelectedLocationList" resultType="StorageSelected">
select user_name,material_bh
from storageSelected
</select>
2024-03-18 12:40:22 +08:00
<delete id="deleteBatchStorageLocation">
delete from storageSelected where user_name = #{userName}
and material_bh
<foreach collection="list" item="item" index="index" open="in (" close=")" separator=",">
#{item}
</foreach>
</delete>
2024-03-15 09:05:05 +08:00
</mapper>