Browse Source

1.修改手动映射2.修改自动映射返回已映射和未映射上的数据

zjh 2 năm trước cách đây
mục cha
commit
a30e261004

BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/beans/drug/TMaterialStandVO.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/mapper/drug/TStandardMaterialMappingMapper.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/drug/TStandardMaterialMappingService.java


BIN
cbkj_web_parameter/src/main/java/com/jiuzhekan/cbkj/service/sysService/AdminService.java


+ 17 - 5
cbkj_web_parameter/src/main/resources/mappers/drug/TStandardMaterialMappingMapper.xml

@@ -141,20 +141,21 @@ group by tm2.mat_id
         select count(*)
         from t_standard_material_mapping
         <where>
+            1=1
             <if test=" sId != null and sId !=''">
-                s_id = #{sId}
+               and s_id = #{sId}
             </if>
             <if test=" sMatCode != null and sMatCode !=''">
-                s_mat_code = #{sMatCode}
+                and s_mat_code = #{sMatCode}
             </if>
             <if test=" drugId != null and drugId !=''">
-                drug_id = #{drugId}
+                and drug_id = #{drugId}
             </if>
             <if test=" matId != null and matId !=''">
-                mat_id = #{matId}
+                and mat_id = #{matId}
             </if>
             <if test=" sMatType != null and sMatType !=''">
-                s_mat_type = #{sMatType}
+                and s_mat_type = #{sMatType}
             </if>
         </where>
     </select>
@@ -177,5 +178,16 @@ group by tm2.mat_id
         WHERE mx.is_del = '0' and mx.drug_id = #{drugId} AND p.mat_id IS NULL AND m.s_id IS NOT NULL
 
     </insert>
+    <select id="insertautoMappingCount" parameterType="StandTMAutoMappingVO" resultType="Long">
+        SELECT
+       count(*)
+        FROM
+        t_drug_list AS tdl
+        JOIN t_material AS tm2 ON (tm2.drug_id = tdl.drug_id AND tm2.status = '1' and tm2.is_del='0')
+        LEFT JOIN t_standard_material_mapping AS tsmm ON(tsmm.drug_id = tm2.drug_id AND tsmm.mat_id = tm2.mat_id)
+        LEFT JOIN b_standard_mat AS bsm ON(bsm.s_id=tsmm.s_id)
+        where
+        tdl.status='1' and tdl.drug_type='0' and tdl.drug_id = #{drugId} and tsmm.s_id IS NULL
+    </select>
 
 </mapper>