Blame view

parking-module-park/src/main/resources/mybatis/smapper/ParkingLotChannelSMapper.xml 4.21 KB
9af4a544   王彪总   新项目
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
  <?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.park.mapper.smapper.ParkingLotChannelSMapper">
    <resultMap id="BaseResultMap" type="com.zteits.park.domain.ParkingLotChannel">
      <id column="id" jdbcType="BIGINT" property="id" />
      <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
      <result column="area_id" jdbcType="BIGINT" property="areaId" />
      <result column="channel_name" jdbcType="VARCHAR" property="channelName" />
      <result column="channel_description" jdbcType="VARCHAR" property="channelDescription" />
      <result column="channel_direction" jdbcType="INTEGER" property="channelDirection" />
      <result column="channel_type" jdbcType="INTEGER" property="channelType" />
      <result column="unattended_mode" jdbcType="INTEGER" property="unattendedMode" />
      <result column="channel_number" jdbcType="VARCHAR" property="channelNumber" />
      <result column="client_release_mode_id" jdbcType="INTEGER" property="clientReleaseModeId" />
      <result column="server_release_mode_id" jdbcType="INTEGER" property="serverReleaseModeId" />
      <result column="handset_release_mode_id" jdbcType="INTEGER" property="handsetReleaseModeId" />
      <result column="default_managed_equipment_id" jdbcType="INTEGER" property="defaultManagedEquipmentId" />
      <result column="off_in_place_read" jdbcType="INTEGER" property="offInPlaceRead" />
      <result column="have_car_read_card_near" jdbcType="INTEGER" property="haveCarReadCardNear" />
      <result column="have_car_read_card_far" jdbcType="INTEGER" property="haveCarReadCardFar" />
      <result column="have_car_read_card_medium" jdbcType="INTEGER" property="haveCarReadCardMedium" />
      <result column="have_car_read_temp_plate" jdbcType="INTEGER" property="haveCarReadTempPlate" />
      <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
      <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
      <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
      <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
      <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    </resultMap>
  
      <select id="selectByChannel" parameterType="com.zteits.clouds.api.dto.park.param.closecarpark.QueryChannelInfoRequest"
              resultType="com.zteits.clouds.api.dto.park.dto.ChannelInfoDTO">
          SELECT
          c.id id,
          c.channel_description channelDescription,
          c.area_id areaId,
          c.channel_direction channelDirection,
          c.channel_number channelNumber,
          c.channel_type channelType,
          c.channel_name channelName,
          c.pl_no plNo,
          c.unattended_mode unattendedMode,
          a.area_name areaName,
          l.pl_name plName,
          (select b.id  from parking_lot_channel a
  				LEFT JOIN parking_lot_channel b on
  				a.tide_bind = b.tide_bind
  				where a.id = #{id} and b.id != #{id}
  				and a.is_tide_channel = 1 and b.is_tide_channel = 1
  		        and a.data_status = 1 and b.data_status = 1
  		) tideChannelId,
          c.is_tide_channel isTideChannel,
          c.tide_bind tideBind,
          c.tide_bind_channel tideBindChannel
          FROM
          parking_lot_channel c
          LEFT JOIN parking_lot_areas a ON c.area_id = a.id
          LEFT JOIN parking_lot l ON c.pl_no = l.pl_no
  	    where c.id = #{id}
          and c.data_status = 1
      </select>
  
  
      <update id="updateChannelByPrimaryKey" parameterType="com.zteits.park.domain.ParkingLotChannel">
      update parking_lot_channel
      set
        channel_name = #{channelName,jdbcType=VARCHAR},
        channel_description = #{channelDescription,jdbcType=VARCHAR},
        unattended_mode = #{unattendedMode,jdbcType=INTEGER},
        modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
        channel_number = #{channelNumber,jdbcType=TIMESTAMP},
        channel_direction = #{channelDirection,jdbcType=TIMESTAMP}
      where id = #{id,jdbcType=BIGINT}
    </update>
  
      <update id="deleteChannelByPrimaryKey" parameterType="com.zteits.park.domain.ParkingLotChannel">
      update parking_lot_channel
      set
        data_status = #{dataStatus,jdbcType=INTEGER}
      where id = #{id,jdbcType=BIGINT}
    </update>
  
  </mapper>