<?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.qianwen.smartman.modules.smis.mapper.TrayMapper">
|
|
|
<select id="groupTray" resultType="com.qianwen.smartman.modules.smis.vo.TrayTreeVO">
|
select bt.id,
|
bt.code,
|
bt.name,
|
bcg.id parentId,
|
0 as isGroup
|
from blade_tray bt
|
LEFT JOIN blade_common_group_of_item bcgoi ON bt.id = bcgoi.item_id
|
LEFT JOIN blade_common_group bcg on bcgoi.group_id = bcg.id and bcg.is_deleted = 0
|
where bt.is_deleted = 0
|
</select>
|
|
<select id="unUsedGroupTray" resultType="com.qianwen.smartman.modules.smis.vo.TrayTreeVO">
|
select bt.id,
|
bt.code,
|
bt.name,
|
bcg.id parentId,
|
0 as isGroup
|
from blade_tray bt
|
LEFT JOIN blade_common_group_of_item bcgoi ON bt.id = bcgoi.item_id
|
LEFT JOIN blade_common_group bcg on bcgoi.group_id = bcg.id and bcg.is_deleted = 0
|
where bt.is_deleted = 0
|
and bt.in_use = 0
|
</select>
|
|
<select id="removeFaceFixture" resultType="java.lang.Integer">
|
select count(*)
|
from blade_fixture bf
|
where bf.is_deleted = 0
|
and exists(select *
|
from prod_craft_process_ref_fixture bpcprf
|
where bpcprf.fixture_id = bf.id
|
and exists(select *
|
from blade_tray_fixture btf
|
where bpcprf.fixture_id = btf.fix_id
|
and btf.is_deleted = 0
|
and btf.tray_id in
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>)
|
)
|
</select>
|
|
</mapper>
|