Преглед на файлове

修改协定方使用权限搜索

zjh преди 2 години
родител
ревизия
f2a63369cf

+ 7 - 3
cbkj_web_api/src/main/resources/application.properties

@@ -3,17 +3,21 @@ server.port=88
 #\u6570\u636E\u5E93\u914D\u7F6E
 spring.datasource.primary.username = DgUfz0nYLCR7UJ66sgG1ag==
 spring.datasource.primary.password = OPXCNabmBpi/FKayjb2kubBySH5LiQln
-spring.datasource.primary.url=jdbc:mysql://47.111.67.16:3307/cbkj_web_api_dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+spring.datasource.primary.url=jdbc:mysql://47.111.67.16:3307/cbkj_web_api_test?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
 #
 #spring.datasource.primary.username = RVYQ+dq7Z9GrSl0fYA8/Pw==
 #spring.datasource.primary.password = WwkFHCZbwqYBWP/3a378oQ==
 #spring.datasource.primary.url=jdbc:mysql://192.168.2.172:3306/cbkj_web_api_xindu?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
 
 ## redis\u914D\u7F6E
-spring.redis.host = 47.114.47.147
+#spring.redis.host = 47.114.47.147
+#spring.redis.port = 6379
+#spring.redis.password = cbkj123!@#
+#spring.redis.database = 4
+
+spring.redis.host = 192.168.2.80
 spring.redis.port = 6379
 spring.redis.password = cbkj123!@#
-spring.redis.database = 4
 
 #HIS\u63A5\u53E3\u9879\u76EE\u5730\u5740
 address.pre.interface = http://192.168.2.105:94/pre_interface/V5.0/

+ 45 - 27
cbkj_web_api/src/main/resources/mappers/myData/TPersonalPrescriptionMapper.xml

@@ -284,17 +284,19 @@
             SELECT t.*
             FROM t_personal_prescription AS t
             <if test="(deptName != null and deptName != '') and ( insName == null or insName == '' )">
-                ,sys_department as dept,t_personal_rule_auth as rule
+                ,sys_department as dept
                 WHERE
                 (t.IS_DEL = '0' AND t.IS_SHARE = '0' AND t.INS_CODE = #{insCode}
-                and rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ID
+                and t.DEPT_ID=dept.DEP_ID
                 and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
                 <include refid="personalPreWhere"/>
                 )
-                or (t.IS_DEL = '0' AND t.IS_SHARE = '0' AND t.INS_CODE = #{insCode} and rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
+                or (t.IS_DEL = '0' AND t.IS_SHARE = '0' AND t.INS_CODE = #{insCode}
+                         and
+                t.DEPT_ID=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
@@ -303,33 +305,36 @@
             </if>
 
             <if test="(deptName != null and deptName != '') and (insName != null and insName != '') ">
-                ,sys_department as dept,t_personal_rule_auth as rule,sys_institution as ins
+                ,sys_department as dept,sys_institution as ins
                 WHERE
 
-                (rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
+                ( t.DEPT_ID=dept.DEP_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 and t.IS_DEL = '0' AND t.IS_SHARE = '0' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%')
                 ) or
-                (rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
+                ( t.DEPT_ID=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 and t.IS_DEL = '0' AND t.IS_SHARE = '0' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%')
                 )
 
             </if>
 
             <if test="(insName != null and insName != '') and (deptName == null or deptName == '')">
-                ,sys_department as dept,t_personal_rule_auth as rule,sys_institution as ins
+                ,sys_department as dept,sys_institution as ins
                 WHERE
-                (rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ID
+                (  t.DEPT_ID=dept.DEP_ID
                 and dept.APP_ID=t.DEPT_ID and dept.INS_CODE = t.INS_CODE
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.APP_ID=dept.APP_ID and ins.INS_CODE =  dept.INS_CODE
                 and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%') and t.IS_DEL = '0' AND t.IS_SHARE = '0' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
@@ -337,7 +342,8 @@
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
                 ) or(
-                rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ORIGIN_ID and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID
+                t.DEPT_ID=dept.DEP_ORIGIN_ID and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%') and t.IS_DEL = '0' AND t.IS_SHARE = '0' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
                 <if test="preOwnerName != null and preOwnerName != ''">
@@ -365,17 +371,19 @@
             SELECT t.*
             FROM t_personal_prescription AS t
             <if test="(deptName != null and deptName != '') and ( insName == null or insName == '' )">
-                ,sys_department as dept,t_personal_rule_auth as rule
+                ,sys_department as dept
                 WHERE
                 (t.IS_DEL = '0' AND t.IS_SHARE = '1' AND t.INS_CODE = #{insCode}
-                and rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ID
+                and t.DEPT_ID=dept.DEP_ID
                 and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
                 <include refid="personalPreWhere"/>
                 )
-                or (t.IS_DEL = '0' AND t.IS_SHARE = '1' AND t.INS_CODE = #{insCode} and rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
+                or (t.IS_DEL = '0' AND t.IS_SHARE = '1' AND t.INS_CODE = #{insCode}
+                and
+                t.DEPT_ID=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
@@ -384,33 +392,36 @@
             </if>
 
             <if test="(deptName != null and deptName != '') and (insName != null and insName != '') ">
-                ,sys_department as dept,t_personal_rule_auth as rule,sys_institution as ins
+                ,sys_department as dept,sys_institution as ins
                 WHERE
 
-                (rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
+                ( t.DEPT_ID=dept.DEP_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 and t.IS_DEL = '0' AND t.IS_SHARE = '1' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%')
                 ) or
-                (rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
+                ( t.DEPT_ID=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 and t.IS_DEL = '0' AND t.IS_SHARE = '1' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%')
                 )
 
             </if>
 
             <if test="(insName != null and insName != '') and (deptName == null or deptName == '')">
-                ,sys_department as dept,t_personal_rule_auth as rule,sys_institution as ins
+                ,sys_department as dept,sys_institution as ins
                 WHERE
-                (rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ID
+                (  t.DEPT_ID=dept.DEP_ID
                 and dept.APP_ID=t.DEPT_ID and dept.INS_CODE = t.INS_CODE
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.APP_ID=dept.APP_ID and ins.INS_CODE =  dept.INS_CODE
                 and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%') and t.IS_DEL = '0' AND t.IS_SHARE = '1' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
@@ -418,7 +429,8 @@
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
                 ) or(
-                rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ORIGIN_ID and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID
+                t.DEPT_ID=dept.DEP_ORIGIN_ID and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%') and t.IS_DEL = '0' AND t.IS_SHARE = '1' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
                 <if test="preOwnerName != null and preOwnerName != ''">
@@ -441,17 +453,19 @@
             SELECT t.*
             FROM t_personal_prescription AS t
             <if test="(deptName != null and deptName != '') and ( insName == null or insName == '' )">
-                ,sys_department as dept,t_personal_rule_auth as rule
+                ,sys_department as dept
                 WHERE
                 (t.IS_DEL = '0' AND t.IS_SHARE = '2' AND t.INS_CODE = #{insCode}
-                and rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ID
+                and t.DEPT_ID=dept.DEP_ID
                 and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
                 <include refid="personalPreWhere"/>
                 )
-                or (t.IS_DEL = '0' AND t.IS_SHARE = '2' AND t.INS_CODE = #{insCode} and rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
+                or (t.IS_DEL = '0' AND t.IS_SHARE = '2' AND t.INS_CODE = #{insCode}
+                and
+                t.DEPT_ID=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
@@ -460,33 +474,36 @@
             </if>
 
             <if test="(deptName != null and deptName != '') and (insName != null and insName != '') ">
-                ,sys_department as dept,t_personal_rule_auth as rule,sys_institution as ins
+                ,sys_department as dept,sys_institution as ins
                 WHERE
 
-                (rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
+                ( t.DEPT_ID=dept.DEP_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 and t.IS_DEL = '0' AND t.IS_SHARE = '2' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%')
                 ) or
-                (rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
+                ( t.DEPT_ID=dept.DEP_ORIGIN_ID and dept.DEP_NAME LIKE CONCAT('%',TRIM(#{deptName}),'%')
                 and t.IS_DEL = '0' AND t.IS_SHARE = '2' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
                 <if test="preOwnerName != null and preOwnerName != ''">
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%')
                 )
 
             </if>
 
             <if test="(insName != null and insName != '') and (deptName == null or deptName == '')">
-                ,sys_department as dept,t_personal_rule_auth as rule,sys_institution as ins
+                ,sys_department as dept,sys_institution as ins
                 WHERE
-                (rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ID
+                (  t.DEPT_ID=dept.DEP_ID
                 and dept.APP_ID=t.DEPT_ID and dept.INS_CODE = t.INS_CODE
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.APP_ID=dept.APP_ID and ins.INS_CODE =  dept.INS_CODE
                 and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%') and t.IS_DEL = '0' AND t.IS_SHARE = '2' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
@@ -494,7 +511,8 @@
                     AND t.PRE_OWNER_NAME LIKE CONCAT('%',TRIM(#{preOwnerName}),'%')
                 </if>
                 ) or(
-                rule.pers_pre_id=t.PERS_PRE_ID and rule.dept_id=dept.DEP_ORIGIN_ID and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID
+                t.DEPT_ID=dept.DEP_ORIGIN_ID and ins.INS_CODE=dept.INS_CODE and dept.APP_ID=ins.APP_ID
+                and t.INS_CODE = ins.INS_CODE and t.APP_ID = ins.APP_ID
                 and ins.INS_NAME LIKE CONCAT('%',TRIM(#{insName}),'%') and t.IS_DEL = '0' AND t.IS_SHARE = '2' AND t.INS_CODE = #{insCode}
                 <include refid="personalPreWhere"/>
                 <if test="preOwnerName != null and preOwnerName != ''">