feat(car): 更新车辆查询支持组织ID列表筛选
- 添加 organizationIds 参数支持多组织ID筛选 - 实现 IN 查询逻辑替代原有的单个组织ID匹配 - 保留原有 organizationId 单值查询作为备选条件 - 添加 foreach 循环处理组织ID集合 - 优化查询条件避免参数冲突
This commit is contained in:
@@ -25,7 +25,13 @@
|
|||||||
<if test="param.type != null">
|
<if test="param.type != null">
|
||||||
AND a.type = #{param.type}
|
AND a.type = #{param.type}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.organizationId != null">
|
<if test="param.organizationIds != null and param.organizationIds.size > 0">
|
||||||
|
AND a.organization_id IN
|
||||||
|
<foreach collection="param.organizationIds" item="orgId" open="(" close=")" separator=",">
|
||||||
|
#{orgId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="param.organizationId != null and (param.organizationIds == null or param.organizationIds.size == 0)">
|
||||||
AND a.organization_id = #{param.organizationId}
|
AND a.organization_id = #{param.organizationId}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.organizationParentId != null">
|
<if test="param.organizationParentId != null">
|
||||||
|
|||||||
Reference in New Issue
Block a user