ParkingListMapper.xml 9.41 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.ParkingListMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.ParkingList">
    <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="pl_out_no" jdbcType="VARCHAR" property="plOutNo" />
    <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_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_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_area_block_id" jdbcType="BIGINT" property="plAreaBlockId" />
    <result column="pl_area_block_name" jdbcType="VARCHAR" property="plAreaBlockName" />
    <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="is_special" jdbcType="INTEGER" property="isSpecial" />
    <result column="push_state" jdbcType="INTEGER" property="pushState" />
    <result column="parent_pl_no" jdbcType="VARCHAR" property="parentPlNo" />
    <result column="pl_category" jdbcType="INTEGER" property="plCategory" />
    <result column="area_type" jdbcType="INTEGER" property="areaType" />
    <result column="area_card_limit_num" jdbcType="INTEGER" property="areaCardLimitNum" />
    <result column="support_etc" jdbcType="INTEGER" property="supportEtc" />
    <result column="park_position" jdbcType="INTEGER" property="parkPosition" />
    <result column="parent_id" jdbcType="INTEGER" property="parentId" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    pl_id, pl_name, pl_no, pl_out_no, state, source_type, pl_province_id, pl_province_name, 
    pl_city_id, pl_city_name, pl_country_id, pl_country_name, pl_address, pl_berth_num, 
    pl_pay_type, pl_charge_num, pl_type, pl_type_prop, pl_busi_time_start, pl_busi_time_end, 
    pl_entrance_num, pl_exit_num, data_status, create_time, create_op, modify_time, modify_op, 
    pl_rate, service_tel, pl_picture_path, busi_circle, remark, pl_area_block_id, pl_area_block_name, 
    pl_busi_type, org_id, org_name, is_special, push_state, parent_pl_no, pl_category, 
    area_type, area_card_limit_num, support_etc, park_position
  </sql>
  <select id="QueryParkingList" parameterType="com.zteits.park.domain.ParkingListExample" resultType="com.zteits.clouds.api.dto.park.dto.ParkingListDTO">
    select
      pl_id plId, pl_name plName, pl_no plNo,pl_city_name plCityName,pl_berth_num plBerthNum,pl_country_name plCountryName,
      pl_province_name plProvinceName,pl_city_id plCityId,pl_country_id plCountryId,pl_province_id plProvinceId
    from parking_lot

      <if test="_parameter != null">
          <include refid="Example_Where_Clause" />
      </if>
  <!--    <if test="orderByClause != null">
          order by ${orderByClause}
      </if>-->
      order by CONVERT(pl_name USING gbk) ASC
  </select>

    <select id="initSpecialCarTree" parameterType="com.zteits.clouds.api.dto.bill.closecarpark.param.InitSpecialCarTreeRequest" resultMap="BaseResultMap">
        select
        pl_id,
        pl_name,
        pl_no,
        pl_city_name,
        state,
        source_type,
        pl_province_id,
        pl_province_name,
        pl_city_id,
        pl_city_name,
        pl_country_id,
        pl_country_name,
        pl_country_id as parent_id
        from parking_lot
        <where>
            data_status = 1
            <if test="orgId != null">
                and  org_id = #{orgId}
            </if>
            <if test="sourceTypes != null and sourceTypes.size >0">
                and source_type in
                <foreach collection="sourceTypes" open="("  close=")" item="sourceType" separator=",">
                    #{sourceType}
                </foreach>
            </if>
            <if test="plNos != null and plNos.size > 0 ">
                and  pl_no in
                <foreach collection="plNos" open="("  close=")" item="plNo" separator=",">
                    #{plNo}
                </foreach>
            </if>
        </where>
    </select>


    <select id="initCloseParkingBindTree" parameterType="com.zteits.clouds.api.dto.bill.closecarpark.param.InitSpecialCarTreeRequest" resultMap="BaseResultMap">
        SELECT
        l.pl_id,
        l.pl_name,
        l.pl_no,
        l.pl_city_name,
        l.state,
        l.source_type,
        l.pl_province_id,
        l.pl_province_name,
        l.pl_city_id,
        l.pl_city_name,
        l.pl_country_id,
        l.pl_country_name,
        l.pl_country_id AS parent_id
        FROM
        parking_lot l
        <where>
            l.data_status = 1
            <if test="orgId != null">
                and  l.org_id = #{orgId}
            </if>
            <if test="sourceTypeList != null and sourceTypeList.size >0">
                and l.source_type in
                <foreach collection="sourceTypeList" open="("  close=")" item="sourceType" separator=",">
                    #{sourceType}
                </foreach>
            </if>
        </where>
    </select>

</mapper>