StOrganizationMapper.xml 718 B

1234567891011121314
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.care.bigscreen.mapper.StOrganizationMapper">
  4. <select id="selectStOrganizationList" resultType="com.care.bigscreen.entity.StOrganization">
  5. SELECT
  6. t.id orgId,
  7. (select count(1) from care_station a where a.org_id = t.id) stationAmount,
  8. (select count(1) from care_sys_user a where a.org_id = t.id and a.role = 'seat') seatsAmount,
  9. (select convert(sum(call_duration)/60,decimal(20,2)) from cc_traffic_billed b where b.org_id = t.id) seatsCallMinAmount
  10. FROM care_organization t
  11. </select>
  12. </mapper>