QueryParkBaseSMapper.xml 13.8 KB
<?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.QueryParkBaseSMapper">
  <resultMap id="BaseGetParkingLotsResultMap" type="com.zteits.clouds.api.dto.syncdata.dto.GetParkingLotsDTO">
    <id column="pl_id" jdbcType="BIGINT" property="plId" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="state" jdbcType="INTEGER" property="state" />
    <result column="source_type" jdbcType="INTEGER" property="sourceType" />
    <result column="pl_province_id" jdbcType="BIGINT" property="plProvinceId" />
    <result column="pl_province_name" jdbcType="VARCHAR" property="plProvinceName" />
    <result column="pl_city_id" jdbcType="BIGINT" property="plCityId" />
    <result column="pl_city_name" jdbcType="VARCHAR" property="plCityName" />
    <result column="pl_country_id" jdbcType="BIGINT" property="plCountryId" />
    <result column="pl_country_name" jdbcType="VARCHAR" property="plCountryName" />
    <result column="pl_area_block_id" jdbcType="BIGINT" property="plAreaBlockId" />
    <result column="pl_area_block_name" jdbcType="VARCHAR" property="plAreaBlockName" />
    <result column="pl_address" jdbcType="VARCHAR" property="plAddress" />
    <result column="pl_berth_num" jdbcType="INTEGER" property="plBerthNum" />
    <result column="pl_pay_type" jdbcType="INTEGER" property="plPayType" />
    <result column="pl_charge_num" jdbcType="INTEGER" property="plChargeNum" />
    <result column="pl_type" jdbcType="INTEGER" property="plType" />
    <result column="pl_type_prop" jdbcType="VARCHAR" property="plTypeProp" />
    <result column="pl_busi_time_start" jdbcType="VARCHAR" property="plBusiTimeStart" />
    <result column="pl_busi_time_end" jdbcType="VARCHAR" property="plBusiTimeEnd" />
    <result column="pl_entrance_num" jdbcType="INTEGER" property="plEntranceNum" />
    <result column="pl_exit_num" jdbcType="INTEGER" property="plExitNum" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_op" jdbcType="BIGINT" property="createOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="modify_op" jdbcType="BIGINT" property="modifyOp" />
    <result column="pl_out_no" jdbcType="VARCHAR" property="plOutNo" />
    <result column="pl_rate" jdbcType="VARCHAR" property="plRate" />
    <result column="service_tel" jdbcType="VARCHAR" property="serviceTel" />
    <result column="pl_picture_path" jdbcType="VARCHAR" property="plPicturePath" />
    <result column="busi_circle" jdbcType="INTEGER" property="busiCircle" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="pl_busi_type" jdbcType="VARCHAR" property="plBusiType" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="org_name" jdbcType="VARCHAR" property="orgName" />
    <result column="lon_id" jdbcType="DECIMAL" property="lonId" />
    <result column="lat_id" jdbcType="DECIMAL" property="latId" />
  </resultMap>
  <resultMap id="BaseGetParkingLotBerthsResultMap" type="com.zteits.clouds.api.dto.syncdata.dto.GetParkingLotBerthsDTO">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="park_area_code" jdbcType="VARCHAR" property="parkAreaCode" />
    <result column="berth_no" jdbcType="VARCHAR" property="berthNo" />
    <result column="car_no" jdbcType="VARCHAR" property="carNo" />
    <result column="road_position" jdbcType="CHAR" property="roadPosition" />
    <result column="direction" jdbcType="CHAR" property="direction" />
    <result column="park_type" jdbcType="CHAR" property="parkType" />
    <result column="is_occupy" jdbcType="CHAR" property="isOccupy" />
    <result column="car_status" jdbcType="VARCHAR" property="carStatus" />
    <result column="order_id" jdbcType="VARCHAR" property="orderId" />
    <result column="berth_address" jdbcType="VARCHAR" property="berthAddress" />
    <result column="pda_in_time" jdbcType="TIMESTAMP" property="pdaInTime" />
    <result column="eqp_in_time" jdbcType="TIMESTAMP" property="eqpInTime" />
    <result column="pda_out_time" jdbcType="TIMESTAMP" property="pdaOutTime" />
    <result column="eqp_out_time" jdbcType="TIMESTAMP" property="eqpOutTime" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_op" jdbcType="BIGINT" property="createOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="modify_op" jdbcType="BIGINT" property="modifyOp" />
    <result column="opt_flg" jdbcType="CHAR" property="optFlg" />
  </resultMap>
  <resultMap id="BaseGetParkingLotEqpsResultMap" type="com.zteits.clouds.api.dto.syncdata.dto.GetParkingLotEqpsDTO">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="eqp_type" jdbcType="INTEGER" property="eqpType" />
    <result column="eqp_no" jdbcType="VARCHAR" property="eqpNo" />
    <result column="berth_no" jdbcType="VARCHAR" property="berthNo" />
    <result column="eqp_name" jdbcType="VARCHAR" property="eqpName" />
    <result column="eqp_model" jdbcType="VARCHAR" property="eqpModel" />
    <result column="eqp_is_online" jdbcType="CHAR" property="eqpIsOnline" />
    <result column="maintain_opt" jdbcType="VARCHAR" property="maintainOpt" />
    <result column="heartbeat_interval" jdbcType="INTEGER" property="heartbeatInterval" />
    <result column="heartbeat_time" jdbcType="TIMESTAMP" property="heartbeatTime" />
    <result column="factory_no" jdbcType="VARCHAR" property="factoryNo" />
    <result column="lon_id" jdbcType="DECIMAL" property="lonId" />
    <result column="lat_id" jdbcType="DECIMAL" property="latId" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_op" jdbcType="BIGINT" property="createOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="modify_op" jdbcType="BIGINT" property="modifyOp" />
    <result column="opt_flg" jdbcType="CHAR" property="optFlg" />
    <result column="electricity" jdbcType="VARCHAR" property="electricity" />
    <result column="lon_lat_type" jdbcType="INTEGER" property="lonLatType" />
    <result column="voltag" jdbcType="VARCHAR" property="voltag" />
    <result column="install_time" jdbcType="TIMESTAMP" property="installTime" />

  </resultMap>
  <resultMap id="BaseGetGuideScreensResultMap" type="com.zteits.clouds.api.dto.syncdata.dto.GetGuideScreensDTO">
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="guide_no" property="guideNo" jdbcType="VARCHAR" />
    <result column="guide_name" property="guideName" jdbcType="VARCHAR" />
    <result column="province_id" property="provinceId" jdbcType="BIGINT" />
    <result column="province_name" property="provinceName" jdbcType="VARCHAR" />
    <result column="city_id" property="cityId" jdbcType="BIGINT" />
    <result column="city_name" property="cityName" jdbcType="VARCHAR" />
    <result column="country_id" property="countryId" jdbcType="BIGINT" />
    <result column="country_name" property="countryName" jdbcType="VARCHAR" />
    <result column="address" property="address" jdbcType="VARCHAR" />
    <result column="lon_id" property="lonId" jdbcType="DECIMAL" />
    <result column="lat_id" property="latId" jdbcType="DECIMAL" />
    <result column="level" property="level" jdbcType="INTEGER" />
    <result column="parking_num" property="parkingNum" jdbcType="INTEGER" />
    <result column="picture_path" property="picturePath" jdbcType="VARCHAR" />
    <result column="data_status" property="dataStatus" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="create_op" property="createOp" jdbcType="BIGINT" />
    <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
        <collection property="guideParkRels" javaType="list" ofType="com.zteits.clouds.api.dto.syncdata.dto.GetGuideParkRelDTO"
                    resultMap="BaseGuideParkRelResultMap" columnPrefix="rel_">
        </collection>
        <collection property="firstGuideInfoConfigs" javaType="list" ofType="com.zteits.clouds.api.dto.syncdata.dto.GetGFirstGuideInfoConfigDTO"
                    resultMap="BaseGuideInfoConfigResultMap" columnPrefix="cof_">
        </collection>
  </resultMap>
   <resultMap id="BaseGuideParkRelResultMap" type="com.zteits.clouds.api.dto.syncdata.dto.GetGuideParkRelDTO">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="guide_no" jdbcType="VARCHAR" property="guideNo" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="berth_num" jdbcType="INTEGER" property="berthNum" />
    <result column="floor_status" property="floorStatus" jdbcType="INTEGER" />
    <result column="floor" property="floor" jdbcType="VARCHAR" />
    <result column="high_limit_status" jdbcType="INTEGER" property="highLimitStatus" />
    <result column="high_limit_num" jdbcType="INTEGER" property="highLimitNum" />
    <result column="sharp_turn_status" jdbcType="INTEGER" property="sharpTurnStatus" />
    <result column="time_system" jdbcType="VARCHAR" property="timeSystem" />
    <result column="guide_point" jdbcType="INTEGER" property="guidePoint" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_op" jdbcType="BIGINT" property="createOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
  </resultMap>
  <resultMap id="BaseGuideInfoConfigResultMap" type="com.zteits.clouds.api.dto.syncdata.dto.GetGFirstGuideInfoConfigDTO" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="guide_no" property="guideNo" jdbcType="VARCHAR" />
    <result column="pl_no" property="plNo" jdbcType="VARCHAR" />
    <result column="pl_name_height" property="plNameHeight" jdbcType="INTEGER" />
    <result column="pl_name_width" property="plNameWidth" jdbcType="INTEGER" />
    <result column="free_height" property="freeHeight" jdbcType="INTEGER" />
    <result column="free_width" property="freeWidth" jdbcType="INTEGER" />
    <result column="data_status" property="dataStatus" jdbcType="INTEGER" />
    <result column="create_op" property="createOp" jdbcType="BIGINT" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="modify_op" property="modifyOp" jdbcType="BIGINT" />
    <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
  </resultMap> 
    <!-- 数据同步-获取停车场信息 -->
    <select id="getParkingLots" parameterType="com.zteits.clouds.api.dto.syncdata.param.GetParkingLotsRequest" resultMap="BaseGetParkingLotsResultMap">
	    SELECT
			lot.*,geo.lon_id,geo.lat_id
		FROM
			parking_lot lot
			LEFT JOIN parking_lot_geo geo ON lot.pl_no = geo.pl_no 
			AND geo.data_status = 1 
			AND geo.lon_lat_type = 1 
		WHERE
			lot.pl_province_id = #{provId}
			AND lot.pl_city_id = #{cityId}
			AND lot.data_status = 1
    </select>
    
    <!-- 数据同步-获取停车场泊位信息 -->
    <select id="getParkingLotBerths" parameterType="com.zteits.clouds.api.dto.syncdata.param.GetParkingLotBerthsRequest" 
    resultMap="BaseGetParkingLotBerthsResultMap">
	    select b.* from tp_p_berths b where b.data_state = 1 and b.pl_no = #{parkCode}
    </select>
    
    <!-- 数据同步-获取停车场设备信息 -->
    <select id="getParkingLotEqps" parameterType="com.zteits.clouds.api.dto.syncdata.param.GetParkingLotEqpsRequest" 
    resultMap="BaseGetParkingLotEqpsResultMap">
	    select b.* from tp_p_eqp b where b.data_state = 1 and b.pl_no = #{parkCode}
    </select>
    
    <!-- 数据同步-获取停车场设备信息 -->
    <select id="getGuideScreens" parameterType="com.zteits.clouds.api.dto.syncdata.param.GetGuideScreensRequest" 
    resultMap="BaseGetGuideScreensResultMap">
	    SELECT
			sc.*,
			rel.guide_no          as rel_guide_no,
			rel.pl_no             as rel_pl_no,
			rel.pl_name           as rel_pl_name,
			rel.berth_num         as rel_berth_num,
			rel.floor_status      as rel_floor_status,
			rel.floor             as rel_floor,
			rel.high_limit_status as rel_high_limit_status,
			rel.high_limit_num    as rel_high_limit_num,
			rel.sharp_turn_status as rel_sharp_turn_status,
			rel.time_system       as rel_time_system,
			rel.guide_point       as rel_guide_point,
			rel.data_status       as rel_data_status,
			rel.create_time       as rel_create_time,
			rel.modify_time       as rel_modify_time,
			cof.guide_no          as cof_guide_no,
			cof.pl_no             as cof_pl_no,
			cof.pl_name_height    as cof_pl_name_height,
			cof.pl_name_width     as cof_pl_name_width,
			cof.free_height       as cof_free_height,
			cof.free_width        as cof_free_width,
			cof.data_status       as cof_data_status,
			cof.create_time       as cof_create_time,
			cof.modify_time       as cof_modify_time
		FROM
			td_g_guide_screen sc
			LEFT JOIN td_g_guide_park_rel rel ON sc.guide_no = rel.guide_no 
			AND rel.data_status = 1 
			left join td_g_first_guide_info_config cof on sc.guide_no = cof.guide_no and cof.data_status = 1
		WHERE
			sc.data_status = 1 
			AND province_id = #{provId}
			AND city_id = #{cityId}
    </select>
</mapper>