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
<?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.dg.core.db.gen.mapper.AutomessageCommonProblemMapper">
    <resultMap type="com.dg.core.db.gen.entity.AutomessageCommonProblem" id="AutomessageCommonProblemResult">
        <id     property="id"      column="id"      />
        <id     property="title"      column="title"      />
        <id     property="content"      column="content"      />
        <id     property="createTime"      column="create_time"      />
        <id     property="updateTime"      column="update_time"      />
        <id     property="updateUserId"      column="update_user_id"      />
        <id     property="createUserId"      column="create_user_id"      />
 
    </resultMap>
 
    <sql id="selectAutomessageCommonProblemResul">
        SELECT
            id,
            title,
            content,
            create_time,
            update_time,
            (select user_name from automessage_sys_user where user_id=a.update_user_id)updateUserName,
            update_user_id,
            (select user_name from automessage_sys_user where user_id=a.create_user_id)createUserName,
            create_user_id
        FROM
            automessage_common_problem a
    </sql>
 
    <select id="selectConfigList" resultMap="AutomessageCommonProblemResult">
        <include refid="selectAutomessageCommonProblemResul" />
       <where>
           <if test="title!=null and title!=''">
               and title  like concat('%', #{title}, '%')
           </if>
           <if test="content!=null and content!=''">
               and content  like concat('%', #{content}, '%')
           </if>
       </where>
    </select>
 
    <select id="countConfigList" resultType="integer">
        select  count(*) from  automessage_common_problem
        <where>
            <if test="title!=null and title!=''">
                and title  like concat('%', #{title}, '%')
            </if>
            <if test="content!=null and content!=''">
                and content  like concat('%', #{content}, '%')
            </if>
        </where>
    </select>
 
</mapper>