linwe
2024-05-29 c10d6358b9f014375a13821465bc978d0c0da22e
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
<?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="org.springblade.modules.backblast.mapper.BackblastPubPersonMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="backblastPubPersonResultMap" type="org.springblade.modules.backblast.vo.BackblastPubPersonVO">
    </resultMap>
 
    <!--自定义分页列表查询-->
    <select id="selectBackblastPubPersonPage" resultMap="backblastPubPersonResultMap">
        select
        jbpp.*
        from jczz_backblast_pub_person jbpp
        where jbpp.is_deleted = 0
        <if test="backblastPubPerson.address != null and backblastPubPerson.address != ''">
            and jbpp.address like concat('%',#{backblastPubPerson.address},'%')
        </if>
        <if test="backblastPubPerson.name != null and backblastPubPerson.name != ''">
            and jbpp.name like concat('%',#{backblastPubPerson.name},'%')
        </if>
        <if test="backblastPubPerson.telephone != null and backblastPubPerson.telephone != ''">
            and jbpp.telephone like concat('%',#{backblastPubPerson.telephone},'%')
        </if>
        <if test="backblastPubPerson.idCard != null and backblastPubPerson.idCard != ''">
            and jbpp.id_card like concat('%',#{backblastPubPerson.idCard},'%')
        </if>
        <if test="backblastPubPerson.startTime != null and backblastPubPerson.startTime != ''">
            and date_format(jbpp.create_time,'%Y-%m-%d') &gt;= #{backblastPubPerson.startTime}
        </if>
        <if test="backblastPubPerson.endTime != null and backblastPubPerson.endTime != ''">
            and date_format(jbpp.create_time,'%Y-%m-%d') &lt;= #{backblastPubPerson.endTime}
        </if>
        <if test="backblastPubPerson.searchKey!=null and backblastPubPerson.searchKey!=''">
            and CONCAT(
            ifnull(jbpp.id_card,''),
            ifnull(jbpp.address,''),
            ifnull(jbpp.name,''),
            ifnull(jbpp.telephone,'')
            ) like CONCAT ('%', #{backblastPubPerson.searchKey},'%')
        </if>
        order by jbpp.id desc,jbpp.create_time desc
    </select>
 
    <!--反炸宣传对象表 自定义详情-->
    <select id="getDetail" resultType="org.springblade.modules.backblast.vo.BackblastPubPersonVO">
        select
        jbpp.*
        from jczz_backblast_pub_person jbpp
        where jbpp.is_deleted = 0
        <if test="backblastPubPerson.id != null">
            and jbpp.id = #{backblastPubPerson.id}
        </if>
        order by jbpp.id desc,jbpp.create_time desc
    </select>
 
 
</mapper>