TdBParkCardCustSMapper.xml 4.45 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.pay.mapper.smapper.TdBParkCardCustSMapper" >
  <!-- <resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdBParkCardCust" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="cust_id" property="custId" jdbcType="VARCHAR" />
    <result column="pl_no" property="plNo" jdbcType="VARCHAR" />
    <result column="card_no" property="cardNo" jdbcType="VARCHAR" />
    <result column="car_number" property="carNumber" jdbcType="VARCHAR" />
    <result column="opt_type" property="optType" jdbcType="INTEGER" />
    <result column="push_state" property="pushState" jdbcType="INTEGER" />
    <result column="price" property="price" jdbcType="BIGINT" />
    <result column="num" property="num" jdbcType="INTEGER" />
    <result column="discount_amount" property="discountAmount" jdbcType="BIGINT" />
    <result column="discount_no" property="discountNo" jdbcType="VARCHAR" />
    <result column="total_amount" property="totalAmount" jdbcType="BIGINT" />
    <result column="eff_date" property="effDate" jdbcType="TIMESTAMP" />
    <result column="exp_date" property="expDate" jdbcType="TIMESTAMP" />
    <result column="data_state" property="dataState" jdbcType="INTEGER" />
    <result column="create_empid" property="createEmpid" jdbcType="BIGINT" />
    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
    <result column="modify_empid" property="modifyEmpid" jdbcType="BIGINT" />
    <result column="modify_date" property="modifyDate" jdbcType="TIMESTAMP" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.zteits.pay.domain.TdBParkCardCust" extends="BaseResultMap" >
    <result column="remark" property="remark" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, cust_id, pl_no, card_no, car_number, push_state,opt_type, price, num, discount_amount, 
    discount_no, total_amount, eff_date, exp_date, data_state, create_empid, create_date, 
    modify_empid, modify_date
  </sql>
  <sql id="Blob_Column_List" >
    remark
  </sql>
  <select id="queryCardCustListByCustId" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from td_b_park_card_cust
    where data_state =1 
    	  and  cust_id = #{custId,jdbcType=BIGINT}
    	  order by create_date desc
  </select>
  
  通过车牌获取个人购卡信息
  <select id="queryCardPersonCustByCarNum" parameterType="java.lang.String" resultMap="BaseResultMap">
       select 
    <include refid="Base_Column_List" />
    from td_b_park_card_cust
    where car_number = #{carNum}
    limit 0,1
  </select>
  
  
   <select id="queryCarnNoPush" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from td_b_park_card_cust
    where data_state =1 
    	  and  push_state = 1
    	  order by create_date desc
  </select>
  
  
  会员卡查询-旧的,适用于无锡微纳园
  <select id="queryParkCardCustInfoPage" resultType="com.zteits.pay.domain.VipCardBuyInfoDO" parameterType="com.zteits.clouds.api.dto.bill.vipcard.param.QueryVipCardBuyInfoForPageRequest">
        select 
		 b.user_phone     as personCustName,
		 a.card_no        as custCardNo,
		 c.card_type      as cardType,
	     a.cust_id        as personCustId,
	     a.car_number     as carNumber,
	     a.num            as num,
	     a.price          as price,
	     a.total_amount   as totalAmount,
	     a.eff_date       as effDate,
	     a.exp_date       as expDate,
	     a.create_date    as createDate,
	     a.create_empid   as createEmpid
		from td_b_park_card_cust a LEFT JOIN td_b_park_card c on a.card_no = c.card_no,
		 td_c_cust_person b
		where a.data_state = 1 and b.data_state = 1 and a.cust_id = b.cust_id
        <if test="carNum != null and carNum != ''">
            and a.car_number = #{carNum}
        </if>
        and a.pl_no in
        <foreach collection="plNos" open="(" close=")" item="plNo" separator=",">
            #{plNo}
        </foreach>
        <if test="beginTime != null ">
            <![CDATA[ and a.create_date >= #{beginTime}  ]]>
        </if>
        <if test="endTime != null ">
            <![CDATA[ and a.create_date <= #{endTime}  ]]>
        </if> 
    </select> -->
</mapper>