| | |
| | | atl.lock_name as "lockName" from ard_sy_car "asc" |
| | | inner join ard_tank_lock atl on "asc".car_id = atl.car_id |
| | | inner join ard_tank_lock_password atlp on atl.id = atlp.lock_id |
| | | where "asc".car_id = #{carId} order by "asc".car_id asc,use_time asc,no asc |
| | | inner join (select atlp.lock_id,max(create_time) as create_time |
| | | from ard_tank_lock_password atlp group by lock_id)t |
| | | on atlp.lock_id = t.lock_id and atlp.create_time = t.create_time |
| | | where "asc".car_id = #{carId} order by "asc".car_id asc,use_time desc,no asc |
| | | </select> |
| | | |
| | | <select id="selectLockPasswordTotalByCarId" parameterType="java.lang.String" resultType="java.lang.Long"> |
| | | select count(*) from ard_sy_car "asc" |
| | | inner join ard_tank_lock atl on "asc".car_id = atl.car_id |
| | | inner join ard_tank_lock_password atlp on atl.id = atlp.lock_id |
| | | inner join (select atlp.lock_id,max(create_time) as create_time |
| | | from ard_tank_lock_password atlp group by lock_id)t |
| | | on atlp.lock_id = t.lock_id and atlp.create_time = t.create_time |
| | | where "asc".car_id = #{carId} |
| | | </select> |
| | | </mapper> |