| | |
| | | FROM |
| | | t_contract_score cs |
| | | LEFT JOIN |
| | | t_yw_unit u ON cs.unit_id = u.id and u.deleted = '0' |
| | | t_yw_unit u ON cs.unit_id = u.id and u.deleted = 0 |
| | | LEFT JOIN |
| | | t_contract c ON cs.contract_id = c.id and c.deleted = '0' |
| | | t_contract c ON cs.contract_id = c.id and c.deleted = 0 |
| | | where |
| | | cs.deleted = '0' |
| | | cs.deleted = 0 |
| | | <if test="unitId != null"> |
| | | AND cs.unit_id = #{unitId} |
| | | </if> |
| | |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="calculate" resultType="java.util.Map"> |
| | | SELECT |
| | | SUBSTRING_INDEX(rule_name, '/', 1) AS name, |
| | | COUNT(*) AS num, |
| | | -SUM(score) AS score |
| | | FROM t_contract_score |
| | | WHERE auditing_status = 'PASS' AND deleted = 0 |
| | | GROUP BY SUBSTRING_INDEX(rule_name, '/', 1) |
| | | </select> |
| | | |
| | | </mapper> |