|
@@ -235,7 +235,7 @@
|
|
|
ifnull(t4.selfEffCount, 0) as 'selfEffCount', concat(round(ifnull(t4.selfEffCount, 0) / t3.effCount * 100, 2), '%') as 'selfEffRate', round(t3.effCount - ifnull(t4.selfEffCount, 0)) as 'thirdEffCount'
|
|
|
from (
|
|
|
(select t1.*,
|
|
|
- concat(round(t1.effCount / t1.materialNum * 100, 2), '%') as 'effRate',concat( round(t2.target_value * 100, 2),'%' )as 'mediaEffRate', (
|
|
|
+ concat(round(t1.effCount / t1.materialNum * 100, 2), '%') as 'effRate',concat( round ifnull((t2.target_value, 0) * 100, 2),'%' )as 'mediaEffRate', (
|
|
|
case
|
|
|
when
|
|
|
round(t1.effCount / t1.materialNum * 100, 2) >= round(t2.target_value * 100, 2)
|
|
@@ -257,7 +257,7 @@
|
|
|
from etl_first_delivery_valid_materials
|
|
|
where delivery_year = #{year}
|
|
|
and delivery_month = #{month}
|
|
|
- group by project_id, rebate_type, settlement_1l, settlement_2l) t1
|
|
|
+ group by project_id, settlement_2l) t1
|
|
|
left join (select *
|
|
|
from first_delivery_valid_ratio
|
|
|
where delivery_year = #{year}
|
|
@@ -329,7 +329,7 @@
|
|
|
<select id="getDesignData" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
select t1.*,
|
|
|
round(t1.effMaterialNum / t1.materialNum * 100, 2) as 'effRate',
|
|
|
- round(t2.target_value * 100, 2) as 'mediaEffRate',
|
|
|
+ round(ifnull(t2.target_value,0) * 100, 2) as 'mediaEffRate',
|
|
|
(
|
|
|
case
|
|
|
when
|
|
@@ -373,13 +373,13 @@
|
|
|
where delivery_year = #{year}
|
|
|
and delivery_month = #{month}
|
|
|
<if test="designRole == 1">
|
|
|
- group by project_id, clip_id
|
|
|
+ group by project_id, clip_id,settlement_2l
|
|
|
</if>
|
|
|
<if test="designRole == 2">
|
|
|
- group by project_id, shot_id
|
|
|
+ group by project_id, shot_id,settlement_2l
|
|
|
</if>
|
|
|
<if test="designRole == 3">
|
|
|
- group by project_id, plan_id
|
|
|
+ group by project_id, plan_id,settlement_2l
|
|
|
</if>
|
|
|
) t1
|
|
|
left join
|