|
|
@@ -148,6 +148,37 @@
|
|
|
<if test="entity.isManualScore != null and entity.isManualScore != ''">
|
|
|
AND a.is_manual_score = #{entity.isManualScore}
|
|
|
</if>
|
|
|
+ <!-- 审核状态筛选 -->
|
|
|
+ <if test="entity.auditStatus != null and entity.auditStatus != ''">
|
|
|
+ AND a.audit_status = #{entity.auditStatus}
|
|
|
+ </if>
|
|
|
+ <!-- 所属人筛选(支持ID精确匹配或姓名模糊查询) -->
|
|
|
+ <if test="entity.ownerUserId != null and entity.ownerUserId != ''">
|
|
|
+ AND COALESCE(a.submit_audit_user_id, a.create_by) = #{entity.ownerUserId}
|
|
|
+ </if>
|
|
|
+ <if test="entity.ownerUserName != null and entity.ownerUserName != ''">
|
|
|
+ AND EXISTS (
|
|
|
+ SELECT 1 FROM sys_user u
|
|
|
+ WHERE u.id = COALESCE(a.submit_audit_user_id, a.create_by)
|
|
|
+ AND u.name LIKE CONCAT('%', #{entity.ownerUserName}, '%')
|
|
|
+ AND u.del_flag = '0'
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <!-- 所属人部门筛选(支持ID精确匹配或部门名称模糊查询) -->
|
|
|
+ <if test="entity.ownerOfficeId != null and entity.ownerOfficeId != ''">
|
|
|
+ AND COALESCE(a.submit_audit_user_id, a.create_by) IN (
|
|
|
+ SELECT u.id FROM sys_user u WHERE u.office_id = #{entity.ownerOfficeId} AND u.del_flag = '0'
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="entity.ownerOfficeName != null and entity.ownerOfficeName != ''">
|
|
|
+ AND EXISTS (
|
|
|
+ SELECT 1 FROM sys_user u
|
|
|
+ INNER JOIN sys_office o ON u.office_id = o.id
|
|
|
+ WHERE u.id = COALESCE(a.submit_audit_user_id, a.create_by)
|
|
|
+ AND o.name LIKE CONCAT('%', #{entity.ownerOfficeName}, '%')
|
|
|
+ AND u.del_flag = '0' AND o.del_flag = '0'
|
|
|
+ )
|
|
|
+ </if>
|
|
|
<!-- 动态字段查询条件:EXISTS 子查询(禁止写在主WHERE中) -->
|
|
|
<if test="dynamicConditions != null">
|
|
|
<foreach collection="dynamicConditions" index="fieldId" item="queryVal">
|
|
|
@@ -219,6 +250,37 @@
|
|
|
<if test="entity.isManualScore != null and entity.isManualScore != ''">
|
|
|
AND a.is_manual_score = #{entity.isManualScore}
|
|
|
</if>
|
|
|
+ <!-- 审核状态筛选 -->
|
|
|
+ <if test="entity.auditStatus != null and entity.auditStatus != ''">
|
|
|
+ AND a.audit_status = #{entity.auditStatus}
|
|
|
+ </if>
|
|
|
+ <!-- 所属人筛选(支持ID精确匹配或姓名模糊查询) -->
|
|
|
+ <if test="entity.ownerUserId != null and entity.ownerUserId != ''">
|
|
|
+ AND COALESCE(a.submit_audit_user_id, a.create_by) = #{entity.ownerUserId}
|
|
|
+ </if>
|
|
|
+ <if test="entity.ownerUserName != null and entity.ownerUserName != ''">
|
|
|
+ AND EXISTS (
|
|
|
+ SELECT 1 FROM sys_user u
|
|
|
+ WHERE u.id = COALESCE(a.submit_audit_user_id, a.create_by)
|
|
|
+ AND u.name LIKE CONCAT('%', #{entity.ownerUserName}, '%')
|
|
|
+ AND u.del_flag = '0'
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <!-- 所属人部门筛选(支持ID精确匹配或部门名称模糊查询) -->
|
|
|
+ <if test="entity.ownerOfficeId != null and entity.ownerOfficeId != ''">
|
|
|
+ AND COALESCE(a.submit_audit_user_id, a.create_by) IN (
|
|
|
+ SELECT u.id FROM sys_user u WHERE u.office_id = #{entity.ownerOfficeId} AND u.del_flag = '0'
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="entity.ownerOfficeName != null and entity.ownerOfficeName != ''">
|
|
|
+ AND EXISTS (
|
|
|
+ SELECT 1 FROM sys_user u
|
|
|
+ INNER JOIN sys_office o ON u.office_id = o.id
|
|
|
+ WHERE u.id = COALESCE(a.submit_audit_user_id, a.create_by)
|
|
|
+ AND o.name LIKE CONCAT('%', #{entity.ownerOfficeName}, '%')
|
|
|
+ AND u.del_flag = '0' AND o.del_flag = '0'
|
|
|
+ )
|
|
|
+ </if>
|
|
|
<!-- 动态字段查询条件:EXISTS 子查询 -->
|
|
|
<if test="dynamicConditions != null">
|
|
|
<foreach collection="dynamicConditions" index="fieldId" item="queryVal">
|