xin
2025-07-10 09ac251a089f5bb79d59a12bf2f932dda12c4ca2
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
<?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.oying.modules.sh.mapper.OrderOperationLogMapper">
    <resultMap id="BaseResultMap" type="com.oying.modules.sh.domain.OrderOperationLog">
        <id column="log_id" property="logId"/>
        <result column="username" property="username"/>
        <result column="user_type" property="userType"/>
        <result column="operation" property="operation"/>
        <result column="operation_describe" property="operationDescribe"/>
        <result column="remark" property="remark"/>
        <result column="snapshot_data" property="snapshotData"/>
        <result column="operation_time" property="operationTime"/>
        <result column="order_num" property="orderNum"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        log_id, username, user_type, operation, operation_describe, remark, snapshot_data, operation_time, order_num
    </sql>
 
    <select id="findAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from sh_order_operation_log
        <where>
            <if test="criteria.username != null">
                and username like concat('%',#{criteria.username},'%')
            </if>
            <if test="criteria.userType != null">
                and user_type = #{criteria.userType}
            </if>
            <if test="criteria.orderNum != null">
                and order_num = #{criteria.orderNum}
            </if>
            <if test="criteria.operationTime != null and criteria.operationTime.size() > 0">
                AND operation_time BETWEEN #{criteria.operationTime[0]} AND #{criteria.operationTime[1]}
            </if>
        </where>
        order by log_id desc
    </select>
    <select id="getByOrderNum" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from sh_order_operation_log
        where order_num = #{orderNum} order by log_id desc
    </select>
</mapper>