| | |
| | | left join sys_company sc on sc.company_id = scd.company_id |
| | | where su.user_id = #{userId} and su.is_use = 1 |
| | | </select> |
| | | |
| | | <select id="queryAllProLine" resultType="hashmap"> |
| | | select pro_line_id as proLineId,pro_line_name as proLineName from t_pro_line |
| | | </select> |
| | | |
| | | <select id="queryProLineNameById" resultType="string"> |
| | | select pro_line_name as proLineName from t_pro_line where pro_line_id = #{proLineId}, |
| | | </select> |
| | | |
| | | <select id="countTodayLinePlanByLineId" resultType="int"> |
| | | select count(id) |
| | | from t_pro_line_plan plp |
| | | where plp.pro_line_id = #{proLineId} and sysdate() >= plp.set_day_start and sysdate() <= plp.set_day_end |
| | | </select> |
| | | |
| | | <select id="checkPipeExitsByRingNums" resultType="string"> |
| | | select group_cancat(a.ringNum) as ringnums |
| | | (select DISTINCT ring_num as ringNum,1 as wl |
| | | from t_pipe_info |
| | | <where> |
| | | <foreach open="ring_num in (" separator="," close=")" collection="ringNumList" item="ringnum" index="ri"> |
| | | #{ringnum} |
| | | </foreach> |
| | | </where> |
| | | ) a |
| | | group by a.wl |
| | | </select> |
| | | |
| | | <select id="checkPlanExitsByRingNums" resultType="string"> |
| | | select group_cancat(a.ringNum) as ringnums |
| | | (select DISTINCT ring_num as ringNum,1 as wl |
| | | from t_pro_line_plan |
| | | <where> |
| | | <trim suffixOverrides="and"> |
| | | <foreach open="ring_num in (" separator="," close=") and" collection="ringNumList" item="ringnum" index="ri"> |
| | | #{ringnum} |
| | | </foreach> |
| | | pro_line_id != #{proLineId} and |
| | | sysdate() >= set_day_start and sysdate() <= set_day_end and |
| | | </trim> |
| | | </where> |
| | | ) a |
| | | group by a.wl |
| | | </select> |
| | | |
| | | <insert id="insertProLinePlan"> |
| | | insert into t_pro_line_plan |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id !=null and id !=''"> |
| | | id, |
| | | </if> |
| | | <if test="proLineId !=null and proLineId !=''"> |
| | | pro_line_id, |
| | | </if> |
| | | <if test="setDayStart != null"> |
| | | set_day_start, |
| | | </if> |
| | | <if test="setDayEnd != null"> |
| | | set_day_end, |
| | | </if> |
| | | <if test="ringNum != null and ringNum !=''"> |
| | | ring_num, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id !=null and id !=''"> |
| | | #{id}, |
| | | </if> |
| | | <if test="proLineId !=null and proLineId !=''"> |
| | | #{proLineId}, |
| | | </if> |
| | | <if test="setDayStart != null"> |
| | | #{setDayStart}, |
| | | </if> |
| | | <if test="setDayEnd != null"> |
| | | #{setDayEnd}, |
| | | </if> |
| | | <if test="ringNum != null and ringNum !=''"> |
| | | #{ringNum}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | </mapper> |