IMMyCommentMapper.xml
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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.sibu.orderHelper.integral.dao.IMMyCommentDao">
<!-- 评论列表查询-->
<select id="listMyComments" parameterType="map" resultMap="listOrder1sProduct">
select do1.order1_id,do1.member_id,do1.order_id,do1.sort_index,do1.product_id,
do1.purchase_quantity,do1.shipped_quantity,do1.integral,do1.line_integral,do1.price,do1.line_price,do1.is_evaluate,
do1.name,do1.market_price,do1.thumb_img
from ${doingOrder1Table} do1
left join ${doingOrderTable} do on do1.order_id = do.order_id
where do1.member_id = #{memberId} and do.delete_flag = 1 and do1.is_evaluate = ${isEvaluate}
<if test="isEvaluate == 1">
and do.order_status >= ${status}
</if>
<if test="isEvaluate == 0">
and do.order_status = ${status}
</if>
order by do.create_dt desc
limit ${pageNow}, ${pageSize}
</select>
<!--添加购物商品-->
<insert id="addShopCart" parameterType="com.sibu.orderHelper.integral.model.MemberShopCartBean">
INSERT INTO t_member_shopcart(phone, user_name, product_name, erp_code, sku_value, price, amount, member_id, product_id, level_name, product_type, integral)
VALUES (#{phone}, #{userName}, #{productName}, #{erpCode}, #{skuValue}, #{price}, #{amount}, #{memberId}, #{productId}, #{levelName}, #{productType}, #{integral})
</insert>
<!-- 查询评论数量 -->
<select id="countMyComment" parameterType="map" resultType="int">
select count(*) from ${doingOrder1Table} do1 left join ${doingOrderTable} do on do1.order_id = do.order_id
where do1.member_id = #{memberId} and do.order_status >= ${status} and do.delete_flag = 1 and do1.is_evaluate = ${isEvaluate}
</select>
<resultMap type="com.sibu.orderHelper.integral.reponse.DoingOrder1DetailResponse" id="listOrder1sProduct">
<id column="order1_id" property="order1Id" />
<result column="member_id" property="memberId" />
<result column="order_id" property="orderId" />
<result column="sort_index" property="sortIndex" />
<result column="product_id" property="productId" />
<result column="purchase_quantity" property="purchaseQuantity" />
<result column="shipped_quantity" property="shippedQuantity" />
<result column="integral" property="integral" />
<result column="line_integral" property="lineIntegral" />
<result column="price" property="price" />
<result column="line_price" property="linePrice" />
<result column="is_evaluate" property="isEvaluate" />
<result column="name" property="name"/>
<result column="thumb_img" property="thumbImg"/>
<result column="market_price" property="marketPrice"/>
</resultMap>
</mapper>