ParkOrderWhiteSMapper.xml 6.62 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.order.mapper.smapper.ParkOrderWhiteSMapper">
  <resultMap id="BaseResultMap" type="com.zteits.order.domain.ParkOrderWhite">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="order_id" jdbcType="VARCHAR" property="orderId" />
    <result column="source_type" jdbcType="INTEGER" property="sourceType" />
    <result column="order_total_fee" jdbcType="BIGINT" property="orderTotalFee" />
    <result column="order_act_fee" jdbcType="BIGINT" property="orderActFee" />
    <result column="cust_id" jdbcType="VARCHAR" property="custId" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="car_number" jdbcType="VARCHAR" property="carNumber" />
    <result column="berth_range_no" jdbcType="VARCHAR" property="berthRangeNo" />
    <result column="berth_range_name" jdbcType="VARCHAR" property="berthRangeName" />
    <result column="berth_no" jdbcType="VARCHAR" property="berthNo" />
    <result column="park_in_time" jdbcType="TIMESTAMP" property="parkInTime" />
    <result column="park_out_time" jdbcType="TIMESTAMP" property="parkOutTime" />
    <result column="park_in_source_code" jdbcType="VARCHAR" property="parkInSourceCode" />
    <result column="park_in_source_name" jdbcType="VARCHAR" property="parkInSourceName" />
    <result column="park_out_source_code" jdbcType="VARCHAR" property="parkOutSourceCode" />
    <result column="park_out_source_name" jdbcType="VARCHAR" property="parkOutSourceName" />
    <result column="parking_duration" jdbcType="BIGINT" property="parkingDuration" />
    <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_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_emp_id" jdbcType="VARCHAR" property="modfiyEmpId" />
    <result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="org_name" jdbcType="VARCHAR" property="orgName" />
  </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">
    id, order_id, source_type, order_total_fee, order_act_fee, cust_id, pl_no, pl_name, 
    car_number, berth_range_no, berth_range_name, berth_no, park_in_time, park_out_time, 
    park_in_source_code, park_in_source_name, park_out_source_code, park_out_source_name, 
    parking_duration, data_state, create_emp_id, create_emp_name, create_date, modfiy_emp_id, 
    modfiy_emp_name, modfiy_date, remark, org_id, org_name
  </sql>

  <select id="queryParkOrderWhiteByCondition" parameterType="com.zteits.clouds.api.dto.order.parkorder.param.ParkOrderWhiteByConditionRequest" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from park_order_white o
    where 1=1
    <if test="orderId !=null">
      and   o.order_id = #{orderId}
    </if>

    <if test="plNos != null and plNos.size >0 ">
      AND o.pl_no IN
      <foreach collection="plNos" item="plNo" index="index" open="(" close=")" separator=",">
        /*停车场编号*/
        #{plNo}
      </foreach>
    </if>
    <if test="berthNos != null and berthNos.size >0 ">
      AND o.berth_no IN
      <foreach collection="berthNos" item="berthNo" index="index" open="(" close=")" separator=",">
        /*停车场编号*/
        #{berthNo}
      </foreach>
    </if>
    <if test="beginInTime !=null">
      /*进场时间*/
      AND o.park_in_time &gt;= #{beginInTime}
    </if>
    <if test="endInTime !=null">
      /*进场时间*/
      AND o.park_in_time &lt;= #{endInTime}
    </if>
    <if test="beginOutTime != null">
      /*出场时间*/
      AND o.park_out_time &gt;= #{beginOutTime}
    </if>
    <if test="endOutTime != null">
      /*出场时间*/
      AND o.park_out_time &lt;= #{endOutTime}
    </if>
    <if test="carNum !=null and carNum !=''">
      AND o.car_number like CONCAT(#{carNum},'%')
    </if>
    order by o.id desc
  </select>
</mapper>