Ver código fonte

编辑区域时修改区域主管,并更改项目关联的区域主管信息时,bug修复

wang-hai-cheng 5 anos atrás
pai
commit
be9e98f394

+ 10 - 7
lift-common/src/main/java/cn.com.ty.lift.common/constants/SqlConstants.java

@@ -169,11 +169,14 @@ public interface SqlConstants {
                     "  and project_id in (select project_id from project_user where user_id = #{userId})";
 
     String UPDATE_REGION_DIRECTOR =
-            "<script>"
-                    + "update project_user set user_id=#{userId} where project_id in"
-                    + " <foreach item='item' index='index' collection='projectIds' open='(' separator=',' close=')'>"
-                    + "        #{item}"
-                    + "  </foreach>"
-                    + "and mt_company_id=#{mtCompanyId} and user_role = 'REGION_DIRECTOR'"
-                    + "</script>";
+            "<script>" +
+                    " update project_user set user_id=#{userId} where " +
+                    " mt_company_id=#{mtCompanyId} and user_role = 'REGION_DIRECTOR'" +
+                    "   <if test=\"projectIds != null and projectIds.size > 0 \">" +
+                    "           and project_id in" +
+                    "     <foreach item='item' index='index' collection='projectIds' open='(' separator=',' close=')'>" +
+                    "        #{item}" +
+                    "     </foreach>" +
+                    " </if>" +
+                    "</script>";
 }