suochencheng vor 7 Jahren
Ursprung
Commit
98d0c833f6
1 geänderte Dateien mit 173 neuen und 171 gelöschten Zeilen
  1. 173 171
      src/main/java/com/izouma/awesomeadmin/dao/BannerInfoMapper.xml

+ 173 - 171
src/main/java/com/izouma/awesomeadmin/dao/BannerInfoMapper.xml

@@ -1,19 +1,19 @@
 <?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.izouma.awesomeadmin.dao.BannerInfoMapper" >
-    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.BannerInfo" >
-                <id column="id" property="id" jdbcType="INTEGER" />
-                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
-                                <result column="title" property="title" jdbcType="VARCHAR" />
-                                <result column="subtitle" property="subtitle" jdbcType="VARCHAR" />
-                                <result column="image" property="image" jdbcType="VARCHAR" />
-                                <result column="news_url" property="newsUrl" jdbcType="VARCHAR" />
-                                <result column="rank" property="rank" jdbcType="INTEGER" />
-                                <result column="hot" property="hot" jdbcType="INTEGER" />
-                                <result column="remark" property="remark" jdbcType="VARCHAR" />
-            </resultMap>
-    <sql id="Base_Column_List" >
-        <trim  suffixOverrides="," >
+<mapper namespace="com.izouma.awesomeadmin.dao.BannerInfoMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.BannerInfo">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="title" property="title" jdbcType="VARCHAR"/>
+        <result column="subtitle" property="subtitle" jdbcType="VARCHAR"/>
+        <result column="image" property="image" jdbcType="VARCHAR"/>
+        <result column="news_url" property="newsUrl" jdbcType="VARCHAR"/>
+        <result column="rank" property="rank" jdbcType="INTEGER"/>
+        <result column="hot" property="hot" jdbcType="INTEGER"/>
+        <result column="remark" property="remark" jdbcType="VARCHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <trim suffixOverrides=",">
             id,
 
             del_flag,
@@ -32,154 +32,154 @@
 
             remark,
 
-            </trim>
+        </trim>
     </sql>
-    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
         select
-        <include refid="Base_Column_List" />
+        <include refid="Base_Column_List"/>
         from banner_info
         where id = #{id,jdbcType=INTEGER}
     </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
         delete from banner_info
         where id = #{id,jdbcType=INTEGER}
     </delete>
-    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.BannerInfo" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.BannerInfo" useGeneratedKeys="true"
+            keyProperty="id">
         insert into banner_info
-        <trim prefix="(" suffix=")" suffixOverrides="," >
-                <if test="id!= null" >
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id!= null">
                 id,
             </if>
-                <if test="delFlag!= null" >
+            <if test="delFlag!= null">
                 del_flag,
             </if>
-                <if test="title!= null" >
+            <if test="title!= null">
                 title,
             </if>
-                <if test="subtitle!= null" >
+            <if test="subtitle!= null">
                 subtitle,
             </if>
-                <if test="image!= null" >
+            <if test="image!= null">
                 image,
             </if>
-                <if test="newsUrl!= null" >
+            <if test="newsUrl!= null">
                 news_url,
             </if>
-                <if test="rank!= null" >
+            <if test="rank!= null">
                 rank,
             </if>
-                <if test="hot!= null" >
+            <if test="hot!= null">
                 hot,
             </if>
-                <if test="remark!= null" >
+            <if test="remark!= null">
                 remark,
             </if>
-            </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides="," >
-                    <if test="id != null" >
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
                 #{id,jdbcType=INTEGER},
             </if>
-                    <if test="delFlag != null" >
+            <if test="delFlag != null">
                 #{delFlag,jdbcType=CHAR},
             </if>
-                    <if test="title != null" >
+            <if test="title != null">
                 #{title,jdbcType=VARCHAR},
             </if>
-                    <if test="subtitle != null" >
+            <if test="subtitle != null">
                 #{subtitle,jdbcType=VARCHAR},
             </if>
-                    <if test="image != null" >
+            <if test="image != null">
                 #{image,jdbcType=VARCHAR},
             </if>
-                    <if test="newsUrl != null" >
+            <if test="newsUrl != null">
                 #{newsUrl,jdbcType=VARCHAR},
             </if>
-                    <if test="rank != null" >
+            <if test="rank != null">
                 #{rank,jdbcType=INTEGER},
             </if>
-                    <if test="hot != null" >
+            <if test="hot != null">
                 #{hot,jdbcType=INTEGER},
             </if>
-                    <if test="remark != null" >
+            <if test="remark != null">
                 #{remark,jdbcType=VARCHAR},
             </if>
-                </trim>
+        </trim>
     </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.BannerInfo" >
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.BannerInfo">
         update banner_info
-        <set >
-                    <if test="id != null" >
-               id= #{id,jdbcType=INTEGER},
+        <set>
+            <if test="id != null">
+                id= #{id,jdbcType=INTEGER},
             </if>
-                     <if test="delFlag != null" >
-               del_flag= #{delFlag,jdbcType=CHAR},
+            <if test="delFlag != null">
+                del_flag= #{delFlag,jdbcType=CHAR},
             </if>
-                     <if test="title != null" >
-               title= #{title,jdbcType=VARCHAR},
+            <if test="title != null">
+                title= #{title,jdbcType=VARCHAR},
             </if>
-                     <if test="subtitle != null" >
-               subtitle= #{subtitle,jdbcType=VARCHAR},
+            <if test="subtitle != null">
+                subtitle= #{subtitle,jdbcType=VARCHAR},
             </if>
-                     <if test="image != null" >
-               image= #{image,jdbcType=VARCHAR},
+            <if test="image != null">
+                image= #{image,jdbcType=VARCHAR},
             </if>
-                     <if test="newsUrl != null" >
-               news_url= #{newsUrl,jdbcType=VARCHAR},
+            <if test="newsUrl != null">
+                news_url= #{newsUrl,jdbcType=VARCHAR},
             </if>
-                     <if test="rank != null" >
-               rank= #{rank,jdbcType=INTEGER},
+            <if test="rank != null">
+                rank= #{rank,jdbcType=INTEGER},
             </if>
-                     <if test="hot != null" >
-               hot= #{hot,jdbcType=INTEGER},
+            <if test="hot != null">
+                hot= #{hot,jdbcType=INTEGER},
             </if>
-                     <if test="remark != null" >
-               remark= #{remark,jdbcType=VARCHAR},
+            <if test="remark != null">
+                remark= #{remark,jdbcType=VARCHAR},
             </if>
-                 </set>
+        </set>
         where id = #{id,jdbcType=INTEGER}
     </update>
-    <select id="queryBannerInfoByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.BannerInfo">
-        select <include refid="Base_Column_List"/> from banner_info
+    <select id="queryBannerInfoByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.BannerInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from banner_info
         <where>
             and del_flag = 'N'
-                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
-                and  id = #{record.id}
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
             </if>
-                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
-                and  del_flag = #{record.delFlag}
+            <if test="record.title != null and !&quot;&quot;.equals(record.title)">
+                and title = #{record.title}
             </if>
-                     <if test="record.title != null and !&quot;&quot;.equals(record.title)">
-                and  title = #{record.title}
+            <if test="record.subtitle != null and !&quot;&quot;.equals(record.subtitle)">
+                and subtitle = #{record.subtitle}
             </if>
-                     <if test="record.subtitle != null and !&quot;&quot;.equals(record.subtitle)">
-                and  subtitle = #{record.subtitle}
+            <if test="record.image != null and !&quot;&quot;.equals(record.image)">
+                and image = #{record.image}
             </if>
-                     <if test="record.image != null and !&quot;&quot;.equals(record.image)">
-                and  image = #{record.image}
+            <if test="record.newsUrl != null and !&quot;&quot;.equals(record.newsUrl)">
+                and news_url = #{record.newsUrl}
             </if>
-                     <if test="record.newsUrl != null and !&quot;&quot;.equals(record.newsUrl)">
-                and  news_url = #{record.newsUrl}
+            <if test="record.rank != null and !&quot;&quot;.equals(record.rank)">
+                and rank = #{record.rank}
             </if>
-                     <if test="record.rank != null and !&quot;&quot;.equals(record.rank)">
-                and  rank = #{record.rank}
+            <if test="record.hot != null and !&quot;&quot;.equals(record.hot)">
+                and hot = #{record.hot}
             </if>
-                     <if test="record.hot != null and !&quot;&quot;.equals(record.hot)">
-                and  hot = #{record.hot}
+            <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and remark = #{record.remark}
             </if>
-                     <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
-                and  remark = #{record.remark}
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR title LIKE concat('%',#{record.searchKey},'%')
+                    OR subtitle LIKE concat('%',#{record.searchKey},'%')
+                    OR remark LIKE concat('%',#{record.searchKey},'%')
+                </trim>
             </if>
-                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
-             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                OR  title LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  subtitle LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  image LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  news_url LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  rank LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  hot LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  remark LIKE concat('%',#{record.searchKey},'%')
-                                                             </trim>
-         </if>
 
             <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
                 <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
@@ -220,116 +220,116 @@
         order by id desc
     </select>
     <select id="queryAllBannerInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.BannerInfo">
-        select <include refid="Base_Column_List"/> from banner_info
+        select
+        <include refid="Base_Column_List"/>
+        from banner_info
         <where>
             and del_flag = 'N'
-                    <if test="id != null and !&quot;&quot;.equals(id)">
-                and  id = #{id}
-            </if>
-                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
-                and  del_flag = #{delFlag}
-            </if>
-                    <if test="title != null and !&quot;&quot;.equals(title)">
-                and  title = #{title}
-            </if>
-                    <if test="subtitle != null and !&quot;&quot;.equals(subtitle)">
-                and  subtitle = #{subtitle}
-            </if>
-                    <if test="image != null and !&quot;&quot;.equals(image)">
-                and  image = #{image}
-            </if>
-                    <if test="newsUrl != null and !&quot;&quot;.equals(newsUrl)">
-                and  news_url = #{newsUrl}
-            </if>
-                    <if test="rank != null and !&quot;&quot;.equals(rank)">
-                and  rank = #{rank}
-            </if>
-                    <if test="hot != null and !&quot;&quot;.equals(hot)">
-                and  hot = #{hot}
-            </if>
-                    <if test="remark != null and !&quot;&quot;.equals(remark)">
-                and  remark = #{remark}
-            </if>
-                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
-                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                                                                                                OR  title LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  subtitle LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  image LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  news_url LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  rank LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  hot LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  remark LIKE concat('%',#{searchKey},'%')
-                                                                                        </trim>
-            </if>
-<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
-    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
-        <choose>
-            <when test="item.indexOf('like') != -1">
-                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
-                    <if test="detailIndex == 3">
-                        concat('%',#{itemDetail},'%')
-                    </if>
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="title != null and !&quot;&quot;.equals(title)">
+                and title = #{title}
+            </if>
+            <if test="subtitle != null and !&quot;&quot;.equals(subtitle)">
+                and subtitle = #{subtitle}
+            </if>
+            <if test="image != null and !&quot;&quot;.equals(image)">
+                and image = #{image}
+            </if>
+            <if test="newsUrl != null and !&quot;&quot;.equals(newsUrl)">
+                and news_url = #{newsUrl}
+            </if>
+            <if test="rank != null and !&quot;&quot;.equals(rank)">
+                and rank = #{rank}
+            </if>
+            <if test="hot != null and !&quot;&quot;.equals(hot)">
+                and hot = #{hot}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR title LIKE concat('%',#{searchKey},'%')
+                    OR subtitle LIKE concat('%',#{searchKey},'%')
+                    OR remark LIKE concat('%',#{searchKey},'%')
+                </trim>
+            </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
 
-                    <if test="detailIndex &lt; 3">
-                        ${itemDetail}
-                    </if>
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
 
-                </foreach>
-            </when>
-            <otherwise>
-                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
-                    <if test="detailIndex == 3">
-                        #{itemDetail}
-                    </if>
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
 
-                    <if test="detailIndex &lt; 3">
-                        ${itemDetail}
-                    </if>
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
 
-                </foreach>
-            </otherwise>
-        </choose>
+                            </foreach>
+                        </otherwise>
+                    </choose>
 
 
-    </foreach>
+                </foreach>
 
 
-</if>
+            </if>
         </where>
         order by id desc
     </select>
     <select id="queryBannerInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.BannerInfo">
-        select <include refid="Base_Column_List"/> from banner_info
+        select
+        <include refid="Base_Column_List"/>
+        from banner_info
         <where>
             and del_flag = 'N'
-                    <if test="id != null and !&quot;&quot;.equals(id)">
+            <if test="id != null and !&quot;&quot;.equals(id)">
                 and id = #{id}
             </if>
-                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                 and del_flag = #{delFlag}
             </if>
-                     <if test="title != null and !&quot;&quot;.equals(title)">
+            <if test="title != null and !&quot;&quot;.equals(title)">
                 and title = #{title}
             </if>
-                     <if test="subtitle != null and !&quot;&quot;.equals(subtitle)">
+            <if test="subtitle != null and !&quot;&quot;.equals(subtitle)">
                 and subtitle = #{subtitle}
             </if>
-                     <if test="image != null and !&quot;&quot;.equals(image)">
+            <if test="image != null and !&quot;&quot;.equals(image)">
                 and image = #{image}
             </if>
-                     <if test="newsUrl != null and !&quot;&quot;.equals(newsUrl)">
+            <if test="newsUrl != null and !&quot;&quot;.equals(newsUrl)">
                 and news_url = #{newsUrl}
             </if>
-                     <if test="rank != null and !&quot;&quot;.equals(rank)">
+            <if test="rank != null and !&quot;&quot;.equals(rank)">
                 and rank = #{rank}
             </if>
-                     <if test="hot != null and !&quot;&quot;.equals(hot)">
+            <if test="hot != null and !&quot;&quot;.equals(hot)">
                 and hot = #{hot}
             </if>
-                     <if test="remark != null and !&quot;&quot;.equals(remark)">
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
                 and remark = #{remark}
             </if>
-         
+
         </where>
         LIMIT 1
     </select>
@@ -340,10 +340,12 @@
         </where>
     </update>
     <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.BannerInfo">
-        select <include refid="Base_Column_List"/> from banner_info
+        select
+        <include refid="Base_Column_List"/>
+        from banner_info
         <where>
             and del_flag = 'N'
-                                                                                                                                                                                                                                                                                </where>
+        </where>
         order by id desc
     </select>
 </mapper>