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

99 lines
4.0 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="filterList" resultType="com.glxp.api.res.basic.SysWorkplaceQueueResponse">
select sq.*,
basic_products.cpmctymc productName,
COALESCE(basic_products.bzgg, basic_products.ggxh) as productSpec
from sys_workplace_queue sq
left join io_split_fifo_code isfc on isfc.workPlaceQueueCode = sq.code
left join basic_udirel bu on isfc.relId = bu.id
left join basic_products ON basic_products.uuid = bu.uuid
<where>
<if test="key != null and key != ''">
AND (
sq.code like concat('%', #{key}, '%')
or sq.name like concat('%', #{key}, '%')
)
</if>
<if test=" workPlaceIdFk != null and workPlaceIdFk != ''">
AND workPlaceIdFk = #{workPlaceIdFk}
</if>
</where>
GROUP BY sq.code
ORDER BY sq.code
</select>
<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="filterListFreightCode" 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>
</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>