无关风月
2025-06-06 f770f08c09b6e622242a73550b31b273f92e3444
ruoyi-system/src/main/resources/mapper/system/TTaskMapper.xml
@@ -24,5 +24,40 @@
    <sql id="Base_Column_List">
        id, create_time, update_time, create_by, update_by, disabled, project_id, status, cleaner_id, location_id, patrol_inspector, implement_time, task_type, patrol_inspector_dept
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.system.LocationListTaskVO">
        select t1.*,t2.location_name as locationName,t3.location_name as locationTypeName,
               t4.nick_name as patrolInspectorName,
               t4.phonenumber as phonenumber
               from t_task t1
        left join t_location t2 on t1.location_id = t2.id
        left join t_location_type t3 on t2.location_type = t3.id
        left join sys_user t4 on t1.patrol_inspector = t4.user_id
        where 1=1
        and t1.`disabled` = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        <if test="query.patrolInspectorIds != null and query.patrolInspectorIds.size()>0">
            AND t4.user_id IN
            <foreach collection="query.patrolInspectorIds" separator="," item="id" open="(" close=")">
                #{id}
            </foreach>
        </if>
          <if test="query.taskIds != null and query.taskIds.size()>0">
            AND t1.id IN
            <foreach collection="query.taskIds" separator="," item="id" open="(" close=")">
                #{id}
            </foreach>
        </if>
          <if test="query.locationIds != null and query.locationIds.size()>0">
            AND t1.location_id IN
            <foreach collection="query.locationIds" separator="," item="id" open="(" close=")">
                #{id}
            </foreach>
        </if>
        <if test="query.status != null">
            and t1.status = #{query.status}
        </if>
        <if test="query.startTime != null and startTime != ''">
            and (t1.implement_time between #{startTime} and #{endTime})
        </if>
    </select>
</mapper>