| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper"> |
| | | |
| | | <select id="querySitToUpGlass" resultType="java.lang.String"> |
| | | <resultMap id="bigStorageDTO" type="com.mes.bigstorage.entity.BigStorageDTO"> |
| | | <result column="REMAIN_WIDTH" property="width"/> |
| | | <result column="GLASS_COUNT" property="glassCount"/> |
| | | </resultMap> |
| | | |
| | | <select id="querySitToUpGlass" resultType="java.lang.Integer"> |
| | | select t.line |
| | | from ( |
| | | select line, |
| | |
| | | SUM(case task_state when 2 then 1 else 0 end) as real_count |
| | | from big_storage_cage_feed_task |
| | | where task_state in (1, 2) |
| | | and target_slot is null |
| | | group by line |
| | | ) t |
| | | where t.total_count = t.real_count |
| | | </select> |
| | | <select id="querySitToUpRemainWidth" resultMap="bigStorageDTO"> |
| | | SELECT cast(5000 - sum(width + 20) as INT) as REMAIN_WIDTH, |
| | | count(glass_id) as GLASS_COUNT |
| | | FROM big_storage_cage_feed_task |
| | | WHERE line = #{line} |
| | | AND task_state in (1, 2) |
| | | </select> |
| | | |
| | | </mapper> |