| | |
| | | enterprise.enterprise_name, |
| | | enterprise.legal_person |
| | | from sys_application app |
| | | LEFT JOIN sys_application_car car ON car.application_id = app.id |
| | | LEFT JOIN sys_application_car car ON car.application_id = app.id AND car.status = 1 |
| | | LEFT JOIN sys_application_goods goods ON goods.application_id = app.id |
| | | LEFT JOIN sys_enterprise enterprise ON enterprise.user_id = app.user_id AND enterprise.is_deleted = 0 |
| | | where app.is_deleted = 0 |
| | | <if test="application.userId != null and application.userId !='' "> |
| | | AND app.user_id = #{application.userId} |
| | | </if> |
| | | ORDER BY app.no DESC |
| | | </select> |
| | | <select id="getMaxNoEntity" resultType="org.springblade.modules.application.entity.ApplicationEntity"> |
| | | SELECT * from sys_application where is_deleted = 0 ORDER BY create_time DESC LIMIT 1 |
| | |
| | | <select id="getByNo" resultType="org.springblade.modules.application.entity.ApplicationEntity"> |
| | | SELECT * FROM sys_application WHERE is_deleted = 0 AND no = #{no} |
| | | </select> |
| | | <select id="getAll" resultType="org.springblade.modules.application.vo.ApplicationVO"> |
| | | SELECT app.*,basic.end_pass_time, |
| | | ( |
| | | CASE |
| | | WHEN car.trailer_license IS NOT NULL |
| | | THEN CONCAT( car.car_license, car.trailer_license ) |
| | | ELSE car.car_license |
| | | END) licensePlate |
| | | FROM sys_application app |
| | | LEFT JOIN sys_application_basic_info basic ON basic.application_id = app.id |
| | | LEFT JOIN sys_application_car car ON car.application_id = app.id AND car.status = 1 |
| | | LEFT JOIN sys_pass pass ON pass.no = app.no AND pass.is_deleted = 0 |
| | | WHERE app.is_deleted = 0 |
| | | <if test="application.userId !=null and application.userId !=''"> |
| | | AND app.user_id = #{application.userId} |
| | | </if> |
| | | <if test="application.status !=null and application.status !=''"> |
| | | AND app.status = #{application.status} |
| | | </if> |
| | | <if test="application.passStatus != null and application.passStatus !=''"> |
| | | AND pass.status = #{application.passStatus} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |