Browse Source

服务大类

suochencheng 7 years ago
parent
commit
ca44407580

+ 2 - 2
src/main/java/com/izouma/awesomeadmin/dao/ServiceTypeDetailMapper.xml

@@ -243,7 +243,7 @@
             </trim>
             ,
         </if>
-        id desc
+        rank desc , id desc
     </select>
     <select id="queryAllServiceTypeDetail" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ServiceTypeDetail">
         select <include refid="Base_Column_List"/> from service_type_detail
@@ -337,7 +337,7 @@
             ,
         </if>
 
-        id desc
+        rank desc , id desc
     </select>
     <select id="queryServiceTypeDetail" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ServiceTypeDetail">
         select <include refid="Base_Column_List"/> from service_type_detail

+ 4 - 3
src/main/java/com/izouma/awesomeadmin/dao/ServiceTypeMapper.java

@@ -1,16 +1,17 @@
 package com.izouma.awesomeadmin.dao;
 
 import java.util.*;
+
 import com.izouma.awesomeadmin.datasource.DataSource;
 import org.springframework.stereotype.Repository;
 import com.izouma.awesomeadmin.model.ServiceType;
 
 
 /**
-*  Dao接口
-*/
+ * Dao接口
+ */
 @Repository("com.zoumaframe.dao.ServiceTypeMapper")
-public interface ServiceTypeMapper{
+public interface ServiceTypeMapper {
 
     int deleteByPrimaryKey(Integer id);
 

+ 228 - 205
src/main/java/com/izouma/awesomeadmin/dao/ServiceTypeMapper.xml

@@ -1,23 +1,23 @@
 <?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.ServiceTypeMapper" >
-    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.ServiceType" >
-                <id column="id" property="id" jdbcType="INTEGER" />
-                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
-                                <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
-                                <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
-                                <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
-                                <result column="create_user" property="createUser" jdbcType="VARCHAR" />
-                                <result column="service_type" property="serviceType" jdbcType="VARCHAR" />
-                                <result column="short_name" property="shortName" jdbcType="VARCHAR" />
-                                <result column="image" property="image" jdbcType="VARCHAR" />
-                                <result column="color" property="color" jdbcType="VARCHAR" />
-                                <result column="rank" property="rank" jdbcType="INTEGER" />
-                                <result column="show_flag" property="showFlag" jdbcType="CHAR" />
-                                <result column="description" property="description" jdbcType="VARCHAR" />
-            </resultMap>
-    <sql id="Base_Column_List" >
-        <trim  suffixOverrides="," >
+<mapper namespace="com.izouma.awesomeadmin.dao.ServiceTypeMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.ServiceType">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
+        <result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
+        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
+        <result column="create_user" property="createUser" jdbcType="VARCHAR"/>
+        <result column="service_type" property="serviceType" jdbcType="VARCHAR"/>
+        <result column="short_name" property="shortName" jdbcType="VARCHAR"/>
+        <result column="image" property="image" jdbcType="VARCHAR"/>
+        <result column="color" property="color" jdbcType="VARCHAR"/>
+        <result column="rank" property="rank" jdbcType="INTEGER"/>
+        <result column="show_flag" property="showFlag" jdbcType="CHAR"/>
+        <result column="description" property="description" jdbcType="VARCHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <trim suffixOverrides=",">
             id,
 
             del_flag,
@@ -44,202 +44,206 @@
 
             description,
 
-            </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 service_type
         where id = #{id,jdbcType=INTEGER}
     </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
         delete from service_type
         where id = #{id,jdbcType=INTEGER}
     </delete>
-    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.ServiceType" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.ServiceType" useGeneratedKeys="true"
+            keyProperty="id">
         insert into service_type
-        <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="updateTime!= null" >
+            <if test="updateTime!= null">
                 update_time,
             </if>
-                <if test="updateUser!= null" >
+            <if test="updateUser!= null">
                 update_user,
             </if>
-                <if test="createTime!= null" >
+            <if test="createTime!= null">
                 create_time,
             </if>
-                <if test="createUser!= null" >
+            <if test="createUser!= null">
                 create_user,
             </if>
-                <if test="serviceType!= null" >
+            <if test="serviceType!= null">
                 service_type,
             </if>
-                <if test="shortName!= null" >
+            <if test="shortName!= null">
                 short_name,
             </if>
-                <if test="image!= null" >
+            <if test="image!= null">
                 image,
             </if>
-                <if test="color!= null" >
+            <if test="color!= null">
                 color,
             </if>
-                <if test="rank!= null" >
+            <if test="rank!= null">
                 rank,
             </if>
-                <if test="showFlag!= null" >
+            <if test="showFlag!= null">
                 show_flag,
             </if>
-                <if test="description!= null" >
+            <if test="description!= null">
                 description,
             </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="updateTime != null" >
+            <if test="updateTime != null">
                 #{updateTime,jdbcType=TIMESTAMP},
             </if>
-                    <if test="updateUser != null" >
+            <if test="updateUser != null">
                 #{updateUser,jdbcType=VARCHAR},
             </if>
-                    <if test="createTime != null" >
+            <if test="createTime != null">
                 #{createTime,jdbcType=TIMESTAMP},
             </if>
-                    <if test="createUser != null" >
+            <if test="createUser != null">
                 #{createUser,jdbcType=VARCHAR},
             </if>
-                    <if test="serviceType != null" >
+            <if test="serviceType != null">
                 #{serviceType,jdbcType=VARCHAR},
             </if>
-                    <if test="shortName != null" >
+            <if test="shortName != null">
                 #{shortName,jdbcType=VARCHAR},
             </if>
-                    <if test="image != null" >
+            <if test="image != null">
                 #{image,jdbcType=VARCHAR},
             </if>
-                    <if test="color != null" >
+            <if test="color != null">
                 #{color,jdbcType=VARCHAR},
             </if>
-                    <if test="rank != null" >
+            <if test="rank != null">
                 #{rank,jdbcType=INTEGER},
             </if>
-                    <if test="showFlag != null" >
+            <if test="showFlag != null">
                 #{showFlag,jdbcType=CHAR},
             </if>
-                    <if test="description != null" >
+            <if test="description != null">
                 #{description,jdbcType=VARCHAR},
             </if>
-                </trim>
+        </trim>
     </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.ServiceType" >
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.ServiceType">
         update service_type
-        <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="updateTime != null" >
-               update_time= #{updateTime,jdbcType=TIMESTAMP},
+            <if test="updateTime != null">
+                update_time= #{updateTime,jdbcType=TIMESTAMP},
             </if>
-                     <if test="updateUser != null" >
-               update_user= #{updateUser,jdbcType=VARCHAR},
+            <if test="updateUser != null">
+                update_user= #{updateUser,jdbcType=VARCHAR},
             </if>
-                     <if test="createTime != null" >
-               create_time= #{createTime,jdbcType=TIMESTAMP},
+            <if test="createTime != null">
+                create_time= #{createTime,jdbcType=TIMESTAMP},
             </if>
-                     <if test="createUser != null" >
-               create_user= #{createUser,jdbcType=VARCHAR},
+            <if test="createUser != null">
+                create_user= #{createUser,jdbcType=VARCHAR},
             </if>
-                     <if test="serviceType != null" >
-               service_type= #{serviceType,jdbcType=VARCHAR},
+            <if test="serviceType != null">
+                service_type= #{serviceType,jdbcType=VARCHAR},
             </if>
-                     <if test="shortName != null" >
-               short_name= #{shortName,jdbcType=VARCHAR},
+            <if test="shortName != null">
+                short_name= #{shortName,jdbcType=VARCHAR},
             </if>
-                     <if test="image != null" >
-               image= #{image,jdbcType=VARCHAR},
+            <if test="image != null">
+                image= #{image,jdbcType=VARCHAR},
             </if>
-                     <if test="color != null" >
-               color= #{color,jdbcType=VARCHAR},
+            <if test="color != null">
+                color= #{color,jdbcType=VARCHAR},
             </if>
-                     <if test="rank != null" >
-               rank= #{rank,jdbcType=INTEGER},
+            <if test="rank != null">
+                rank= #{rank,jdbcType=INTEGER},
             </if>
-                     <if test="showFlag != null" >
-               show_flag= #{showFlag,jdbcType=CHAR},
+            <if test="showFlag != null">
+                show_flag= #{showFlag,jdbcType=CHAR},
             </if>
-                     <if test="description != null" >
-               description= #{description,jdbcType=VARCHAR},
+            <if test="description != null">
+                description= #{description,jdbcType=VARCHAR},
             </if>
-                 </set>
+        </set>
         where id = #{id,jdbcType=INTEGER}
     </update>
-    <select id="queryServiceTypeByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ServiceType">
-        select <include refid="Base_Column_List"/> from service_type
+    <select id="queryServiceTypeByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.ServiceType">
+        select
+        <include refid="Base_Column_List"/>
+        from service_type
         <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.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
+                and update_time = #{record.updateTime}
             </if>
-                     <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
-                and  update_time = #{record.updateTime}
+            <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
+                and update_user = #{record.updateUser}
             </if>
-                     <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
-                and  update_user = #{record.updateUser}
+            <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
+                and create_time = #{record.createTime}
             </if>
-                     <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
-                and  create_time = #{record.createTime}
+            <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
+                and create_user = #{record.createUser}
             </if>
-                     <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
-                and  create_user = #{record.createUser}
+            <if test="record.serviceType != null and !&quot;&quot;.equals(record.serviceType)">
+                and service_type = #{record.serviceType}
             </if>
-                     <if test="record.serviceType != null and !&quot;&quot;.equals(record.serviceType)">
-                and  service_type = #{record.serviceType}
+            <if test="record.shortName != null and !&quot;&quot;.equals(record.shortName)">
+                and short_name = #{record.shortName}
             </if>
-                     <if test="record.shortName != null and !&quot;&quot;.equals(record.shortName)">
-                and  short_name = #{record.shortName}
+            <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.color != null and !&quot;&quot;.equals(record.color)">
+                and color = #{record.color}
             </if>
-                     <if test="record.color != null and !&quot;&quot;.equals(record.color)">
-                and  color = #{record.color}
+            <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.showFlag != null and !&quot;&quot;.equals(record.showFlag)">
+                and show_flag = #{record.showFlag}
             </if>
-                     <if test="record.showFlag != null and !&quot;&quot;.equals(record.showFlag)">
-                and  show_flag = #{record.showFlag}
+            <if test="record.description != null and !&quot;&quot;.equals(record.description)">
+                and description = #{record.description}
             </if>
-                     <if test="record.description != null and !&quot;&quot;.equals(record.description)">
-                and  description = #{record.description}
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR service_type LIKE concat('%',#{record.searchKey},'%')
+                    OR short_name LIKE concat('%',#{record.searchKey},'%')
+                    OR image LIKE concat('%',#{record.searchKey},'%')
+                    OR color LIKE concat('%',#{record.searchKey},'%')
+                    OR rank LIKE concat('%',#{record.searchKey},'%')
+                    OR show_flag LIKE concat('%',#{record.searchKey},'%')
+                    OR description LIKE concat('%',#{record.searchKey},'%')
+                </trim>
             </if>
-                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
-             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                                                                                                                                                                                                                                                                                    OR  service_type LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  short_name LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  image LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  color LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  rank LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  show_flag LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  description 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('_;')">
@@ -291,96 +295,99 @@
             </trim>
             ,
         </if>
-        id desc
+        rank desc , id desc
     </select>
-    <select id="queryAllServiceType" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ServiceType">
-        select <include refid="Base_Column_List"/> from service_type
+    <select id="queryAllServiceType" parameterType="java.util.Map"
+            resultMap="InfoWithList">
+        select
+        <include refid="Base_Column_List"/>
+        from service_type
         <where>
             and del_flag = 'N'
-                    <if test="id != null and !&quot;&quot;.equals(id)">
-                and  id = #{id}
+            <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 test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
             </if>
-                    <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
-                and  update_time = #{updateTime}
+            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+                and update_time = #{updateTime}
             </if>
-                    <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
-                and  update_user = #{updateUser}
+            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
+                and update_user = #{updateUser}
             </if>
-                    <if test="createTime != null and !&quot;&quot;.equals(createTime)">
-                and  create_time = #{createTime}
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
             </if>
-                    <if test="createUser != null and !&quot;&quot;.equals(createUser)">
-                and  create_user = #{createUser}
+            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+                and create_user = #{createUser}
             </if>
-                    <if test="serviceType != null and !&quot;&quot;.equals(serviceType)">
-                and  service_type = #{serviceType}
+            <if test="serviceType != null and !&quot;&quot;.equals(serviceType)">
+                and service_type = #{serviceType}
             </if>
-                    <if test="shortName != null and !&quot;&quot;.equals(shortName)">
-                and  short_name = #{shortName}
+            <if test="shortName != null and !&quot;&quot;.equals(shortName)">
+                and short_name = #{shortName}
             </if>
-                    <if test="image != null and !&quot;&quot;.equals(image)">
-                and  image = #{image}
+            <if test="image != null and !&quot;&quot;.equals(image)">
+                and image = #{image}
             </if>
-                    <if test="color != null and !&quot;&quot;.equals(color)">
-                and  color = #{color}
+            <if test="color != null and !&quot;&quot;.equals(color)">
+                and color = #{color}
             </if>
-                    <if test="rank != null and !&quot;&quot;.equals(rank)">
-                and  rank = #{rank}
+            <if test="rank != null and !&quot;&quot;.equals(rank)">
+                and rank = #{rank}
             </if>
-                    <if test="showFlag != null and !&quot;&quot;.equals(showFlag)">
-                and  show_flag = #{showFlag}
+            <if test="showFlag != null and !&quot;&quot;.equals(showFlag)">
+                and show_flag = #{showFlag}
             </if>
-                    <if test="description != null and !&quot;&quot;.equals(description)">
-                and  description = #{description}
+            <if test="description != null and !&quot;&quot;.equals(description)">
+                and description = #{description}
             </if>
-                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
-                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                OR  service_type LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  short_name LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  image LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  color LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  rank LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  show_flag LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  description LIKE concat('%',#{searchKey},'%')
-                                                                                        </trim>
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR service_type LIKE concat('%',#{searchKey},'%')
+                    OR short_name LIKE concat('%',#{searchKey},'%')
+                    OR image LIKE concat('%',#{searchKey},'%')
+                    OR color LIKE concat('%',#{searchKey},'%')
+                    OR rank LIKE concat('%',#{searchKey},'%')
+                    OR show_flag LIKE concat('%',#{searchKey},'%')
+                    OR description 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="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>
-
-                    <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>
-            </otherwise>
-        </choose>
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
 
 
-    </foreach>
+                </foreach>
 
 
-</if>
+            </if>
         </where>
         order by
 
@@ -397,52 +404,54 @@
             ,
         </if>
 
-        id desc
+        rank desc , id desc
     </select>
     <select id="queryServiceType" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ServiceType">
-        select <include refid="Base_Column_List"/> from service_type
+        select
+        <include refid="Base_Column_List"/>
+        from service_type
         <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="updateTime != null and !&quot;&quot;.equals(updateTime)">
+            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
                 and update_time = #{updateTime}
             </if>
-                     <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
+            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
                 and update_user = #{updateUser}
             </if>
-                     <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
                 and create_time = #{createTime}
             </if>
-                     <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
                 and create_user = #{createUser}
             </if>
-                     <if test="serviceType != null and !&quot;&quot;.equals(serviceType)">
+            <if test="serviceType != null and !&quot;&quot;.equals(serviceType)">
                 and service_type = #{serviceType}
             </if>
-                     <if test="shortName != null and !&quot;&quot;.equals(shortName)">
+            <if test="shortName != null and !&quot;&quot;.equals(shortName)">
                 and short_name = #{shortName}
             </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="color != null and !&quot;&quot;.equals(color)">
+            <if test="color != null and !&quot;&quot;.equals(color)">
                 and color = #{color}
             </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="showFlag != null and !&quot;&quot;.equals(showFlag)">
+            <if test="showFlag != null and !&quot;&quot;.equals(showFlag)">
                 and show_flag = #{showFlag}
             </if>
-                     <if test="description != null and !&quot;&quot;.equals(description)">
+            <if test="description != null and !&quot;&quot;.equals(description)">
                 and description = #{description}
             </if>
-         
+
         </where>
         LIMIT 1
     </select>
@@ -453,11 +462,25 @@
         </where>
     </update>
     <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ServiceType">
-        select <include refid="Base_Column_List"/> from service_type
+        select
+        <include refid="Base_Column_List"/>
+        from service_type
         <where>
             and del_flag = 'N'
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </where>
+        </where>
         order by id desc
     </select>
+
+
+    <resultMap id="InfoWithList" type="com.izouma.awesomeadmin.model.ServiceType" extends="BaseResultMap">
+
+
+        <collection property="serviceTypeDetailList"
+                    ofType="com.izouma.awesomeadmin.model.ServiceTypeDetail"
+                    select="com.izouma.awesomeadmin.model.ServiceTypeDetailMapper.queryAllServiceTypeDetail"
+                    column="{ parentId = id }"/>
+
+    </resultMap>
+
 </mapper>
 

+ 76 - 54
src/main/java/com/izouma/awesomeadmin/model/ServiceType.java

@@ -1,13 +1,14 @@
 package com.izouma.awesomeadmin.model;
 
 import java.util.*;
+
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.JsonInclude;
 
 
 @JsonAutoDetect
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class ServiceType{
+public class ServiceType {
     private Integer id;
     private String delFlag;
     private Date updateTime;
@@ -22,133 +23,154 @@ public class ServiceType{
     private String showFlag;
     private String description;
 
-private String searchKey;
+    private List<ServiceTypeDetail> serviceTypeDetailList;
+
+    private String searchKey;
 
-/**
-* and,test_name,like,value;or,remark,=,123
-*/
-private String advancedQuery;
+    /**
+     * and,test_name,like,value;or,remark,=,123
+     */
+    private String advancedQuery;
 
-/**
-* column_name_,desc_;column_name_,asc
-*/
-private String orderByStr;
+    /**
+     * column_name_,desc_;column_name_,asc
+     */
+    private String orderByStr;
 
-    public Integer getId(){
+    public Integer getId() {
         return this.id;
     }
 
-    public void setId(Integer id){
+    public void setId(Integer id) {
         this.id = id;
     }
-    public String getDelFlag(){
+
+    public String getDelFlag() {
         return this.delFlag;
     }
 
-    public void setDelFlag(String delFlag){
+    public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
-    public Date getUpdateTime(){
+
+    public Date getUpdateTime() {
         return this.updateTime;
     }
 
-    public void setUpdateTime(Date updateTime){
+    public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
-    public String getUpdateUser(){
+
+    public String getUpdateUser() {
         return this.updateUser;
     }
 
-    public void setUpdateUser(String updateUser){
+    public void setUpdateUser(String updateUser) {
         this.updateUser = updateUser;
     }
-    public Date getCreateTime(){
+
+    public Date getCreateTime() {
         return this.createTime;
     }
 
-    public void setCreateTime(Date createTime){
+    public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
-    public String getCreateUser(){
+
+    public String getCreateUser() {
         return this.createUser;
     }
 
-    public void setCreateUser(String createUser){
+    public void setCreateUser(String createUser) {
         this.createUser = createUser;
     }
-    public String getServiceType(){
+
+    public String getServiceType() {
         return this.serviceType;
     }
 
-    public void setServiceType(String serviceType){
+    public void setServiceType(String serviceType) {
         this.serviceType = serviceType;
     }
-    public String getShortName(){
+
+    public String getShortName() {
         return this.shortName;
     }
 
-    public void setShortName(String shortName){
+    public void setShortName(String shortName) {
         this.shortName = shortName;
     }
-    public String getImage(){
+
+    public String getImage() {
         return this.image;
     }
 
-    public void setImage(String image){
+    public void setImage(String image) {
         this.image = image;
     }
-    public String getColor(){
+
+    public String getColor() {
         return this.color;
     }
 
-    public void setColor(String color){
+    public void setColor(String color) {
         this.color = color;
     }
-    public Integer getRank(){
+
+    public Integer getRank() {
         return this.rank;
     }
 
-    public void setRank(Integer rank){
+    public void setRank(Integer rank) {
         this.rank = rank;
     }
-    public String getShowFlag(){
+
+    public String getShowFlag() {
         return this.showFlag;
     }
 
-    public void setShowFlag(String showFlag){
+    public void setShowFlag(String showFlag) {
         this.showFlag = showFlag;
     }
-    public String getDescription(){
+
+    public String getDescription() {
         return this.description;
     }
 
-    public void setDescription(String description){
+    public void setDescription(String description) {
         this.description = description;
     }
 
-public String getSearchKey() {
-    return searchKey;
-}
+    public String getSearchKey() {
+        return searchKey;
+    }
 
-public void setSearchKey(String searchKey) {
-    this.searchKey = searchKey;
-}
+    public void setSearchKey(String searchKey) {
+        this.searchKey = searchKey;
+    }
 
-public String getAdvancedQuery() {
-    return advancedQuery;
-}
+    public String getAdvancedQuery() {
+        return advancedQuery;
+    }
 
-public void setAdvancedQuery(String advancedQuery) {
-    this.advancedQuery = advancedQuery;
-}
+    public void setAdvancedQuery(String advancedQuery) {
+        this.advancedQuery = advancedQuery;
+    }
 
-public String getOrderByStr() {
-    return orderByStr;
-}
+    public String getOrderByStr() {
+        return orderByStr;
+    }
 
-public void setOrderByStr(String orderByStr) {
-    this.orderByStr = orderByStr;
-}
+    public void setOrderByStr(String orderByStr) {
+        this.orderByStr = orderByStr;
+    }
 
+    public List<ServiceTypeDetail> getServiceTypeDetailList() {
+        return serviceTypeDetailList;
+    }
+
+    public void setServiceTypeDetailList(List<ServiceTypeDetail> serviceTypeDetailList) {
+        this.serviceTypeDetailList = serviceTypeDetailList;
+    }
 }
 

+ 1 - 1
src/main/java/com/izouma/awesomeadmin/web/ServiceTypeController.java

@@ -30,7 +30,7 @@ public class ServiceTypeController {
     /**
     * <p>获取全部记录。</p>
     */
-    @RequiresAuthentication
+    //@RequiresAuthentication
     @RequestMapping(value = "/all", method = RequestMethod.GET)
     @ResponseBody
     public Result all(ServiceType record) {