add 付费资源
This commit is contained in:
@@ -25,25 +25,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="weight" column="weight" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="AppBlogArticle" id="AppBlogArticleWithResourceResult" extends="AppBlogArticleResult">
|
||||
<association property="appResource" javaType="AppResource">
|
||||
<id property="id" column="resource_id" />
|
||||
<result property="resourceTitle" column="resource_title" />
|
||||
<result property="showImg" column="resource_show_img" />
|
||||
<result property="explain" column="resource_explain" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
<result property="keyword" column="resource_keyword" />
|
||||
<result property="isShow" column="resource_is_show" />
|
||||
<result property="isAd" column="resource_is_ad" />
|
||||
<result property="adNumber" column="resource_ad_number" />
|
||||
<result property="downNum" column="resource_down_num" />
|
||||
<result property="weight" column="resource_weight" />
|
||||
<result property="delFlag" column="resource_del_flag" />
|
||||
<result property="createBy" column="resource_create_by" />
|
||||
<result property="createTime" column="resource_create_time" />
|
||||
<result property="remark" column="resource_remark" />
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppBlogArticleVo">
|
||||
select id, title, content_info, article_type, keyword, show_img, app_resource_id, look_number, weight, love_number, is_recommendation, is_show, is_ad, ad_number, del_flag, create_by, create_time, remark from app_blog_article
|
||||
</sql>
|
||||
|
||||
<select id="selectAppBlogArticleList" parameterType="AppBlogArticle" resultMap="AppBlogArticleResult">
|
||||
<include refid="selectAppBlogArticleVo"/>
|
||||
<select id="selectAppBlogArticleList" parameterType="AppBlogArticle" resultMap="AppBlogArticleWithResourceResult">
|
||||
select
|
||||
a.id, a.title, a.content_info, a.article_type, a.keyword, a.show_img, a.app_resource_id,
|
||||
a.look_number, a.weight, a.love_number, a.is_recommendation, a.is_show, a.is_ad,
|
||||
a.ad_number, a.del_flag, a.create_by, a.create_time, a.remark,
|
||||
r.id as resource_id,
|
||||
r.resource_title,
|
||||
r.show_img as resource_show_img,
|
||||
r.explain as resource_explain,
|
||||
r.resource_type,
|
||||
r.keyword as resource_keyword,
|
||||
r.is_show as resource_is_show,
|
||||
r.is_ad as resource_is_ad,
|
||||
r.ad_number as resource_ad_number,
|
||||
r.down_num as resource_down_num,
|
||||
r.weight as resource_weight,
|
||||
r.del_flag as resource_del_flag,
|
||||
r.create_by as resource_create_by,
|
||||
r.create_time as resource_create_time,
|
||||
r.remark as resource_remark
|
||||
from app_blog_article a
|
||||
left join app_resource r on a.app_resource_id = r.id
|
||||
<where>
|
||||
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
||||
<if test="contentInfo != null and contentInfo != ''"> and content_info like concat('%', #{contentInfo}, '%')</if>
|
||||
<if test="articleType != null "> and article_type = #{articleType}</if>
|
||||
<if test="appResourceId != null "> and app_resource_id = #{appResourceId}</if>
|
||||
<if test="isRecommendation != null "> and is_recommendation = #{isRecommendation}</if>
|
||||
<if test="isShow != null "> and is_show = #{isShow}</if>
|
||||
<if test="weight != null "> and weight = #{weight}</if>
|
||||
<if test="keyword != null and keyword != ''"> and (keyword like concat('%', #{keyword}, '%') or title like concat('%', #{keyword}, '%'))</if>
|
||||
<if test="title != null and title != ''"> and a.title like concat('%', #{title}, '%')</if>
|
||||
<if test="contentInfo != null and contentInfo != ''"> and a.content_info like concat('%', #{contentInfo}, '%')</if>
|
||||
<if test="articleType != null "> and a.article_type = #{articleType}</if>
|
||||
<if test="appResourceId != null "> and a.app_resource_id = #{appResourceId}</if>
|
||||
<if test="isRecommendation != null "> and a.is_recommendation = #{isRecommendation}</if>
|
||||
<if test="isShow != null "> and a.is_show = #{isShow}</if>
|
||||
<if test="weight != null "> and a.weight = #{weight}</if>
|
||||
<if test="keyword != null and keyword != ''"> and (a.keyword like concat('%', #{keyword}, '%') or a.title like concat('%', #{keyword}, '%'))</if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="orderType == 'look_number'"> ORDER BY look_number desc, create_time desc</when >
|
||||
<otherwise> ORDER BY weight desc, create_time desc</otherwise >
|
||||
<when test="orderType == 'look_number'"> ORDER BY a.look_number desc, a.create_time desc</when >
|
||||
<otherwise> ORDER BY a.weight desc, a.create_time desc</otherwise >
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="orderNo" column="order_no" />
|
||||
<result property="tradeNo" column="trade_no" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="resourceId" column="resource_id" />
|
||||
<result property="openId" column="open_id" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="points" column="points" />
|
||||
@@ -18,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppPayOrderVo">
|
||||
select id, order_no, trade_no, user_id, open_id, amount, points, status, create_time, pay_time from app_pay_order
|
||||
select id, order_no, trade_no, user_id, resource_id, open_id, amount, points, status, create_time, pay_time from app_pay_order
|
||||
</sql>
|
||||
|
||||
<select id="selectAppPayOrderList" parameterType="AppPayOrder" resultMap="AppPayOrderResult">
|
||||
@@ -49,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="orderNo != null and orderNo != ''">order_no,</if>
|
||||
<if test="tradeNo != null and tradeNo != ''">trade_no,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="resourceId != null">resource_id,</if>
|
||||
<if test="openId != null and openId != ''">open_id,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="points != null">points,</if>
|
||||
@@ -60,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="orderNo != null and orderNo != ''">#{orderNo},</if>
|
||||
<if test="tradeNo != null and tradeNo != ''">#{tradeNo},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="resourceId != null">#{resourceId},</if>
|
||||
<if test="openId != null and openId != ''">#{openId},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="points != null">#{points},</if>
|
||||
@@ -75,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="orderNo != null and orderNo != ''">order_no = #{orderNo},</if>
|
||||
<if test="tradeNo != null and tradeNo != ''">trade_no = #{tradeNo},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="resourceId != null">resource_id = #{resourceId},</if>
|
||||
<if test="openId != null and openId != ''">open_id = #{openId},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="points != null">points = #{points},</if>
|
||||
|
||||
Reference in New Issue
Block a user