|
@@ -141,20 +141,21 @@ group by tm2.mat_id
|
|
select count(*)
|
|
select count(*)
|
|
from t_standard_material_mapping
|
|
from t_standard_material_mapping
|
|
<where>
|
|
<where>
|
|
|
|
+ 1=1
|
|
<if test=" sId != null and sId !=''">
|
|
<if test=" sId != null and sId !=''">
|
|
- s_id = #{sId}
|
|
|
|
|
|
+ and s_id = #{sId}
|
|
</if>
|
|
</if>
|
|
<if test=" sMatCode != null and sMatCode !=''">
|
|
<if test=" sMatCode != null and sMatCode !=''">
|
|
- s_mat_code = #{sMatCode}
|
|
|
|
|
|
+ and s_mat_code = #{sMatCode}
|
|
</if>
|
|
</if>
|
|
<if test=" drugId != null and drugId !=''">
|
|
<if test=" drugId != null and drugId !=''">
|
|
- drug_id = #{drugId}
|
|
|
|
|
|
+ and drug_id = #{drugId}
|
|
</if>
|
|
</if>
|
|
<if test=" matId != null and matId !=''">
|
|
<if test=" matId != null and matId !=''">
|
|
- mat_id = #{matId}
|
|
|
|
|
|
+ and mat_id = #{matId}
|
|
</if>
|
|
</if>
|
|
<if test=" sMatType != null and sMatType !=''">
|
|
<if test=" sMatType != null and sMatType !=''">
|
|
- s_mat_type = #{sMatType}
|
|
|
|
|
|
+ and s_mat_type = #{sMatType}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</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
|
|
WHERE mx.is_del = '0' and mx.drug_id = #{drugId} AND p.mat_id IS NULL AND m.s_id IS NOT NULL
|
|
|
|
|
|
</insert>
|
|
</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>
|
|
</mapper>
|