<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yfd.platform.modules.patroltask.mapper.TaskMapper">
    <select id="getTaskList" resultType="java.util.Map">
        SELECT t.*,s.is_station_flag,s.station_id FROM `iis_task` t left join iis_substation s on t.station_code=s.station_code
        WHERE s.station_id = #{stationId}
        and t.datastatus != '3'
        <if test="startDate != null and startDate != ''">
            and str_to_date(t.fixed_start_time, '%Y-%m-%d') &gt;= #{startDate}
        </if>
        <if test="endDate != null and endDate != ''">
            and str_to_date(t.fixed_start_time, '%Y-%m-%d') &lt;= #{endDate}
        </if>
        <if test="enable != null and enable != ''">
            and t.isenable = #{enable}
        </if>
        <if test="type != null and type != ''">
            and t.type = #{type}
        </if>
        <if test="taskName != null and taskName != ''">
            and t.task_name like concat('%',#{taskName},'%')
        </if>
        <if test="taskType != null and taskType != ''">
            and t.task_type = #{taskType}
        </if>
        <if test="taskTodoType != null and taskTodoType != ''">
            and t.task_todo_type = #{taskTodoType}
        </if>
        ORDER BY t.task_type,t.task_code
    </select>
</mapper>
