p-honggang.li
2 天以前 7c2c6a5e5b3d9f96aef3c67573aa62bbd9a3aa7f
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
<?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.webmanage.mapper.OrderEvaluationMapper">
 
    <!-- 基础结果映射 -->
    <resultMap id="BaseResultMap" type="com.webmanage.entity.OrderEvaluation">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="order_id" property="orderId" jdbcType="VARCHAR"/>
        <result column="evaluator_id" property="evaluatorId" jdbcType="BIGINT"/>
        <result column="evaluator_name" property="evaluatorName" jdbcType="VARCHAR"/>
        <result column="evaluator_type" property="evaluatorType" jdbcType="VARCHAR"/>
        <result column="content" property="content" jdbcType="LONGVARCHAR"/>
        <result column="rating" property="rating" jdbcType="INTEGER"/>
        <result column="service_rating" property="serviceRating" jdbcType="INTEGER"/>
        <result column="quality_rating" property="qualityRating" jdbcType="INTEGER"/>
        <result column="delivery_rating" property="deliveryRating" jdbcType="INTEGER"/>
        <result column="is_anonymous" property="isAnonymous" jdbcType="BOOLEAN"/>
        <result column="reply_content" property="replyContent" jdbcType="LONGVARCHAR"/>
        <result column="reply_user_id" property="replyUserId" jdbcType="BIGINT"/>
        <result column="reply_time" property="replyTime" jdbcType="TIMESTAMP"/>
        <result column="created_at" property="createdAt" jdbcType="TIMESTAMP"/>
        <result column="updated_at" property="updatedAt" jdbcType="TIMESTAMP"/>
        <result column="deleted" property="deleted" jdbcType="INTEGER"/>
    </resultMap>
 
    <!-- 基础字段列表 -->
    <sql id="Base_Column_List">
        id, order_id, evaluator_id, evaluator_name, evaluator_type, content, rating,
        service_rating, quality_rating, delivery_rating, is_anonymous, reply_content,
        reply_user_id, reply_time, created_at, updated_at, deleted
    </sql>
 
    <!-- 根据订单ID查询订单评价 -->
    <select id="selectByOrderId" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM tb_order_evaluation
        WHERE deleted = 0 AND order_id = #{orderId}
        LIMIT 1
    </select>
 
</mapper>