Pu Zhibing
昨天 bd6d5de56192630584f2e2678c199263534b3e70
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
<?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.stylefeng.guns.modular.system.dao.AdvertisementMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Advertisement">
        <id column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="imgUrl" property="imgUrl"/>
        <result column="type" property="type"/>
        <result column="isJump" property="isJump"/>
        <result column="jumpType" property="jumpType"/>
        <result column="jumpUrl" property="jumpUrl"/>
        <result column="content" property="content"/>
        <result column="state" property="state"/>
        <result column="provinceId" property="provinceId"/>
 
        <result column="flag" property="flag"/>
        <result column="insertTime" property="insertTime"/>
        <result column="insertUser" property="insertUser"/>
        <result column="updateTime" property="updateTime"/>
        <result column="updateUser" property="updateUser"/>
    </resultMap>
 
 
    <select id="queryAdvertisement" resultType="com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper">
        select
        id as id,
        name as name,
        imgUrl as imgUrl,
        type as type,
        isJump as isJump,
        jumpType as jumpType,
        jumpUrl as jumpUrl,
        content as content,
        state as state,
        provinceId as provinceId
        from t_advertisement where flag != 3 and state = 1 and provinceId in (select id from t_region where code = #{code})
        <if test="null != type">
          and `type` = #{type}
        </if>
    </select>
</mapper>