|
@@ -1,7 +1,7 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.yijia.station.mapper.PayOrderMapper">
|
|
|
|
|
|
<resultMap type="PayOrder" id="PayOrderResult">
|
|
@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="orderNo" column="order_no" />
|
|
|
<result property="oilGun" column="oil_gun" />
|
|
|
<result property="oilName" column="oil_name" />
|
|
|
+ <result property="oilPirce" column="oil_pirce" />
|
|
|
<result property="consumerId" column="consumer_id" />
|
|
|
<result property="consumer" column="consumer" />
|
|
|
<result property="amt" column="amt" />
|
|
@@ -21,10 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="oilPersonnel" column="oil_personnel" />
|
|
|
<result property="createdDate" column="created_date" />
|
|
|
<result property="orderType" column="order_type" />
|
|
|
+ <result property="stationName" column="station_name" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectPayOrderVo">
|
|
|
- select order_id, order_no, oil_gun, oil_name, consumer_id, consumer, amt, station_id, status, order_liters, pay_type, pay_way, pay_date, oil_personnel, created_date, order_type from pay_order
|
|
|
+ select order_id, order_no, oil_gun, oil_name, oil_pirce, consumer_id, consumer, amt, station_id, status, order_liters, pay_type, pay_way, pay_date, oil_personnel, created_date, order_type, station_name from pay_order
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
|
|
@@ -41,9 +43,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="orderLiters != null and orderLiters != ''"> and order_liters = #{orderLiters}</if>
|
|
|
<if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
|
|
|
<if test="payWay != null and payWay != ''"> and pay_way = #{payWay}</if>
|
|
|
- <if test="payDate != null "> and pay_date = #{payDate}</if>
|
|
|
+
|
|
|
+ <if test="beginTime != null and beginTime != ''">
|
|
|
+ AND date_format(created_date,'%y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND date_format(created_date,'%y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
|
|
|
+ </if>
|
|
|
+ <if test="stationName != null and stationName != ''">
|
|
|
+ AND station_name LIKE CONCAT('%', #{stationName}, '%')
|
|
|
+ </if>
|
|
|
<if test="oilPersonnel != null and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
|
|
|
- <if test="createdDate != null "> and created_date = #{createdDate}</if>
|
|
|
<if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
|
|
|
</where>
|
|
|
ORDER BY created_date DESC
|
|
@@ -60,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="orderNo != null">order_no,</if>
|
|
|
<if test="oilGun != null">oil_gun,</if>
|
|
|
<if test="oilName != null">oil_name,</if>
|
|
|
+ <if test="oilPirce != null">oil_pirce,</if>
|
|
|
<if test="consumerId != null">consumer_id,</if>
|
|
|
<if test="consumer != null">consumer,</if>
|
|
|
<if test="amt != null">amt,</if>
|
|
@@ -72,11 +83,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="oilPersonnel != null">oil_personnel,</if>
|
|
|
<if test="createdDate != null">created_date,</if>
|
|
|
<if test="orderType != null">order_type,</if>
|
|
|
- </trim>
|
|
|
+ <if test="stationName != null">station_name,</if>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="orderNo != null">#{orderNo},</if>
|
|
|
<if test="oilGun != null">#{oilGun},</if>
|
|
|
<if test="oilName != null">#{oilName},</if>
|
|
|
+ <if test="oilPirce != null">#{oilPirce},</if>
|
|
|
<if test="consumerId != null">#{consumerId},</if>
|
|
|
<if test="consumer != null">#{consumer},</if>
|
|
|
<if test="amt != null">#{amt},</if>
|
|
@@ -89,7 +102,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="oilPersonnel != null">#{oilPersonnel},</if>
|
|
|
<if test="createdDate != null">#{createdDate},</if>
|
|
|
<if test="orderType != null">#{orderType},</if>
|
|
|
- </trim>
|
|
|
+ <if test="stationName != null">#{stationName},</if>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updatePayOrder" parameterType="PayOrder">
|
|
@@ -98,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="orderNo != null">order_no = #{orderNo},</if>
|
|
|
<if test="oilGun != null">oil_gun = #{oilGun},</if>
|
|
|
<if test="oilName != null">oil_name = #{oilName},</if>
|
|
|
+ <if test="oilPirce != null">oil_pirce = #{oilPirce},</if>
|
|
|
<if test="consumerId != null">consumer_id = #{consumerId},</if>
|
|
|
<if test="consumer != null">consumer = #{consumer},</if>
|
|
|
<if test="amt != null">amt = #{amt},</if>
|
|
@@ -110,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="oilPersonnel != null">oil_personnel = #{oilPersonnel},</if>
|
|
|
<if test="createdDate != null">created_date = #{createdDate},</if>
|
|
|
<if test="orderType != null">order_type = #{orderType},</if>
|
|
|
+ <if test="stationName != null">station_name = #{stationName},</if>
|
|
|
</trim>
|
|
|
where order_id = #{orderId}
|
|
|
</update>
|