| | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.worker.entity.MasterWorker"> |
| | | <id column="id" property="id"/> |
| | | <result column="city" property="city"/> |
| | | <result column="city_id" property="cityId"/> |
| | | <result column="user_number" property="userNumber"/> |
| | | <result column="password" property="password"/> |
| | | <result column="real_name" property="realName"/> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="orderCount" resultType="com.ruoyi.worker.vo.OrderCountVO"> |
| | | SELECT |
| | | COALESCE(SUM(CASE WHEN o.state IN (2, 3, 4) THEN 1 ELSE 0 END), 0) AS total, |
| | | COALESCE(SUM(CASE WHEN o.state = 2 THEN 1 ELSE 0 END), 0) AS waitVisit, |
| | | COALESCE(SUM(CASE WHEN o.state = 4 THEN 1 ELSE 0 END), 0) AS completed |
| | | FROM |
| | | t_order o left join sys_master_worker m on o.server_id = m.id |
| | | SELECT COALESCE(SUM(CASE WHEN o.state IN (2, 3, 4) THEN 1 ELSE 0 END), 0) AS total, |
| | | COALESCE(SUM(CASE WHEN o.state = 2 THEN 1 ELSE 0 END), 0) AS waitVisit, |
| | | COALESCE(SUM(CASE WHEN o.state = 4 THEN 1 ELSE 0 END), 0) AS completed |
| | | FROM t_order o |
| | | left join sys_master_worker m on o.server_id = m.id |
| | | where m.id = #{id} |
| | | </select> |
| | | </mapper> |