| | |
| | | |
| | | |
| | | <select id="query" resultType="map"> |
| | | select * from |
| | | ( |
| | | select |
| | | aa.*, |
| | | (CASE WHEN (select count(id) from t_driver_activity_history where driverId = #{driverId} and carryOut = 1 and `day` = aa.time) = 0 THEN 2 ELSE 1 END) carryOut |
| | | from ( |
| | | select |
| | | DATE_FORMAT(`day`, '%Y-%m-%d') as time, |
| | | if((select count(id) from t_driver_activity_history where driverId = #{driverId}) > (select count(id) from t_driver_activity_history where driverId = #{driverId} and carryOut = 2), 1, 2) as carryOut |
| | | DATE_FORMAT(`day`, '%Y-%m-%d') as paramTime |
| | | from t_driver_activity_history where driverId = #{driverId} group by `day` |
| | | ) as a order by a.time desc limit #{pageNum}, #{size} |
| | | ) as aa order by aa.time desc limit #{pageNum}, #{size} |
| | | </select> |
| | | |
| | | <select id="queryList" resultType="DriverActivityHistory"> |