| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdAppPatrolplanVo"> |
| | | select patro_end_time, user_id, cycle, create_time, id, plan_name, patro_begin_time from ard_app_patrolplan |
| | | select |
| | | ard_app_patrolplan.id, |
| | | ard_app_patrolplan.patro_end_time, |
| | | ard_app_patrolplan.user_id, |
| | | ard_app_patrolplan.cycle, |
| | | ard_app_patrolplan.create_time, |
| | | ard_app_patrolplan.plan_name, |
| | | ard_app_patrolplan.patro_begin_time |
| | | from |
| | | ard_app_patrolplan |
| | | </sql> |
| | | |
| | | <select id="selectArdAppPatrolplanList" parameterType="ArdAppPatrolplan" resultMap="ArdAppPatrolplanResult"> |
| | | <include refid="selectArdAppPatrolplanVo"/> |
| | | left join ard_app_patrolpoint as well on ard_app_patrolplan.id = well.patrolplan_id |
| | | left join ard_app_patroluser as users on ard_app_patrolplan.id = users.patrolplan_id |
| | | <where> |
| | | <if test="userId != null and userId != ''"> and user_id = #{userId}</if> |
| | | <if test="cycle != null and cycle != ''"> and cycle = #{cycle}</if> |
| | | <if test="planName != null and planName != ''"> and plan_name like '%'||#{planName}||'%'</if> |
| | | <if test="patroBeginTime != null and patroBeginTime != ''"> and patro_begin_time >= #{patroBeginTime}</if> |
| | | <if test="patroEndTime != null and patroEndTime != ''"> and patro_end_time <= #{patroEndTime}</if> |
| | | <if test="wellId != null and wellId != ''"> |
| | | and well.alarmpoints_id = (select id from ard_alarmpoints_well where well_id = #{wellId}) |
| | | </if> |
| | | <if test="pUser != null and pUser != ''"> |
| | | and users.app_user_id = (select user_id from sys_user where nick_name = #{pUser}) |
| | | </if> |
| | | </where> |
| | | group by ard_app_patrolplan.id |
| | | </select> |
| | | |
| | | <select id="selectArdAppPatrolplanByPatroEndTime" parameterType="String" resultMap="ArdAppPatrolplanResult"> |