| | |
| | | where arc.factory_id=#{factoryId}; |
| | | </select> |
| | | |
| | | <select id="queryUserAndonCallList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO"> |
| | | select arc.id, |
| | | abc.id as buttonId, |
| | | abc.button_name as buttonName, |
| | | abc.button_code as buttonCode, |
| | | (select count(1) |
| | | from andon_order ao |
| | | where ao.button_id = arc.button_id |
| | | and ao.factory_id = arc.factory_id |
| | | and ao.order_status = '1') as blinkingFlag, |
| | | STUFF((SELECT ',' + CAST (ao.id AS VARCHAR) |
| | | FROM andon_order ao |
| | | WHERE ao.button_id = arc.button_id |
| | | and ao.factory_id = arc.factory_id |
| | | and ao.order_status = '1' |
| | | FOR XML PATH ('')), 1, 1, '') as orderIds, |
| | | bf.factory_name as factoryName, |
| | | parent_bf.factory_name as parentFactoryName, |
| | | abc.upgrade_response_duration as upgradeResponseDuration, |
| | | abc.second_upgrade_response_duration as secondUpgradeResponseDuration, |
| | | arc.firster_responder as responder, |
| | | arc.second_responder, |
| | | arc.third_responder, |
| | | STUFF((SELECT ',' + ao.order_status |
| | | FROM andon_order ao |
| | | WHERE ao.button_id = arc.button_id |
| | | and ao.factory_id = arc.factory_id |
| | | and ao.order_status = '1' |
| | | FOR XML PATH ('')), 1, 1, '') as orderStatus |
| | | from andon_response_config arc |
| | | left join andon_button_config abc |
| | | on arc.button_id = abc.id |
| | | left join base_factory bf on arc.factory_id = bf.id |
| | | left join base_factory parent_bf on bf.parent_id = parent_bf.id |
| | | where arc.factory_id=#{factoryId} |
| | | and (select count (1) |
| | | from andon_order ao |
| | | where ao.button_id = arc.button_id |
| | | and ao.factory_id = arc.factory_id |
| | | and ao.order_status = '1') = 1 |
| | | <select id="queryUserAndonCallList" resultType="org.jeecg.modules.andon.dto.AndonOrdeDto"> |
| | | SELECT |
| | | ao.*, |
| | | bf.factory_name as factoryName, |
| | | parent_bf.factory_name as parentFactoryName, |
| | | abc.button_name as buttonName, |
| | | abc.upgrade_response_duration as upgradeResponseDuration, |
| | | abc.second_upgrade_response_duration as secondUpgradeResponseDuration, |
| | | su.username as operatorName |
| | | FROM andon_order ao |
| | | LEFT JOIN base_factory bf ON ao.factory_id = bf.id |
| | | LEFT JOIN base_factory parent_bf ON bf.parent_id = parent_bf.id |
| | | LEFT JOIN andon_button_config abc ON ao.button_id = abc.id |
| | | LEFT JOIN sys_user su ON ao.operator = su.id |
| | | WHERE ao.factory_id = #{factoryId} |
| | | AND ao.del_flag = 0 |
| | | AND ao.order_status = #{orderStatus} |
| | | </select> |
| | | |
| | | <select id="queryUserAndonRespondList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO"> |
| | | <select id="queryUserAndonRespondList" resultType="org.jeecg.modules.andon.dto.AndonOrdeDto"> |
| | | select arc.id, |
| | | abc.id as buttonId, |
| | | abc.button_name as buttonName, |