| | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightReportError"> |
| | | <id property="lightReportErrorId" column="light_report_error_id" jdbcType="BIGINT"/> |
| | | <result property="deviceCode" column="device_code" jdbcType="VARCHAR"/> |
| | | <result property="lightAddress" column="light_address" jdbcType="VARCHAR"/> |
| | | <result property="errorCode" column="error_code" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | |
| | | AND t2.device_type = 0 |
| | | LEFT JOIN pole t3 ON t3.id = t2.pole_id |
| | | <where> |
| | | t1.error_code != 0 |
| | | <if test="keyword != null and keyword != ''"> |
| | | AND ( |
| | | t3.id LIKE CONCAT('%', #{keyword},'%') |
| | | OR t3.pole_name LIKE CONCAT('%', #{keyword},'%') |
| | | OR t1.error_code LIKE CONCAT('%', #{keyword},'%') |
| | | OR t1.device_code LIKE CONCAT('%', #{keyword},'%') |
| | | ) |
| | | </if> |
| | | <if test="userid != null"> |
| | |
| | | </where> |
| | | ORDER BY t1.light_report_error_id DESC |
| | | </select> |
| | | <select id="listError" resultType="com.sandu.ximon.dao.bo.LightReportErrorBo" |
| | | parameterType="java.lang.Long"> |
| | | SELECT |
| | | t1.* |
| | | FROM |
| | | light_report_error t1 |
| | | LEFT JOIN pole t3 ON t1.device_code = t3.device_code |
| | | WHERE |
| | | <if test="userid != null"> |
| | | t3.client_id = #{userId} OR t3.user_id = #{userId} |
| | | </if> |
| | | t1.light_report_error_id IN ( SELECT t.max_id FROM ( SELECT Max( light_report_error.light_report_error_id ) AS |
| | | max_id FROM light_report_error GROUP BY light_report_error.device_code ) AS t ) |
| | | ORDER BY |
| | | t1.create_time DESC |
| | | </select> |
| | | </mapper> |