于紫祥_1901
2020-09-10 5476f8bcf411ce654c02fbd34b9086518adbd917
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="com.moral.mapper.ChannelMapper">
 
    <resultMap id="BaseResultMap" type="com.moral.entity.Channel" >
        <id column="id" property="id" jdbcType="INTEGER" />
        <result column="channel_code" property="channelCode" jdbcType="VARCHAR" />
        <result column="channel_name" property="channelName" jdbcType="VARCHAR" />
        <result column="channel_remark" property="channelRemark" jdbcType="VARCHAR" />
        <result column="channel_is_delete" property="channelIsDelete" jdbcType="CHAR" />
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="create_user" property="createUser" jdbcType="VARCHAR" />
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
        <result column="ext_I" property="extI" jdbcType="VARCHAR" />
        <result column="ext_II" property="extII" jdbcType="VARCHAR" />
    </resultMap>
 
    <sql id="Base_Column_List" >
        id, channel_code, channel_name, channel_remark, channel_is_delete, create_time, create_user,
        update_time, update_user, ext_I, ext_II
    </sql>
 
    <select id="getChannelList" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from channel
        where channel_is_delete=1
        <if test="channelName != 'null'">
            and channel_name like concat('%',#{channelName},'%')
        </if>
    </select>
 
    <select id="getChannelId" resultType="java.lang.Integer">
        select
        distinct
        id
        from channel
        where channel_is_delete=1
    </select>
</mapper>