TBillingPrepaymentSMapper.xml 1.96 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.bill.mapper.smapper.TBillingPrepaymentSMapper">
    <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TBillingPrepayment">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="pl_no" property="plNo" jdbcType="VARCHAR"/>
        <result column="pl_name" property="plName" jdbcType="VARCHAR"/>
        <result column="car_type" property="carType" jdbcType="INTEGER"/>
        <result column="prepayment" property="prepayment" jdbcType="BIGINT"/>
        <result column="effect_time" property="effectTime" jdbcType="TIMESTAMP"/>
        <result column="expire_time" property="expireTime" jdbcType="TIMESTAMP"/>
        <result column="create_op" property="createOp" jdbcType="INTEGER"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="modify_op" property="modifyOp" jdbcType="INTEGER"/>
        <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Base_Column_List">
    id, pl_no, pl_name, car_type, prepayment, effect_time, expire_time, create_op, create_time, 
    modify_op, modify_time
  </sql>


    <select id="queryBillingPrepayment" resultMap="BaseResultMap">

        SELECT
        <include refid="Base_Column_List"/>
        FROM t_billing_prepayment t
        WHERE t.effect_time &lt;= now() AND t.expire_time &gt;= now()
        AND t.pl_no = #{plNo}
        AND t.car_type = #{carType}
        ORDER BY t.effect_time desc

    </select>


    <select id="queryBillingPrepaymentInfo" resultMap="BaseResultMap">

        SELECT
        <include refid="Base_Column_List"/>
        FROM t_billing_prepayment t
        WHERE t.effect_time &lt;= now() AND t.expire_time &gt;= now()
        AND t.pl_no = #{plNo}
        ORDER BY t.effect_time desc

    </select>

</mapper>