fuliqi
2024-07-23 9a1843b565b97326c78b2e41fc6b7953f5af84d9
ycl-server/src/main/resources/mapper/zgyw/ReportMapper.xml
@@ -21,22 +21,22 @@
        r.*, u.unit_name, p.yw_person_name as peopleName, pt.point_name
        FROM
        t_report r
        LEFT JOIN t_yw_unit u ON r.unit_id = u.id and u.deleted = '0'
        LEFT JOIN t_yw_people p ON r.people_id = p.id and p.deleted = '0'
        LEFT JOIN t_yw_point pt ON r.point_id = pt.id and pt.deleted = '0'
        LEFT JOIN t_yw_unit u ON r.unit_id = u.id and u.deleted = 0
        LEFT JOIN t_yw_people p ON r.people_id = p.id and p.deleted = 0
        LEFT JOIN t_yw_point pt ON r.point_id = pt.id and pt.deleted = 0
        where
        r.deleted = '0'
        <if test="reportType != null and reportType != ''">
            AND r.report_type = #{reportType}
        r.deleted = 0
        <if test="query.reportType != null and query.reportType != ''">
            AND r.report_type = #{query.reportType}
        </if>
        <if test="beginCreateTime != null">
            AND r.create_time between #{beginCreateTime} and #{endCreateTime}
        <if test="query.beginCreateTime != null">
            AND r.create_time between #{query.beginCreateTime} and #{query.endCreateTime}
        </if>
        <if test="pointId != null and pointId != ''">
            AND pt.point_name like concat('%', #{pointId}, '%')
        <if test="query.pointId != null and query.pointId != ''">
            AND pt.point_name like concat('%', #{query.pointId}, '%')
        </if>
        <if test="peopleId != null and peopleId != ''">
            AND p.yw_person_name like concat('%', #{peopleId}, '%')
        <if test="query.peopleId != null and query.peopleId != ''">
            AND p.yw_person_name like concat('%', #{query.peopleId}, '%')
        </if>
        ORDER BY r.create_time DESC
    </select>