ChargingGunMapper.xml
1.96 KB
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
<?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="cn.com.glsx.evbusiness.modules.mapper.ChargingGunMapper">
<resultMap id="BaseResult" type="cn.com.glsx.evbusiness.modules.entity.ChargingGun">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="pile_id" jdbcType="VARCHAR" property="pileId" />
<result column="gun_number" jdbcType="VARCHAR" property="gunNumber" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="if_return" jdbcType="TINYINT" property="ifReturn" />
<result column="if_charging" jdbcType="TINYINT" property="ifCharging" />
<result column="gun_wire_number" jdbcType="VARCHAR" property="gunWireNumber" />
<result column="hardware_fault" jdbcType="SMALLINT" property="hardwareFault" />
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
</resultMap>
<sql id="Base_Column_List">
id, name, pile_id, gun_number, status, if_return, if_charging, gun_wire_number, hardware_fault, created_by, updated_by, created_time, updated_time
</sql>
<select id="page" resultMap="BaseResult">
select
<include refid="Base_Column_List" />
from charging_gun
<where>
<if test="pileId != null and pileId != ''">
and `pile_id` = #{pileId}
</if>
<if test="name != null and name != ''">
and `name` like concat('%',#{name},'%')
</if>
</where>
</select>
<select id="findByPileIdAndNumber" resultMap="BaseResult">
select * from charging_gun where pile_id = #{pileId} and gun_number = #{gunNumber}
</select>
</mapper>