| | |
| | | SELECT |
| | | user_name, |
| | | (SELECT organization_name FROM automessage_organization_chart WHERE automessage_organization_chart.id=department_id) as departmentNmae, |
| | | ((select sum(IF(evaluate_state='1',10,IF(evaluate_state='2',5,0))) from automessage_guide_repair_order |
| | | WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id |
| | | <if test="ids != null"> |
| | | and guide_department_id IN |
| | | <foreach collection="ids" item="param" open="(" close=")" separator=","> |
| | | #{param} |
| | | </foreach> |
| | | </if> |
| | | )/(select count(id) from automessage_guide_repair_order |
| | | WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id |
| | | <if test="ids != null"> |
| | | and guide_department_id IN |
| | | <foreach collection="ids" item="param" open="(" close=")" separator=","> |
| | | #{param} |
| | | </foreach> |
| | | </if>) |
| | | ( format((select sum(IF(evaluate_state='1',10,IF(evaluate_state='2',5,0))) from automessage_guide_repair_order |
| | | WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id |
| | | <if test="ids != null"> |
| | | and guide_department_id IN |
| | | <foreach collection="ids" item="param" open="(" close=")" separator=","> |
| | | #{param} |
| | | </foreach> |
| | | </if> |
| | | )/(select count(id) from automessage_guide_repair_order |
| | | WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id |
| | | <if test="ids != null"> |
| | | and guide_department_id IN |
| | | <foreach collection="ids" item="param" open="(" close=")" separator=","> |
| | | #{param} |
| | | </foreach> |
| | | </if>),1) |
| | | ) as num |
| | | FROM automessage_sys_user |
| | | <where> |
| | |
| | | |
| | | <!-- 组织排行榜 按评价 --> |
| | | <select id="organizationScore" resultType="int"> |
| | | SELECT sum(IF(evaluate_state='1',10,IF(evaluate_state='2',5,0))) |
| | | |
| | | format( |
| | | SELECT sum(IF(evaluate_state='1',10,IF(evaluate_state='2',5,0))) |
| | | FROM automessage_guide_repair_order |
| | | WHERE department_id in |
| | | <foreach collection="ids" item="param" open="(" close=")" separator=","> |
| | | <foreach collection="ids" item="param" open="(" close=")" separator=","> |
| | | #{param} |
| | | </foreach> |
| | | </foreach>,1) |
| | | </select> |
| | | |
| | | |