mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?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.panzhihua.service_grid.dao.EventTransferRecordMapper">
 
     <resultMap id="baseResult" type="com.panzhihua.service_grid.model.dos.EventTransferRecordDO">
        <result property="id" column="id"/>
        <result property="eventId" column="event_id"/>
        <result property="fromType" column="from_type"/>
        <result property="fromId" column="from_id"/>
        <result property="fromName" column="from_name"/>
        <result property="toType" column="to_type"/>
        <result property="toId" column="to_id"/>
        <result property="toName" column="to_name"/>
        <result property="processResult" column="process_result"/>
        <result property="processDate" column="process_date"/>
        <result property="createAt" column="create_at"/>
    </resultMap>
 
    <sql id="columns">
    <![CDATA[
        id,event_id,from_type,from_id,from_name,to_type,to_id,to_name,process_result,process_date,create_at
    ]]>
    </sql>
 
 
    <select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.EventTransferRecordVO"
        parameterType="com.panzhihua.common.model.dtos.grid.PageEventTransferRecordDTO">
        SELECT <include refid="columns" />
        FROM event_transfer_record
        <where>
           <if test="pageEventTransferRecordDTO.id!=null">
                AND id = #{pageEventTransferRecordDTO.id}
            </if>
           <if test="pageEventTransferRecordDTO.eventId!=null">
                AND event_id = #{pageEventTransferRecordDTO.eventId}
            </if>
           <if test="pageEventTransferRecordDTO.fromType!=null">
                AND from_type = #{pageEventTransferRecordDTO.fromType}
            </if>
           <if test="pageEventTransferRecordDTO.from!=null">
                AND from_id = #{pageEventTransferRecordDTO.fromId}
            </if>
           <if test="pageEventTransferRecordDTO.fromName!=null">
                AND from_name = #{pageEventTransferRecordDTO.fromName}
            </if>
           <if test="pageEventTransferRecordDTO.toType!=null">
                AND to_type = #{pageEventTransferRecordDTO.toType}
            </if>
           <if test="pageEventTransferRecordDTO.to!=null">
                AND to_id = #{pageEventTransferRecordDTO.toId}
            </if>
           <if test="pageEventTransferRecordDTO.toName!=null">
                AND to_name = #{pageEventTransferRecordDTO.toName}
            </if>
           <if test="pageEventTransferRecordDTO.processResult!=null">
                AND process_result = #{pageEventTransferRecordDTO.processResult}
            </if>
           <if test="pageEventTransferRecordDTO.processDateBegin!=null">
                AND process_date &gt;= #{pageEventTransferRecordDTO.processDateBegin}
           </if>
           <if test="pageEventTransferRecordDTO.processDateEnd!=null">
                AND process_date &lt;= #{pageEventTransferRecordDTO.processDateEnd}
           </if>
           <if test="pageEventTransferRecordDTO.createAtBegin!=null">
                AND create_at &gt;= #{pageEventTransferRecordDTO.createAtBegin}
           </if>
           <if test="pageEventTransferRecordDTO.createAtEnd!=null">
                AND create_at &lt;= #{pageEventTransferRecordDTO.createAtEnd}
           </if>
        </where>
        <if test="pageEventTransferRecordDTO.sortColumns!=null">
            ORDER BY ${pageEventTransferRecordDTO.sortColumns} ${pageEventTransferRecordDTO.sortType}
        </if>
    </select>
 
</mapper>