|
|
@ -101,10 +101,24 @@ |
|
|
|
count( 1 ) AS total |
|
|
|
FROM |
|
|
|
fact_index_govrn_ablity_dept_monthly m |
|
|
|
inner join screen_customer_dept scd |
|
|
|
on( |
|
|
|
m.GRID_ID=scd.GRID_ID |
|
|
|
and scd.DEL_FLAG='0' |
|
|
|
and scd.UP_TO_CAL='yes' |
|
|
|
) |
|
|
|
WHERE |
|
|
|
m.DEL_FLAG = '0' |
|
|
|
AND m.CUSTOMER_ID =#{customerId} |
|
|
|
AND m.MONTH_ID=#{monthId} |
|
|
|
<choose> |
|
|
|
<when test="null!=subCustomerIds and subCustomerIds.size()>0"> |
|
|
|
and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND m.CUSTOMER_ID =#{customerId} |
|
|
|
and scd.CUSTOMER_ID=#{customerId} |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 计算最大最小值 --> |
|
|
@ -127,10 +141,24 @@ |
|
|
|
MAX(M.SATISFACTION_RATIO) as SATISFACTION_RATIO_MAX |
|
|
|
FROM |
|
|
|
fact_index_govrn_ablity_dept_monthly m |
|
|
|
inner join screen_customer_dept scd |
|
|
|
on( |
|
|
|
m.GRID_ID=scd.GRID_ID |
|
|
|
and scd.DEL_FLAG='0' |
|
|
|
and scd.UP_TO_CAL='yes' |
|
|
|
) |
|
|
|
WHERE |
|
|
|
m.DEL_FLAG = '0' |
|
|
|
AND m.CUSTOMER_ID =#{customerId} |
|
|
|
AND m.MONTH_ID =#{monthId} |
|
|
|
<choose> |
|
|
|
<when test="null!=subCustomerIds and subCustomerIds.size()>0"> |
|
|
|
and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND m.CUSTOMER_ID =#{customerId} |
|
|
|
and scd.CUSTOMER_ID=#{customerId} |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 分页查询事实记录 --> |
|
|
@ -148,10 +176,24 @@ |
|
|
|
SATISFACTION_RATIO |
|
|
|
FROM |
|
|
|
fact_index_govrn_ablity_dept_monthly m |
|
|
|
inner join screen_customer_dept scd |
|
|
|
on( |
|
|
|
m.GRID_ID=scd.GRID_ID |
|
|
|
and scd.DEL_FLAG='0' |
|
|
|
and scd.UP_TO_CAL='yes' |
|
|
|
) |
|
|
|
WHERE |
|
|
|
m.DEL_FLAG = '0' |
|
|
|
AND m.CUSTOMER_ID =#{customerId} |
|
|
|
AND m.MONTH_ID =#{monthId} |
|
|
|
<choose> |
|
|
|
<when test="null!=subCustomerIds and subCustomerIds.size()>0"> |
|
|
|
and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') |
|
|
|
</when> |
|
|
|
<otherwise> |
|
|
|
AND m.CUSTOMER_ID =#{customerId} |
|
|
|
and scd.CUSTOMER_ID=#{customerId} |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
ORDER BY |
|
|
|
m.DEPT_ID ASC |
|
|
|
LIMIT #{offset},#{pageSize} |
|
|
|