|
@@ -1,6 +1,6 @@
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?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">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
-<mapper namespace="GoodsOrderInfoMapper">
|
|
+<mapper namespace="com.hcloud.microserver.system.bank.dao.GoodsOrderInfoMapper">
|
|
<resultMap id="BaseResultMap" type="GoodsOrderInfo">
|
|
<resultMap id="BaseResultMap" type="GoodsOrderInfo">
|
|
<id column="guid" jdbcType="CHAR" property="guid" />
|
|
<id column="guid" jdbcType="CHAR" property="guid" />
|
|
<result column="fk_customer_guid" jdbcType="CHAR" property="fkCustomerGuid" />
|
|
<result column="fk_customer_guid" jdbcType="CHAR" property="fkCustomerGuid" />
|
|
@@ -16,11 +16,12 @@
|
|
<result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
|
|
<result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
|
|
<result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
|
|
<result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
|
|
<result column="pay_no" jdbcType="VARCHAR" property="payNo" />
|
|
<result column="pay_no" jdbcType="VARCHAR" property="payNo" />
|
|
|
|
+ <result column="order_type" jdbcType="INTEGER" property="orderType" />
|
|
</resultMap>
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
<sql id="Base_Column_List">
|
|
guid, fk_customer_guid, order_no,customer_name,customer_type, order_amount,
|
|
guid, fk_customer_guid, order_no,customer_name,customer_type, order_amount,
|
|
order_carbon_amount, order_status,state, create_user, create_time, modified_user,
|
|
order_carbon_amount, order_status,state, create_user, create_time, modified_user,
|
|
- modified_time,pay_no
|
|
+ modified_time,pay_no,order_type
|
|
</sql>
|
|
</sql>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
select
|
|
select
|
|
@@ -132,12 +133,12 @@
|
|
insert into t_goods_order_info (guid, fk_customer_guid, order_no,
|
|
insert into t_goods_order_info (guid, fk_customer_guid, order_no,
|
|
customer_name,customer_type,order_amount, order_carbon_amount, order_status,
|
|
customer_name,customer_type,order_amount, order_carbon_amount, order_status,
|
|
state, create_user, create_time,
|
|
state, create_user, create_time,
|
|
- modified_user, modified_time,pay_no)
|
|
+ modified_user, modified_time,pay_no,order_type)
|
|
values (#{guid,jdbcType=CHAR}, #{fkCustomerGuid,jdbcType=CHAR}, #{orderNo,jdbcType=CHAR},
|
|
values (#{guid,jdbcType=CHAR}, #{fkCustomerGuid,jdbcType=CHAR}, #{orderNo,jdbcType=CHAR},
|
|
#{customerName,jdbcType=VARCHAR},#{customerType,jdbcType=VARCHAR},#{orderAmount,jdbcType=DECIMAL},
|
|
#{customerName,jdbcType=VARCHAR},#{customerType,jdbcType=VARCHAR},#{orderAmount,jdbcType=DECIMAL},
|
|
#{orderCarbonAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER},
|
|
#{orderCarbonAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER},
|
|
#{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
#{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
- #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP},#{payNo,jdbcType=VARCHAR})
|
|
+ #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP},#{payNo,jdbcType=VARCHAR},#{orderType,jdbcType=INTEGER})
|
|
</insert>
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="GoodsOrderInfo">
|
|
<insert id="insertSelective" parameterType="GoodsOrderInfo">
|
|
insert into t_goods_order_info
|
|
insert into t_goods_order_info
|
|
@@ -184,6 +185,9 @@
|
|
<if test="payNo != null">
|
|
<if test="payNo != null">
|
|
pay_no,
|
|
pay_no,
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="orderType != null">
|
|
|
|
+ order_type,
|
|
|
|
+ </if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="guid != null">
|
|
<if test="guid != null">
|
|
@@ -228,6 +232,9 @@
|
|
<if test="payNo != null">
|
|
<if test="payNo != null">
|
|
#{payNo,jdbcType=VARCHAR},
|
|
#{payNo,jdbcType=VARCHAR},
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="orderType != null">
|
|
|
|
+ #{orderType,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="GoodsOrderInfo">
|
|
<update id="updateByPrimaryKeySelective" parameterType="GoodsOrderInfo">
|
|
@@ -272,6 +279,9 @@
|
|
<if test="payNo != null">
|
|
<if test="payNo != null">
|
|
pay_no = #{payNo,jdbcType=VARCHAR},
|
|
pay_no = #{payNo,jdbcType=VARCHAR},
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="orderType != null">
|
|
|
|
+ order_type = #{orderType,jdbcType=INTEGER},
|
|
|
|
+ </if>
|
|
</set>
|
|
</set>
|
|
where guid = #{guid,jdbcType=CHAR}
|
|
where guid = #{guid,jdbcType=CHAR}
|
|
</update>
|
|
</update>
|
|
@@ -290,6 +300,7 @@
|
|
modified_user = #{modifiedUser,jdbcType=CHAR},
|
|
modified_user = #{modifiedUser,jdbcType=CHAR},
|
|
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
|
|
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
|
|
pay_no = #{payNo,jdbcType=VARCHAR}
|
|
pay_no = #{payNo,jdbcType=VARCHAR}
|
|
|
|
+ order_type = #{orderType,jdbcType=INTEGER}
|
|
where guid = #{guid,jdbcType=CHAR}
|
|
where guid = #{guid,jdbcType=CHAR}
|
|
</update>
|
|
</update>
|
|
<update id="updateOrderBelongInfo">
|
|
<update id="updateOrderBelongInfo">
|
|
@@ -297,4 +308,104 @@
|
|
set fk_customer_guid = #{newId}
|
|
set fk_customer_guid = #{newId}
|
|
where fk_customer_guid = #{oldId}
|
|
where fk_customer_guid = #{oldId}
|
|
</update>
|
|
</update>
|
|
|
|
+
|
|
|
|
+ <select id="offlineOrderList" parameterType="com.hcloud.microserver.commoncore.base.PageBean" resultType="OfflineOrderBO">
|
|
|
|
+ SELECT o.guid,
|
|
|
|
+ o.order_no AS orderNo,
|
|
|
|
+ o.order_amount AS orderAmount,
|
|
|
|
+ o.order_carbon_amount AS orderCarbonAmount,
|
|
|
|
+ o.create_time AS createTime,
|
|
|
|
+ CASE o.order_type
|
|
|
|
+ WHEN 1 THEN
|
|
|
|
+ '线上订单'
|
|
|
|
+ WHEN 1 THEN
|
|
|
|
+ '认购订单'
|
|
|
|
+ ELSE
|
|
|
|
+ '后台订单'
|
|
|
|
+ END AS orderType,
|
|
|
|
+ CASE o.order_status
|
|
|
|
+ WHEN 1 THEN
|
|
|
|
+ '未付款'
|
|
|
|
+ WHEN 2 THEN
|
|
|
|
+ '已完成'
|
|
|
|
+ WHEN 3 THEN
|
|
|
|
+ '未审核'
|
|
|
|
+ WHEN 4 THEN
|
|
|
|
+ '等待打款'
|
|
|
|
+ ELSE
|
|
|
|
+ '等待再审核'
|
|
|
|
+ END AS orderStatus,
|
|
|
|
+ c.account,
|
|
|
|
+ c.customer_name AS customerName,
|
|
|
|
+ gc.guid AS credentialNo
|
|
|
|
+ FROM t_goods_order_info o LEFT JOIN t_customer_info c ON o.fk_customer_guid = c.guid
|
|
|
|
+ LEFT JOIN t_goods_credential_info gc ON gc.fk_order_id = o.guid
|
|
|
|
+ WHERE o.state=1 AND order_type!=0
|
|
|
|
+ <if test="data.customerName!=null and data.customerName!=''">
|
|
|
|
+ AND c.customer_name LIKE concat('%', #{data.customerName}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="data.account!=null and data.account!=''">
|
|
|
|
+ AND c.account=#{data.account}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="data.orderNo!=null and data.orderNo != ''">
|
|
|
|
+ AND o.order_no=#{data.orderNo}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="data.orderStatus !=null and data.orderStatus != ''">
|
|
|
|
+ AND o.order_status=#{data.orderStatus};
|
|
|
|
+ </if>
|
|
|
|
+ ORDER BY o.create_time DESC
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="queryOfflineOrderDetial" parameterType="String" resultType="OfflineOrderDetailBO">
|
|
|
|
+ SELECT o.guid,
|
|
|
|
+ o.order_no AS orderNo,
|
|
|
|
+ o.order_amount AS orderAmount,
|
|
|
|
+ o.order_carbon_amount AS orderCarbonAmount,
|
|
|
|
+ o.create_time AS createTime,
|
|
|
|
+ CASE o.order_type
|
|
|
|
+ WHEN 1 THEN
|
|
|
|
+ '线上订单'
|
|
|
|
+ WHEN 1 THEN
|
|
|
|
+ '认购订单'
|
|
|
|
+ ELSE
|
|
|
|
+ '后台订单'
|
|
|
|
+ END AS orderType,
|
|
|
|
+ CASE o.order_status
|
|
|
|
+ WHEN 1 THEN
|
|
|
|
+ '未付款'
|
|
|
|
+ WHEN 2 THEN
|
|
|
|
+ '已完成'
|
|
|
|
+ WHEN 3 THEN
|
|
|
|
+ '未审核'
|
|
|
|
+ WHEN 4 THEN
|
|
|
|
+ '等待打款'
|
|
|
|
+ ELSE
|
|
|
|
+ '等待再审核'
|
|
|
|
+ END AS orderStatus,
|
|
|
|
+ CASE p.pay_channel
|
|
|
|
+ WHEN 1 THEN
|
|
|
|
+ '微信支付'
|
|
|
|
+ WHEN 2 THEN
|
|
|
|
+ '支付宝'
|
|
|
|
+ WHEN 3 THEN
|
|
|
|
+ '银联支付'
|
|
|
|
+ ELSE
|
|
|
|
+ '线下支付'
|
|
|
|
+ END AS payChannel,
|
|
|
|
+ c.account,
|
|
|
|
+ c.customer_name AS customerName,
|
|
|
|
+ c.phone,
|
|
|
|
+ CASE c.customer_type
|
|
|
|
+ WHEN 1 THEN
|
|
|
|
+ '自然人'
|
|
|
|
+ WHEN 2 THEN
|
|
|
|
+ '履约企业'
|
|
|
|
+ ELSE
|
|
|
|
+ '非履约企业'
|
|
|
|
+ END AS customerTypeName,
|
|
|
|
+ o.pay_no AS payNo
|
|
|
|
+ FROM t_goods_order_info o LEFT JOIN t_customer_info c ON o.fk_customer_guid = c.guid
|
|
|
|
+ LEFT JOIN t_goods_pay_order p ON p.fk_order_id = o.guid
|
|
|
|
+ WHERE o.guid= #{guid}
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|