JNBusinessTest/ruoyi-system/target/classes/mapper/storageLocation/StorageLocationMapper.xml

175 lines
8.6 KiB
XML
Raw Normal View History

2024-06-24 16:57:12 +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">
<result property="userName" column="userName" />
<result property="materialBh" column="materialBh" />
<result property="materialZlh" column="materialZlh" />
<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">
select materialBh, materialZlh, materialXingh, materialGuig, materialDiany, materialMs, materialState, userName
from storageLocation where materialBh like 'A%'
</select>
<select id="selectStorageLocationBList" parameterType="StorageLocation" resultMap="StorageLocationResult">
select materialBh, materialZlh, materialXingh, materialGuig, materialDiany, materialMs, materialState, userName
from storageLocation where materialBh like 'B%'
</select>
<select id="selectStorageLocationCList" parameterType="StorageLocation" resultMap="StorageLocationResult">
select materialBh, materialZlh, materialXingh, materialGuig, materialDiany, materialMs, materialState, userName
from storageLocation where materialBh like 'C%'
</select>
<update id="addStorageLocation" parameterType="StorageLocation">
update storageLocation
<trim prefix="SET" suffixOverrides=",">
<if test="materialZlh != null and materialZlh != ''">materialZlh = #{materialZlh},</if>
<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>
<if test="userName != null and userName != ''">userName = #{userName},</if>
materialState = '1'
</trim>
where materialBh = #{materialBh}
</update>
<update id="confirmStorageLocation" parameterType="java.util.List">
update storageLocation set materialState = '0',materialZlh = null,materialXingh = null,materialGuig = null,
materialDiany = null, materialMs = null, userName = null
<where>
materialBh
<foreach collection="list" item="item" index="index" open="in (" close=")" separator=",">
#{item}
</foreach>
</where>
</update>
<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>
<select id="selectStorageSelectedLocationList" resultType="StorageSelected">
select user_name,material_bh
from storageSelected
</select>
<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>
<insert id="addOperlog" parameterType="Operlog">
insert into operlog (operlog_kw,operlog_date,operlog_user_name,operlog_nick_name,operlog_event,operlog_zlh,operlog_xingh,operlog_guig,operlog_diany,operlog_ms)
values (#{operlog_kw},#{operlog_date},#{operlog_user_name},#{operlog_nick_name},#{operlog_event},#{operlog_zlh},#{operlog_xingh},#{operlog_guig},#{operlog_diany},#{operlog_ms})
</insert>
<select id="selectStorageLocation" resultType="StorageLocation">
select a.material_bh 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
<foreach collection="list" item="item" index="index" open="in (" close=")" separator=",">
#{item}
</foreach>
</select>
<insert id="addBatchOperlog">
insert into operlog (operlog_kw,operlog_date,operlog_user_name,operlog_nick_name,operlog_event,operlog_zlh,operlog_xingh,operlog_guig,operlog_diany,operlog_ms)
values
<foreach collection="list" index="" item="item" separator=",">
(#{item.operlog_kw,jdbcType=VARCHAR},
#{item.operlog_date,jdbcType=VARCHAR},
#{item.operlog_user_name,jdbcType=VARCHAR},
#{item.operlog_nick_name,jdbcType=VARCHAR},
#{item.operlog_event,jdbcType=VARCHAR},
#{item.operlog_zlh,jdbcType=VARCHAR},
#{item.operlog_xingh,jdbcType=VARCHAR},
#{item.operlog_guig,jdbcType=VARCHAR},
#{item.operlog_diany,jdbcType=VARCHAR},
#{item.operlog_ms,jdbcType=VARCHAR})
</foreach>
</insert>
<select id="selectOperlogs" parameterType="Operlog" resultType="Operlog">
select operlog_date,operlog_user_name,operlog_nick_name,operlog_event,operlog_zlh,operlog_xingh
,operlog_guig,operlog_diany,operlog_ms
from operlog
<where>
<if test="operlog_kw != null and operlog_kw != ''">
AND operlog_kw = #{operlog_kw}
</if>
<if test="operlog_user_name != null and operlog_user_name != ''">
AND operlog_user_name = #{operlog_user_name}
</if>
<if test="operlog_nick_name != null and operlog_nick_name != ''">
AND operlog_nick_name like concat('%', #{operlog_nick_name}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and datediff(d, operlog_date, #{params.beginTime}) <![CDATA[<=]]> 0
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and datediff(d, operlog_date, #{params.endTime}) <![CDATA[>=]]> 0
</if>
</where>
order by operlog_date desc
</select>
<select id="selectYlrStorageLocation" parameterType="java.lang.String" resultType="StorageLocation">
select materialBh,materialXingh,materialGuig,materialDiany,materialMs
,materialState,materialZlh,userName
from storageLocation
where materialBh = #{materialBh}
</select>
</mapper>