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
<?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.article.mapper.ArticleIntegralMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="articleIntegralResultMap" type="org.springblade.modules.article.vo.ArticleIntegralVO">
        <result column="id" property="id"/>
        <result column="article_id" property="articleId"/>
        <result column="score" property="score"/>
        <result column="create_time" property="createTime"/>
        <result column="create_user" property="createUser"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
 
    <!--自定义分页查询-->
    <select id="selectArticleIntegralPage" resultMap="articleIntegralResultMap">
        select
        jai.*,
        jh.house_name as address,
        jh.district_name as aoiName,
        bu.real_name,
        bu.phone,
        bu.avatar
        from jczz_article_integral jai
        left join jczz_house jh on jai.house_code = jh.house_code and jh.is_deleted = 0
        left join blade_user bu on bu.id = jai.create_user and bu.is_deleted = 0
        where jai.is_deleted = 0
        <if test="articleIntegral.realName!=null and articleIntegral.realName!=''">
            and bu.real_name like concat('%',#{articleIntegral.realName},'%')
        </if>
        <if test="articleIntegral.phone!=null and articleIntegral.phone!=''">
            and bu.phone like concat('%',#{articleIntegral.phone},'%')
        </if>
        <if test="articleIntegral.articleId!=null">
            and jai.article_id = #{articleIntegral.articleId}
        </if>
        order by jai.create_time desc
    </select>
 
 
</mapper>