wlzboy
昨天 f08739f46afe856f60ebb1d21ab23d72947629ed
ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
@@ -86,6 +86,11 @@
            <if test="taskCode != null  and taskCode != ''"> and t.task_code like concat('%', #{taskCode}, '%')</if>
            <if test="taskType != null  and taskType != ''"> and t.task_type = #{taskType}</if>
            <if test="taskStatus != null  and taskStatus != ''"> and t.task_status = #{taskStatus}</if>
            <if test="taskStatusList != null and taskStatusList != ''"> and t.task_status in
                <foreach collection="taskStatusList.split(',')" item="status" open="(" separator="," close=")">
                    #{status}
                </foreach>
            </if>
            <if test="vehicleNo != null  and vehicleNo != ''"> and v.vehicle_no like concat('%', #{vehicleNo}, '%')</if>
            <!-- 综合查询:当前用户所在机构 OR 当前用户创建 OR 分配给当前用户 -->
            <if test="(creatorId != null and creatorId != 0) or (assigneeId != null and assigneeId != 0) or (deptId != null and deptId != 0) or (deptIds != null and deptIds.size() > 0)">
@@ -186,6 +191,19 @@
            t.create_time desc
    </select>
    <select id="selectTaskByVehicleIdAndDate" resultMap="SysTaskResult">
        select tv.task_id, t.actual_start_time,
        IFNULL(t.actual_end_time, NOW()) as actual_end_time
        from sys_task_vehicle tv
        inner join sys_task t on tv.task_id = t.task_id
        where tv.vehicle_id = #{vehicleId}
        and t.del_flag = '0'
        and (
        (t.actual_start_time &lt;= #{endTime} and (t.actual_end_time is null or t.actual_end_time &gt;= #{startTime}))
        )
        order by t.actual_start_time
    </select>
    <select id="selectTaskStatistics" resultType="TaskStatisticsVO">
        select 
            count(*) as totalTasks,
@@ -247,6 +265,7 @@
            <if test="creatorId != null">#{creatorId},</if>
            <if test="assigneeId != null">#{assigneeId},</if>
            <if test="deptId != null">#{deptId},</if>
            <if test="isHeadPush != null">#{isHeadPush},</if>
            <if test="createTime != null">#{createTime},</if>
            now(),
            <if test="createBy != null">#{createBy},</if>
@@ -276,7 +295,6 @@
            <if test="actualEndTime != null">actual_end_time = #{actualEndTime},</if>
            <if test="creatorId != null">creator_id = #{creatorId},</if>
            <if test="assigneeId != null">assignee_id = #{assigneeId},</if>
            <if test="deptId != null">dept_id = #{deptId},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>