xieb
2024-05-07 5e972eb9928c39b5abbdfd35e2a0aeff40876e7d
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
<?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="cn.gistack.sm.hk.mapper.HkEventMapper">
 
    <!--自定义分页列表查询-->
    <select id="selectHkEventPage" resultType="cn.gistack.sm.hk.vo.HkEventVO">
        select
        she.*,
        bdb.dict_value as eventTypeName
        from YWXT.sm_hk_event she
        left join YWXT.blade_dict_biz bdb on bdb.dict_key = she.event_type and bdb.is_deleted = 0 and code = 'EVENT_TYPE'
        where 1 =1
        <if test="hkEvent.srcName!=null and hkEvent.srcName!=''">
            and she.src_name like concat('%',#{hkEvent.srcName},'%')
        </if>
        <if test="hkEvent.eventTypeName!=null and hkEvent.eventTypeName!=''">
            and bdb.dict_value like concat('%',#{hkEvent.eventTypeName},'%')
        </if>
        <if test="hkEvent.status!=null">
            and she.status = #{hkEvent.status}
        </if>
        <if test="hkEvent.eventType!=null">
            and she.event_type = #{hkEvent.eventType}
        </if>
        <if test="hkEvent.startTime !=null and hkEvent.startTime !=''">
            AND DATE_FORMAT(she.send_time,'%Y-%m-%d') &gt;= #{hkEvent.startTime}
        </if>
        <if test="hkEvent.endTime !=null and hkEvent.endTime !=''">
            AND DATE_FORMAT(she.send_time,'%Y-%m-%d') &lt;= #{hkEvent.endTime}
        </if>
        order by she.id desc
    </select>
 
</mapper>