Commit c88a377be048d89aeafc86e487572ee22f041851
1 parent
9a3a800a
fix: resolve sql query error
Showing
1 changed file
with
8 additions
and
4 deletions
ruoyi-admin/src/main/resources/mapper/equipment/EquipmentMapper.xml
| ... | ... | @@ -52,10 +52,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 52 | 52 | </select> |
| 53 | 53 | <select id="querySignListByJobCode" resultType="com.ruoyi.pojo.domain.EquipmentDriverExpand"> |
| 54 | 54 | select * from driver_face_device_id |
| 55 | - where job_code in | |
| 56 | - <foreach collection="drivers" item="item" open="(" separator="," close=")"> | |
| 57 | - #{item.jobCode} | |
| 58 | - </foreach> | |
| 55 | + where 1=1 | |
| 56 | + <if test="drivers != null and drivers.size() > 0"> | |
| 57 | + and job_code in | |
| 58 | + <foreach collection="drivers" item="item" open="(" separator="," close=")"> | |
| 59 | + #{item.jobCode} | |
| 60 | + </foreach> | |
| 61 | + </if> | |
| 62 | + | |
| 59 | 63 | </select> |
| 60 | 64 | |
| 61 | 65 | ... | ... |