Blame view

parking-module-charge/src/main/resources/mybatis/smapper/ConnectorInfoSMapper.xml 4.8 KB
55f68655   王彪总   新项目
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
  <?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.zteits.charge.mapper.smapper.ConnectorInfoSMapper">
    <resultMap id="BaseResultMap" type="com.zteits.clouds.api.dto.charge.dto.ConnectorInfoDTO">
      <id column="id" jdbcType="BIGINT" property="id" />
      <result column="connector_code" jdbcType="VARCHAR" property="connectorCode" />
      <result column="connector_id" jdbcType="VARCHAR" property="connectorId" />
      <result column="connector_name" jdbcType="VARCHAR" property="connectorName" />
      <result column="connector_type" jdbcType="INTEGER" property="connectorType" />
      <result column="equipment_id" jdbcType="VARCHAR" property="equipmentId" />
      <result column="station_id" jdbcType="VARCHAR" property="stationId" />
      <result column="operator_id" jdbcType="VARCHAR" property="operatorId" />
      <result column="voltage_upper_limits" jdbcType="INTEGER" property="voltageUpperLimits" />
      <result column="voltage_lower_limits" jdbcType="INTEGER" property="voltageLowerLimits" />
      <result column="current" jdbcType="INTEGER" property="current" />
      <result column="power" jdbcType="INTEGER" property="power" />
      <result column="park_no" jdbcType="VARCHAR" property="parkNo" />
      <result column="national_standard" jdbcType="INTEGER" property="nationalStandard" />
      <result column="status" jdbcType="INTEGER" property="status" />
      <result column="park_status" jdbcType="INTEGER" property="parkStatus" />
      <result column="lock_status" jdbcType="INTEGER" property="lockStatus" />
      <result column="qr_code_url" jdbcType="INTEGER" property="qrCodeUrl" />
      <result column="data_state" jdbcType="INTEGER" property="dataState" />
      <result column="create_emp_id" jdbcType="VARCHAR" property="createEmpId" />
      <result column="create_emp_name" jdbcType="VARCHAR" property="createEmpName" />
      <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
      <result column="modify_emp_id" jdbcType="VARCHAR" property="modifyEmpId" />
      <result column="modify_emp_name" jdbcType="VARCHAR" property="modifyEmpName" />
      <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
      <result column="org_id" jdbcType="BIGINT" property="orgId" />
  
      <result column="operator_name" jdbcType="VARCHAR" property="operatorName" />
      <result column="station_name" jdbcType="VARCHAR" property="stationName" />
      <result column="equipment_name" jdbcType="VARCHAR" property="equipmentName" />
  
    </resultMap>
  
    <sql id="Base_Column_List">
      s.id,s.connector_code,s.connector_id,s.connector_name,s.connector_type,s.equipment_id,s.station_id,s.operator_id,
      voltage_upper_limits,s.voltage_lower_limits,s.current,s.power,s.park_no,s.national_standard,
      status,s.park_status,s.lock_status,s.qr_code_url,s.data_state,
      s.create_emp_id,s.create_emp_name,s.create_time,s.modify_emp_id,s.modify_emp_name,s.modify_time,
      s.org_id,o.operator_name,sta.station_name,e.equipment_name
    </sql>
    <select id="queryConnectorInfo" parameterType="com.zteits.clouds.api.dto.charge.param.QueryConnectorInfoRequest" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
      from connector_info s join equipment_info e on s.equipment_id = e.equipment_id join operator_info o on s.operator_id = o.operator_id join station_info sta on s.station_id = sta.station_id
      where s.data_state = 1 and o.data_state = 1 and sta.data_state = 1 and e.data_state = 1
      <if test="connectorId != null and connectorId != ''">
        and s.connector_id = #{connectorId,jdbcType=VARCHAR}
      </if>
      <if test="connectorName != null and connectorName != ''">
        and s.connector_name = #{connectorName,jdbcType=VARCHAR}
      </if>
      <if test="equipmentId != null and equipmentId != ''">
        and s.equipment_id = #{equipmentId,jdbcType=VARCHAR}
      </if>
      <if test="status != null and status != ''">
        and s.status = #{status,jdbcType=VARCHAR}
      </if>
      <if test="parkStatus != null and parkStatus != ''">
        and s.park_status = #{parkStatus,jdbcType=VARCHAR}
      </if>
      <if test="lockStatus != null and lockStatus != ''">
        and s.lock_status = #{lockStatus,jdbcType=VARCHAR}
      </if>
      <if test="stationId != null and stationId != ''">
        and s.station_id = #{stationId,jdbcType=VARCHAR}
      </if>
      <if test="operatorId != null and operatorId != ''">
        and s.operator_id = #{operatorId,jdbcType=VARCHAR}
      </if>
      <if test="operatorName != null and operatorName != ''">
        and o.operator_name like  concat ('%',#{operatorName},'%')
      </if>
      <if test="stationName != null and stationName != ''">
        and sta.station_name like  concat ('%',#{stationName},'%')
      </if>
      <if test="orgId != null">
        and s.org_id = #{orgId,jdbcType=BIGINT}
      </if>
    </select>
  
  </mapper>