|
@@ -106,8 +106,16 @@
|
|
FROM
|
|
FROM
|
|
t_drug_list AS tdl
|
|
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')
|
|
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 AND tsmm.s_mat_type='2')
|
|
|
|
- LEFT JOIN b_standard_mat AS bsm ON(bsm.s_id=tsmm.s_id AND bsm.s_mat_type='2')
|
|
|
|
|
|
+ LEFT JOIN t_standard_material_mapping AS tsmm ON(tsmm.drug_id = tm2.drug_id AND tsmm.mat_id = tm2.mat_id
|
|
|
|
+ <if test=" sMatType !=null and sMatType !=''">
|
|
|
|
+ AND tsmm.s_mat_type = #{sMatType}
|
|
|
|
+ </if>
|
|
|
|
+ )
|
|
|
|
+ LEFT JOIN b_standard_mat AS bsm ON(bsm.s_id=tsmm.s_id
|
|
|
|
+ <if test=" sMatType !=null and sMatType !=''">
|
|
|
|
+ AND bsm.s_mat_type=#{sMatType}
|
|
|
|
+ </if>
|
|
|
|
+ )
|
|
<where>
|
|
<where>
|
|
tdl.status='1' and tdl.drug_type='0'
|
|
tdl.status='1' and tdl.drug_type='0'
|
|
<if test=" drugId !=null and drugId !=''">
|
|
<if test=" drugId !=null and drugId !=''">
|