feiyu02
2025-08-14 b10c22af595bd995e56946bff63b8f2f984b13e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flightfeather.uav.domain.mapper.ComplaintMapper">
  <resultMap id="BaseResultMap" type="com.flightfeather.uav.domain.entity.Complaint">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="ID" jdbcType="INTEGER" property="id" />
    <result column="CI_GUID" jdbcType="VARCHAR" property="ciGuid" />
    <result column="CI_Name" jdbcType="VARCHAR" property="ciName" />
    <result column="CO_Type" jdbcType="INTEGER" property="coType" />
    <result column="CO_Type_Name" jdbcType="VARCHAR" property="coTypeName" />
    <result column="CO_Time" jdbcType="TIMESTAMP" property="coTime" />
  </resultMap>
  <resultMap id="ComplaintRecord" type="com.flightfeather.uav.lightshare.bean.ComplaintRecord">
    <result column="CI_GUID" jdbcType="VARCHAR" property="ciGuid" />
    <result column="CI_Name" jdbcType="VARCHAR" property="ciName" />
    <result column="CI_Longitude" jdbcType="DECIMAL" property="ciLng" />
    <result column="CI_Latitude" jdbcType="DECIMAL" property="ciLat" />
    <result column="ciIndex" jdbcType="VARCHAR" property="ciIndex" />
    <result column="CI_Address" jdbcType="VARCHAR" property="ciAddress" />
    <result column="CO_Type" jdbcType="INTEGER" property="coType" />
    <result column="CO_Type_Name" jdbcType="VARCHAR" property="coTypeName" />
    <result column="count" jdbcType="INTEGER" property="count" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    ID, CI_GUID, CI_Name, CO_Type, CO_Type_Name, CO_Time
  </sql>
 
  <select id="getComplaintInfo" resultMap="ComplaintRecord">
    SELECT
      a.CI_GUID,
      a.CI_Name,
      b.CI_Longitude,
      b.CI_Latitude,
      b.CI_Extension1 as ciIndex,
      b.CI_Address,
      a.CO_Type,
      a.CO_Type_Name,
      COUNT(*) as count
    FROM
      co_complaint AS a
    LEFT JOIN ea_companyinfo AS b ON a.CI_GUID = b.CI_GUID
    GROUP BY
      a.CO_Type,
      a.CI_GUID
  </select>
</mapper>