|
@@ -1,32 +1,91 @@
|
|
|
<?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="edu.travel.tenant.mapper.ShopBannerMapper">
|
|
|
- <resultMap id="BaseResultMap" type="edu.travel.tenant.entity.ShopBanner">
|
|
|
- <!--@mbg.generated-->
|
|
|
- <!--@Table shop_banner-->
|
|
|
- <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
- <result column="url" jdbcType="VARCHAR" property="url" />
|
|
|
- <result column="url_type" jdbcType="INTEGER" property="urlType" />
|
|
|
- <result column="content" jdbcType="VARCHAR" property="content" />
|
|
|
- <result column="link_url" jdbcType="VARCHAR" property="linkUrl" />
|
|
|
- <result column="sort_order" jdbcType="INTEGER" property="sortOrder" />
|
|
|
- <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
|
|
- <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
|
|
- <result column="country_id" jdbcType="BIGINT" property="countryId" />
|
|
|
- <result column="is_default" jdbcType="INTEGER" property="isDefault" />
|
|
|
- <result column="mode" jdbcType="INTEGER" property="mode" />
|
|
|
- <result column="enable" jdbcType="INTEGER" property="enable" />
|
|
|
- <result column="project" jdbcType="VARCHAR" property="project" />
|
|
|
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
- <result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
|
|
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
- <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
|
|
- <result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Base_Column_List">
|
|
|
- <!--@mbg.generated-->
|
|
|
- id, url, url_type, content, link_url, sort_order, start_time, end_time, `is_default`, `country_id`
|
|
|
- `mode`, `enable`, project, create_time, create_user_id, update_time, update_user_id,
|
|
|
- delete_flag
|
|
|
- </sql>
|
|
|
+ <resultMap id="BaseResultMap" type="edu.travel.tenant.entity.ShopBanner">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table shop_banner-->
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
+ <result column="url" jdbcType="VARCHAR" property="url"/>
|
|
|
+ <result column="url_type" jdbcType="INTEGER" property="urlType"/>
|
|
|
+ <result column="content" jdbcType="VARCHAR" property="content"/>
|
|
|
+ <result column="link_url" jdbcType="VARCHAR" property="linkUrl"/>
|
|
|
+ <result column="sort_order" jdbcType="INTEGER" property="sortOrder"/>
|
|
|
+ <result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
|
|
|
+ <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
|
|
|
+ <result column="country_id" jdbcType="BIGINT" property="countryId"/>
|
|
|
+ <result column="is_default" jdbcType="INTEGER" property="isDefault"/>
|
|
|
+ <result column="mode" jdbcType="INTEGER" property="mode"/>
|
|
|
+ <result column="enable" jdbcType="INTEGER" property="enable"/>
|
|
|
+ <result column="project" jdbcType="VARCHAR" property="project"/>
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
+ <result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
|
|
|
+ <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
+ <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
|
|
|
+ <result column="delete_flag" jdbcType="INTEGER" property="deleteFlag"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ id, url, url_type, content, link_url, sort_order, start_time, end_time, `is_default`, `country_id`
|
|
|
+ `mode`, `enable`, project, create_time, create_user_id, update_time, update_user_id,
|
|
|
+ delete_flag
|
|
|
+ </sql>
|
|
|
+ <select id="selectBannerWithCountry" resultType="edu.travel.remote.feign.mode.vo.banner.BannerVo">
|
|
|
+ SELECT
|
|
|
+ sb.id,
|
|
|
+ sb.url,
|
|
|
+ sb.url_type,
|
|
|
+ sb.content,
|
|
|
+ sb.link_url,
|
|
|
+ sb.mode,
|
|
|
+ sb.country_id,
|
|
|
+ sb.start_time,
|
|
|
+ sb.end_time,
|
|
|
+ sb.sort_order,
|
|
|
+ sb.is_default,
|
|
|
+ sb.enable,
|
|
|
+ sb.project
|
|
|
+ FROM
|
|
|
+ shop_banner sb
|
|
|
+ <where>
|
|
|
+ <if test="url != null and url != ''">
|
|
|
+ AND sb.url LIKE CONCAT('%', #{url}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="urlType != null">
|
|
|
+ AND sb.url_type = #{urlType}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ AND sb.content LIKE CONCAT('%', #{content}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="countryId != null and countryId != ''">
|
|
|
+ AND sb.country_id = #{countryId}
|
|
|
+ </if>
|
|
|
+ <if test="isDefault != null">
|
|
|
+ AND sb.is_default = #{isDefault}
|
|
|
+ </if>
|
|
|
+ <if test="linkUrl != null and linkUrl != ''">
|
|
|
+ AND sb.link_url LIKE CONCAT('%', #{linkUrl}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="mode != null and mode !=''">
|
|
|
+ AND sb.mode = #{mode}
|
|
|
+ </if>
|
|
|
+ <if test="enable != null and enable !=''">
|
|
|
+ AND sb.enable = #{enable}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="countAll" resultType="int">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM shop_banner sb
|
|
|
+ <where>
|
|
|
+ <if test="url != null and url != ''">
|
|
|
+ AND sb.url LIKE CONCAT('%', #{url}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="urlType != null">
|
|
|
+ AND sb.url_type = #{urlType}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ AND sb.content LIKE CONCAT('%', #{content}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|