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.
udi-wms-java/src/main/resources/mybatis/mapper/basic/SysWorkplaceQueueMapper.xml

127 lines
5.2 KiB
XML

<?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.dao.basic.SysWorkplaceQueueMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.SysWorkplaceQueue">
<!--@mbg.generated-->
<!--@Table sys_workplace_queue-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="workPlaceIdFk" jdbcType="BIGINT" property="workPlaceIdFk"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="createTime" jdbcType="TIMESTAMP" property="createTime"/>
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="createUser" jdbcType="VARCHAR" property="createUser"/>
<result column="updateUser" jdbcType="VARCHAR" property="updateUser"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, code, `name`, workPlaceIdFk, remark, createTime, updateTime, `createUser`, updateUser
</sql>
<select id="selectMaxLayer" resultType="java.lang.Integer">
select max(layer) as layer from sys_workplace_queue
<where>
<if test=" freightCode != null and freightCode != ''">
AND freightCode = #{freightCode}
</if>
</where>
</select>
<select id="filterBindList" resultType="com.glxp.api.res.basic.SysWorkplaceQueueResponse">
select swq.*,bp.nameCode,bp.ggxh,bp.cpmctymc
from sys_workplace_queue swq
left join
(select bu.id,bp.nameCode,bp.ggxh,bp.cpmctymc
from basic_udirel bu
left join basic_products bp ON bu.uuid = bp.uuid
group by bu.id,bp.nameCode,bp.ggxh,bp.cpmctymc) as bp ON bp.id = swq.relId
<where>
<if test="key != null and key != ''">
AND (
swq.code like concat('%', #{key}, '%')
or swq.name like concat('%', #{key}, '%')
)
</if>
<if test="scanCode != null and scanCode != ''">
AND (
swq.code like concat('%', #{scanCode}, '%')
or swq.freightCode like concat('%', #{scanCode}, '%')
or swq.layerCode like concat('%', #{scanCode}, '%')
)
</if>
<if test="nameCode != null and nameCode != ''">
AND (
bp.nameCode like concat('%', #{nameCode}, '%')
)
</if>
<if test=" layerCode != null and layerCode != ''">
AND layerCode = #{layerCode}
</if>
<if test=" code != null and code != ''">
AND swq.code = #{code}
</if>
<if test=" workPlaceIdFk != null and workPlaceIdFk != ''">
AND swq.workPlaceIdFk = #{workPlaceIdFk}
</if>
8 months ago
<if test="layerCodes != null and layerCodes.size() > 0">
and swq.layerCode in
<foreach collection="layerCodes" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="filterList" resultType="com.glxp.api.res.basic.SysWorkplaceQueueResponse">
select swq.*
from sys_workplace_queue swq
<where>
<if test="key != null and key != ''">
AND (
swq.code like concat('%', #{key}, '%')
or swq.name like concat('%', #{key}, '%')
)
</if>
<if test=" layerCode != null and layerCode != ''">
AND layerCode = #{layerCode}
</if>
<if test="layerCodes != null and layerCodes.size() > 0">
and swq.layerCode in
<foreach collection="layerCodes" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="selectMaxGrid" resultType="java.lang.Integer">
select max(grid) as grid from sys_workplace_queue
<where>
<if test=" freightCode != null and freightCode != ''">
AND freightCode = #{freightCode}
</if>
<if test=" layer != null and layer != ''">
AND layer = #{layer}
</if>
</where>
</select>
<select id="selectMaxCode" resultType="java.lang.String">
select max(code) as code from sys_workplace_queue
<where>
<if test=" layerCode != null and layerCode != ''">
AND layerCode = #{layerCode}
</if>
</where>
</select>
<select id="selectByLayerCode" resultType="com.glxp.api.entity.basic.SysWorkplaceQueue">
select * from sys_workplace_queue
<where>
<if test=" layerCode != null and layerCode != ''">
AND layerCode = #{layerCode}
</if>
</where>
ORDER BY code DESC
LIMIT 1
</select>
</mapper>