|
|
@@ -406,6 +406,120 @@
|
|
|
|
|
|
rank desc , id desc
|
|
|
</select>
|
|
|
+ <select id="queryAllServiceTypeForHome" parameterType="java.util.Map"
|
|
|
+ resultMap="InfoWithListForHome">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>,
|
|
|
+ 1 as homeFlag,
|
|
|
+ 'Y' as useFlag,
|
|
|
+ 6 as homeLimit,
|
|
|
+ 10 as hotLimit
|
|
|
+
|
|
|
+ from service_type
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
+ and del_flag = #{delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null and !"".equals(updateTime)">
|
|
|
+ and update_time = #{updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateUser != null and !"".equals(updateUser)">
|
|
|
+ and update_user = #{updateUser}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null and !"".equals(createTime)">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="createUser != null and !"".equals(createUser)">
|
|
|
+ and create_user = #{createUser}
|
|
|
+ </if>
|
|
|
+ <if test="serviceType != null and !"".equals(serviceType)">
|
|
|
+ and service_type = #{serviceType}
|
|
|
+ </if>
|
|
|
+ <if test="shortName != null and !"".equals(shortName)">
|
|
|
+ and short_name = #{shortName}
|
|
|
+ </if>
|
|
|
+ <if test="image != null and !"".equals(image)">
|
|
|
+ and image = #{image}
|
|
|
+ </if>
|
|
|
+ <if test="color != null and !"".equals(color)">
|
|
|
+ and color = #{color}
|
|
|
+ </if>
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ and rank = #{rank}
|
|
|
+ </if>
|
|
|
+ <if test="showFlag != null and !"".equals(showFlag)">
|
|
|
+ and show_flag = #{showFlag}
|
|
|
+ </if>
|
|
|
+ <if test="description != null and !"".equals(description)">
|
|
|
+ and description = #{description}
|
|
|
+ </if>
|
|
|
+ <if test="searchKey != null and !"".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 !"".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 < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ #{itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+
|
|
|
+
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by
|
|
|
+
|
|
|
+ <if test="orderByStr != null and !"".equals(orderByStr)">
|
|
|
+
|
|
|
+
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ ${itemDetail}
|
|
|
+ </foreach>
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ ,
|
|
|
+ </if>
|
|
|
+
|
|
|
+ rank desc , id desc
|
|
|
+ </select>
|
|
|
<select id="queryServiceType" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ServiceType">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>
|
|
|
@@ -482,5 +596,25 @@
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap id="InfoWithListForHome" type="com.izouma.awesomeadmin.model.ServiceType" extends="BaseResultMap">
|
|
|
+
|
|
|
+
|
|
|
+ <collection property="serviceTypeDetailList"
|
|
|
+ ofType="com.izouma.awesomeadmin.model.ServiceTypeDetail"
|
|
|
+ select="com.izouma.awesomeadmin.dao.ServiceTypeDetailMapper.queryAllServiceTypeDetail"
|
|
|
+ column="{ parentId = id }"/>
|
|
|
+
|
|
|
+ <collection property="homeStoreInfoList"
|
|
|
+ ofType="com.izouma.awesomeadmin.model.StoreInfo"
|
|
|
+ select="com.izouma.awesomeadmin.dao.StoreInfoMapper.queryAllStoreInfoForHome"
|
|
|
+ column="{ serviceType = id , homeFlag = homeFlag , useFlag = useFlag , limitNum = homeLimit }"/>
|
|
|
+
|
|
|
+ <collection property="hotStoreInfoList"
|
|
|
+ ofType="com.izouma.awesomeadmin.model.StoreInfo"
|
|
|
+ select="com.izouma.awesomeadmin.dao.StoreInfoMapper.queryAllStoreInfoForHome"
|
|
|
+ column="{ serviceType = id , hotFlag = homeFlag , useFlag = useFlag , limitNum = hotLimit }"/>
|
|
|
+
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
</mapper>
|
|
|
|