|
@@ -908,27 +908,36 @@
|
|
|
) c
|
|
|
</select>
|
|
|
<select id="getScorePackagekfpjf" resultMap="wmScorePackageMap">
|
|
|
- select dd.* from (
|
|
|
- select p.id,p.score,p.score_package_name,p.score_id,p.package_type1,p.drug_producer,
|
|
|
- p.score-sum(if(p1.del_flag='0' and p1.enable_flag='0',p1.score,0)) as kfpjf
|
|
|
- from wm_score_package p
|
|
|
- left join wm_score_package p1 on p.id=p1.relation_score_id and p1.del_flag='0' and p1.enable_flag='0'
|
|
|
- <where>
|
|
|
- p.del_flag='0' and p.enable_flag='0' and p.old_package='0'
|
|
|
- <if test="query.deptId != null and query.deptId != ''">
|
|
|
- AND p.dept_id= #{query.deptId}
|
|
|
- </if>
|
|
|
- <if test="query.sendPackageDeptId != null and query.sendPackageDeptId != ''">
|
|
|
- AND p.send_package_dept_id= #{query.sendPackageDeptId}
|
|
|
- </if>
|
|
|
- <if test="query.typeid != null and query.typeid != ''">
|
|
|
- AND p.typeid IN(${query.typeid})
|
|
|
- </if>
|
|
|
- <if test="query.id != null and query.id != ''">
|
|
|
- AND p.id IN(${query.id})
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- group by p.id,p.score,p.score_package_name,p.score_id,p.package_type1
|
|
|
+ select
|
|
|
+ dd.*
|
|
|
+ from (
|
|
|
+ select
|
|
|
+ p.id,
|
|
|
+ p.score,
|
|
|
+ p.score_package_name,
|
|
|
+ p.score_id,
|
|
|
+ p.package_type1,
|
|
|
+ p.drug_producer,
|
|
|
+ p.score-sum(if(p1.del_flag='0' and p1.enable_flag='0' and p1.score_package_status != '6',p1.score,0)) as kfpjf
|
|
|
+ from wm_score_package p
|
|
|
+ left join wm_score_package p1 on p.id=p1.relation_score_id and p1.del_flag='0' and p1.enable_flag='0'
|
|
|
+
|
|
|
+ <where>
|
|
|
+ p.del_flag='0' and p.enable_flag='0' and p.old_package='0'
|
|
|
+ <if test="query.deptId != null and query.deptId != ''">
|
|
|
+ AND p.dept_id= #{query.deptId}
|
|
|
+ </if>
|
|
|
+ <if test="query.sendPackageDeptId != null and query.sendPackageDeptId != ''">
|
|
|
+ AND p.send_package_dept_id= #{query.sendPackageDeptId}
|
|
|
+ </if>
|
|
|
+ <if test="query.typeid != null and query.typeid != ''">
|
|
|
+ AND p.typeid IN(${query.typeid})
|
|
|
+ </if>
|
|
|
+ <if test="query.id != null and query.id != ''">
|
|
|
+ AND p.id IN(${query.id})
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by p.id,p.score,p.score_package_name,p.score_id,p.package_type1
|
|
|
) dd where dd.kfpjf>0
|
|
|
order by dd.id
|
|
|
</select>
|