|
@@ -85,6 +85,10 @@
|
|
|
|
|
|
<resultMap id="BaseResultMap2" type="com.jiuzhekan.cbkj.beans.drug.TMaterialStandVO">
|
|
|
<id column="matId" jdbcType="VARCHAR" property="matId" />
|
|
|
+ <id column="sMatCode" jdbcType="VARCHAR" property="sMatCode" />
|
|
|
+ <id column="sMatName" jdbcType="VARCHAR" property="sMatName" />
|
|
|
+ <id column="sId" jdbcType="VARCHAR" property="sId" />
|
|
|
+ <id column="mapId" jdbcType="VARCHAR" property="mapId" />
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
@@ -101,20 +105,22 @@
|
|
|
tm2.drug_id as drugId
|
|
|
FROM
|
|
|
t_drug_list AS tdl
|
|
|
- LEFT JOIN t_pharmacy AS tp ON(tdl.drug_id = tp.drug_id and tp.status = '1')
|
|
|
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')
|
|
|
<where>
|
|
|
tdl.status='1' and tdl.drug_type='0'
|
|
|
+ <if test=" drugId !=null and drugId !=''">
|
|
|
+ and tdl.drug_id = #{drugId}
|
|
|
+ </if>
|
|
|
<if test=" isMapping == 1">
|
|
|
- and bsm.s_id is not null
|
|
|
+ and bsm.s_id is not null
|
|
|
</if>
|
|
|
<if test=" isMapping == 2">
|
|
|
and bsm.s_id is null
|
|
|
</if>
|
|
|
- <if test=" phaType != null and phaType !=''">
|
|
|
- and tp.pha_type =#{phaType}
|
|
|
+ <if test=" matClass != null and matClass !=''">
|
|
|
+ and tm2.mat_class = #{matClass}
|
|
|
</if>
|
|
|
<if test=" keyWord != null and keyWord !=''">
|
|
|
and (tm2.mat_name like CONCAT('%',trim(#{keyWord}),'%') or tm2.mat_standard like CONCAT('%',trim(#{keyWord}),'%') )
|
|
@@ -156,7 +162,7 @@ group by tm2.mat_id
|
|
|
#{createUserName}
|
|
|
FROM t_material mx
|
|
|
LEFT JOIN b_standard_mat m ON m.s_mat_type='2' and m.s_mat_name = substring_index(substring_index(substring_index(substring_index(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(REPLACE(mx.mat_name,'【配送】',''),'5',''),'1',''),'*',''),'d',''),'K',''),'G',''),'P',''),'Z',''),'配方颗粒',''),'颗粒',''),'(',1),'(',1),'[',1),'<',1)
|
|
|
- LEFT JOIN t_standard_material_mapping p ON p.mat_id = mx.mat_id
|
|
|
+ LEFT JOIN t_standard_material_mapping p ON (p.mat_id = mx.mat_id AND p.s_id=m.s_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>
|