ParkCardSmapper.xml 2.88 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.ParkCardSmapper">
    <resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdBParkCard" >
        <id column="id" property="id" jdbcType="BIGINT" />
        <result column="card_no" property="cardNo" jdbcType="VARCHAR" />
        <result column="card_name" property="cardName" jdbcType="VARCHAR" />
        <result column="car_type" property="carType" jdbcType="INTEGER" />
        <result column="card_type" property="cardType" jdbcType="INTEGER" />
        <result column="valid_unit" property="validUnit" jdbcType="INTEGER" />
        <result column="valid_num" property="validNum" jdbcType="INTEGER" />
        <result column="price" property="price" jdbcType="BIGINT" />
        <result column="eff_date" property="effDate" jdbcType="TIMESTAMP" />
        <result column="exp_date" property="expDate" jdbcType="TIMESTAMP" />
        <result column="card_status" property="cardStatus" jdbcType="INTEGER" />
        <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.TdBParkCard" extends="BaseResultMap" >
        <result column="remark" property="remark" jdbcType="LONGVARCHAR" />
    </resultMap>
    <sql id="Base_Column_List" >
        id, card_no, card_name, car_type, card_type, valid_unit, valid_num, price, eff_date,
        exp_date, card_status, data_state, create_empid, create_date, modify_empid, modify_date
    </sql>
    <sql id="Blob_Column_List" >
    remark
  </sql>


    <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List"/>
        ,
        <include refid="Blob_Column_List"/>
        from td_b_park_card
        where id = #{id,jdbcType=BIGINT}
    </select>


    <select id="queryParkCardByCardNos" resultMap="ResultMapWithBLOBs" parameterType="java.util.List">
        SELECT
        <include refid="Base_Column_List"/>
        ,
        <include refid="Blob_Column_List"/>

        FROM td_b_park_card
        WHERE data_state = 1
        AND card_no IN
        <foreach collection="cardNos" index="index" item="cardNo" open="(" close=")" separator=",">
            #{cardNo}
        </foreach>
        AND eff_date &lt;= now()
        AND exp_date &gt;= now()
        <if test="cardStatus != null">
            AND card_status = #{cardStatus}
        </if>

    </select>


</mapper>