| | |
| | | COUNT(CASE WHEN r.field_situation = 1 THEN 1 END) AS noTraffic, |
| | | COUNT(CASE WHEN r.field_situation = 2 THEN 1 END) AS traffic |
| | | FROM xp_cruise_check_in_record r |
| | | LEFT JOIN xp_cruise_check_in_rule cr ON r.cruise_check_in_rule_id = cr.id AND cr.del_flag = '0' |
| | | LEFT JOIN xp_operations_user u ON r.operations_user_id = u.id AND u.del_flag = '0' |
| | | LEFT JOIN xp_fleet_operations fo ON u.id = fo.operationsUserId |
| | | LEFT JOIN xp_fleet f ON fo.fleetId = f.id |
| | | WHERE r.del_flag = '0' |
| | | AND r.check_in_time IS NOT NULL |
| | | <if test="query.ruleName != null and query.ruleName != ''"> |
| | | AND cr.name LIKE CONCAT('%', #{query.ruleName}, '%') |
| | | </if> |
| | | <if test="query.fleet != null and query.fleet != ''"> |
| | | AND f.fleet_name LIKE CONCAT('%', #{query.fleet}, '%') |
| | | </if> |
| | | <if test="query.startDate != null"> |
| | | AND DATE(r.check_in_time) >= #{query.startDate} |
| | | </if> |