|
@@ -217,18 +217,14 @@
|
|
|
|
|
|
<select id="countReplacementsInfo"
|
|
|
resultType="com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatHead">
|
|
|
- SELECT ric.open_pay_ openPay,
|
|
|
- COUNT(DISTINCT ria.user_id_) surveyNum,
|
|
|
- COUNT(DISTINCT
|
|
|
- IF(ria.instruments_id_ IS NOT NULL, ria.user_id_, NULL)) replacementNum,
|
|
|
- TRUNCATE(COUNT(IF(ria.instruments_id_ IS NOT NULL, ria.user_id_, NULL)) / COUNT(DISTINCT ria.user_id_) *
|
|
|
- 100,
|
|
|
- 2) replacementRate,
|
|
|
- TRUNCATE(COUNT(IF(ria.pay_status_ = 2, ria.user_id_, NULL)) /
|
|
|
- COUNT(DISTINCT IF(ria.instruments_id_ IS NOT NULL, ria.user_id_, NULL)) * 100, 2) paymentRate
|
|
|
- FROM replacement_instrument_activity ria
|
|
|
- LEFT JOIN replacement_instrument_cooperation ric
|
|
|
- ON ria.cooperation_organ_id_ = ric.cooperation_organ_id_
|
|
|
+ SELECT ric.open_pay_ openPay,
|
|
|
+ COUNT( DISTINCT ria.user_id_ ) surveyNum,
|
|
|
+ COUNT( DISTINCT IF (ria.instruments_id_ IS NOT NULL, ria.user_id_, NULL)) replacementNum,
|
|
|
+ TRUNCATE ( COUNT(DISTINCT IF ( ria.instruments_id_ IS NOT NULL, ria.user_id_, NULL )) / COUNT( DISTINCT ria.user_id_ ) * 100, 2 ) replacementRate,
|
|
|
+ TRUNCATE ( COUNT(DISTINCT IF ( ria.pay_status_ = 2, ria.user_id_, NULL )) / COUNT( DISTINCT IF ( ria.instruments_id_ IS NOT NULL, ria.user_id_, NULL )) * 100, 2) paymentRate
|
|
|
+ FROM
|
|
|
+ replacement_instrument_activity ria
|
|
|
+ LEFT JOIN replacement_instrument_cooperation ric ON ria.cooperation_organ_id_ = ric.cooperation_organ_id_
|
|
|
WHERE ria.replacement_instrument_cooperation_id_ = #{cooperationId}
|
|
|
</select>
|
|
|
|