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/SysWorkplaceFreightMapper.xml

49 lines
1.9 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.SysWorkplaceFreightMapper">
<select id="filterList" resultType="com.glxp.api.res.basic.SysWorkplaceFreightResponse">
select swf.*,
sw.workplaceName workPlaceName,
COUNT(swl.freightCode) as layerCount
from sys_workplace_freight swf
left join sys_workplace sw on sw.workplaceId = swf.workPlaceIdFk
left join sys_workplace_layer swl on swl.freightCode = swf.code
<where>
<if test="key != null and key != ''">
AND (
swf.code like concat('%', #{key}, '%')
or swf.name like concat('%', #{key}, '%')
)
</if>
<if test=" workPlaceIdFk != null and workPlaceIdFk != ''">
AND swf.workPlaceIdFk = #{workPlaceIdFk}
</if>
</where>
GROUP BY
swf.id
</select>
<select id="getList" resultType="com.glxp.api.res.basic.SysWorkplaceFreightPrintResponse">
select swf.*,
sw.workplaceName workPlaceName,
swq.code queueCode,
swl.code layerCode,
swl.queueNum
from sys_workplace_freight swf
left join sys_workplace sw on sw.workplaceId = swf.workPlaceIdFk
left join sys_workplace_layer swl on swl.freightCode = swf.code
left join sys_workplace_queue swq on swq.layerCode = swl.code
<where>
<if test=" layerCode != null and layerCode != ''">
AND swl.code = #{layerCode}
</if>
<if test=" queueCode != null and queueCode != ''">
AND swq.code = #{queueCode}
</if>
</where>
order by swf.code,swl.code, swq.code
</select>
</mapper>