|
@@ -20,7 +20,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="goodsType" column="goods_type"/>
|
|
|
</resultMap>
|
|
|
|
|
|
- <select id="selectList" parameterType="com.zhongzheng.modules.order.bo.OrderHandleQueryBo" resultType="com.zhongzheng.modules.order.vo.OrderHandleVo">
|
|
|
+
|
|
|
+ <resultMap type="com.zhongzheng.modules.order.vo.OrderHandleGoodsVo" id="OrderHandleGoodsVoResult">
|
|
|
+ <result property="realname" column="realname"/>
|
|
|
+ <result property="telPhone" column="telphone" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
|
|
|
+ <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
|
|
|
+ <result property="goodsName" column="goods_name"/>
|
|
|
+ <result property="year" column="year"/>
|
|
|
+ <result property="goodsRealPrice" column="goods_real_price"/>
|
|
|
+ <result property="orderGoodsId" column="order_goods_id"/>
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="gradeId" column="grade_id"/>
|
|
|
+ <result property="goodsId" column="goods_id"/>
|
|
|
+ <result property="subjectNames" column="subject_names"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="selectOrderList" parameterType="com.zhongzheng.modules.order.bo.OrderHandleQueryBo" resultType="com.zhongzheng.modules.order.vo.OrderHandleVo">
|
|
|
SELECT u.*,
|
|
|
(select count( DISTINCT o.user_id ) from `order` o where u.handle_order_sn = o.handle_order_sn) user_num,
|
|
|
(select count( DISTINCT og.goods_id ) from `order` o LEFT JOIN order_goods og ON o.order_sn = og.order_sn where u.handle_order_sn = o.handle_order_sn) goods_num,
|
|
@@ -40,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND oh.education_type_id = #{educationTypeId}
|
|
|
</if>
|
|
|
<if test="searchKey != null and searchKey != ''">
|
|
|
- AND (oh.create_username like concat('%', #{searchKey}, '%') or oh.handle_order_sn = #{searchKey})
|
|
|
+ AND (select count(*) from `order` o left JOIN `user` u on o.user_id = u.user_id left JOIN order_goods og on o.order_sn = og.order_sn LEFT JOIN goods g on og.goods_id = g.goods_id where o.handle_order_sn = oh.handle_order_sn and (u.realname like concat('%', #{searchKey}, '%') or (u.id_card = #{searchKey,typeHandler=com.zhongzheng.common.type.EncryptHandler}) or (g.goods_name like concat('%', #{searchKey}, '%'))))>0
|
|
|
</if>
|
|
|
<if test="goodsType != null">
|
|
|
AND oh.goods_type = #{goodsType}
|
|
@@ -51,16 +66,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="handleOrderSn != null and handleOrderSn != ''">
|
|
|
AND oh.handle_order_sn = #{handleOrderSn}
|
|
|
</if>
|
|
|
- <if test="refundStatus != null and refundStatus != ''">
|
|
|
+ <if test="refundStatus != null">
|
|
|
AND oh.refund_status = #{refundStatus}
|
|
|
</if>
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
- AND oh.check_time >= #{refundStatus}
|
|
|
+ AND oh.check_time >= #{startTime}
|
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- AND oh.check_time <= #{refundStatus}
|
|
|
+ AND oh.check_time <= #{endTime}
|
|
|
</if>
|
|
|
- <if test="payStatus != null and payStatus != ''">
|
|
|
+ <if test="payStatus != null">
|
|
|
AND oh.pay_status = #{payStatus}
|
|
|
</if>)u
|
|
|
LEFT JOIN course_education_type cet ON u.education_type_id = cet.id
|
|
@@ -91,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
ORDER BY u.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectOrderGoodsList" parameterType="com.zhongzheng.modules.order.bo.OrderHandleQueryBo" resultType="com.zhongzheng.modules.order.vo.OrderHandleGoodsVo">
|
|
|
+ <select id="selectOrderGoodsList" parameterType="com.zhongzheng.modules.order.bo.OrderHandleQueryBo" resultMap="OrderHandleGoodsVoResult">
|
|
|
SELECT
|
|
|
u.realname,
|
|
|
u.id_card,
|