| | |
| | | <mapper namespace="com.sandu.ximon.dao.mapper.LightTaskPoleRelationMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightTaskPoleRelation"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="taskId" column="task_id" jdbcType="BIGINT"/> |
| | | <result property="poleId" column="pole_id" jdbcType="BIGINT"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="taskId" column="task_id" jdbcType="BIGINT"/> |
| | | <result property="poleId" column="pole_id" jdbcType="BIGINT"/> |
| | | <result property="lightAddress" column="light_address" jdbcType="VARCHAR"/> |
| | | <result property="deviceCode" column="device_code" jdbcType="VARCHAR"/> |
| | | <result property="sysScheduled" column="sys_scheduled" jdbcType="VARCHAR"/> |
| | | <result property="deviceScheduled" column="device_scheduled" jdbcType="VARCHAR"/> |
| | | <result property="issueStatus" column="issue_status" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,task_id,pole_id, |
| | | create_time,update_time |
| | | id |
| | | ,task_id,pole_id, |
| | | issue_status,create_time,update_time |
| | | </sql> |
| | | <select id="listPoleAndStatusIdByTaskId" resultType="com.sandu.ximon.dao.bo.LightTaskStatusAndPole"> |
| | | SELECT |
| | | t1.issue_status, |
| | | t2.* |
| | | FROM |
| | | light_task_pole_relation t1 |
| | | LEFT JOIN pole t2 ON t1.pole_id = t2.id |
| | | <where> |
| | | t1.task_id = #{taskId} |
| | | </where> |
| | | GROUP BY t2.id |
| | | </select> |
| | | |
| | | <select id="test" resultType="com.sandu.ximon.dao.bo.LightTaskPoleRelationBo"> |
| | | SELECT |
| | | t1.*, |
| | | t2.user_id, t2.client_id, |
| | | t3.task_name, t3.week, t3.open_order, t3.close_order, t3.control_order, t3.light_adress |
| | | FROM |
| | | light_task_pole_relation t1 |
| | | LEFT JOIN pole t2 ON t1.pole_id = t2.id |
| | | LEFT JOIN light_task t3 ON t3.task_id = t1.task_id |
| | | <where> |
| | | t1.issue_status=0 |
| | | AND |
| | | t1.task_id IN |
| | | <foreach collection="taskIdList" open="(" close=")" separator="," item="task_id"> |
| | | #{task_id} |
| | | </foreach> |
| | | </where> |
| | | </select> |
| | | </mapper> |