移动端接口新闻分类列表bug处理

This commit is contained in:
kerwincui
2022-06-22 01:44:57 +08:00
parent 208b230ce0
commit 2c617701d4
4 changed files with 23 additions and 21 deletions

View File

@@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.iot.mapper.NewsCategoryMapper">
<resultMap type="NewsCategory" id="NewsCategoryResult">
<resultMap type="com.ruoyi.iot.domain.NewsCategory" id="NewsCategoryResult">
<result property="categoryId" column="category_id" />
<result property="categoryName" column="category_name" />
<result property="orderNum" column="order_num" />
@@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select category_id, category_name, order_num, del_flag, create_by, create_time, update_by, update_time, remark from news_category
</sql>
<select id="selectNewsCategoryList" parameterType="NewsCategory" resultMap="NewsCategoryResult">
<select id="selectNewsCategoryList" parameterType="com.ruoyi.iot.domain.NewsCategory" resultMap="NewsCategoryResult">
<include refid="selectNewsCategoryVo"/>
<where>
<if test="categoryName != null and categoryName != ''"> and category_name like concat('%', #{categoryName}, '%')</if>
@@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where category_id = #{categoryId}
</select>
<insert id="insertNewsCategory" parameterType="NewsCategory" useGeneratedKeys="true" keyProperty="categoryId">
<insert id="insertNewsCategory" parameterType="com.ruoyi.iot.domain.NewsCategory" useGeneratedKeys="true" keyProperty="categoryId">
insert into news_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="categoryName != null and categoryName != ''">category_name,</if>
@@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateNewsCategory" parameterType="NewsCategory">
<update id="updateNewsCategory" parameterType="com.ruoyi.iot.domain.NewsCategory">
update news_category
<trim prefix="SET" suffixOverrides=",">
<if test="categoryName != null and categoryName != ''">category_name = #{categoryName},</if>

View File

@@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.iot.mapper.NewsMapper">
<resultMap type="News" id="NewsResult">
<resultMap type="com.ruoyi.iot.domain.News" id="NewsResult">
<result property="newsId" column="news_id" />
<result property="title" column="title" />
<result property="content" column="content" />
@@ -27,20 +27,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select news_id, title, img_url, is_top, is_banner, category_id, category_name, status, author, del_flag, create_by, create_time, update_by, update_time, remark from news
</sql>
<select id="selectNewsList" parameterType="News" resultMap="NewsResult">
<include refid="selectNewsVo"/>
<where>
<if test="title != null and title != ''"> and title = #{title}</if>
<select id="selectNewsList" parameterType="com.ruoyi.iot.domain.News" resultMap="NewsResult">
select news_id, title, img_url, is_top, is_banner, category_id, category_name, status, author,
create_by, create_time, update_by, update_time, remark
from news s
<where>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="categoryId != null "> and category_id = #{categoryId}</if>
<if test="isTop != null "> and is_top = #{isTop}</if>
<if test="isBanner != null "> and is_banner = #{isBanner}</if>
<if test="categoryName != null and categoryName != ''"> and category_name like concat('%', #{categoryName}, '%')</if>
<if test="categoryId != null"> and category_Id = #{categoryId})</if>
<if test="status != null "> and status = #{status}</if>
</where>
order by create_time desc
</select>
<select id="selectTopNewsList" parameterType="News" resultMap="NewsResult">
<select id="selectTopNewsList" parameterType="com.ruoyi.iot.domain.News" resultMap="NewsResult">
select n.news_id, n.title, n.img_url, n.is_top, n.is_banner, n.category_id, c.category_name, n.status, n.author, n.create_time, n.remark
from news n left join news_category c on c.category_id=n.category_id
where n.is_top=1 and n.status=1
@@ -52,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where news_id = #{newsId}
</select>
<insert id="insertNews" parameterType="News" useGeneratedKeys="true" keyProperty="newsId">
<insert id="insertNews" parameterType="com.ruoyi.iot.domain.News" useGeneratedKeys="true" keyProperty="newsId">
insert into news
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">title,</if>
@@ -90,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateNews" parameterType="News">
<update id="updateNews" parameterType="com.ruoyi.iot.domain.News">
update news
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if>

View File

@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.iot.mapper.SocialPlatformMapper">
<resultMap type="SocialPlatform" id="SocialPlatformResult">
<resultMap type="com.ruoyi.iot.domain.SocialPlatform" id="SocialPlatformResult">
<result property="socialPlatformId" column="social_platform_id"/>
<result property="platform" column="platform"/>
<result property="status" column="status"/>
@@ -41,7 +41,7 @@
from iot_social_platform
</sql>
<select id="selectSocialPlatformList" parameterType="SocialPlatform" resultMap="SocialPlatformResult">
<select id="selectSocialPlatformList" parameterType="com.ruoyi.iot.domain.SocialPlatform" resultMap="SocialPlatformResult">
<include refid="selectSocialPlatformVo"/>
<where>
<if test="platform != null and platform != ''">and platform = #{platform}</if>
@@ -67,7 +67,7 @@
where platform = #{platform}
</select>
<insert id="insertSocialPlatform" parameterType="SocialPlatform" useGeneratedKeys="true"
<insert id="insertSocialPlatform" parameterType="com.ruoyi.iot.domain.SocialPlatform" useGeneratedKeys="true"
keyProperty="socialPlatformId">
insert into iot_social_platform
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -104,7 +104,7 @@
</trim>
</insert>
<update id="updateSocialPlatform" parameterType="SocialPlatform">
<update id="updateSocialPlatform" parameterType="com.ruoyi.iot.domain.SocialPlatform">
update iot_social_platform
<trim prefix="SET" suffixOverrides=",">
<if test="platform != null and platform != ''">platform = #{platform},</if>

View File

@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.iot.mapper.SocialUserMapper">
<resultMap type="SocialUser" id="SocialUserResult">
<resultMap type="com.ruoyi.iot.domain.SocialUser" id="SocialUserResult">
<result property="socialUserId" column="social_user_id"/>
<result property="uuid" column="uuid"/>
<result property="source" column="source"/>
@@ -69,7 +69,7 @@
from iot_social_user
</sql>
<select id="selectSocialUserList" parameterType="SocialUser" resultMap="SocialUserResult">
<select id="selectSocialUserList" parameterType="com.ruoyi.iot.domain.SocialUser" resultMap="SocialUserResult">
<include refid="selectSocialUserVo"/>
<where>
<if test="uuid != null and uuid != ''">and uuid = #{uuid}</if>
@@ -105,7 +105,7 @@
where social_user_id = #{socialUserId}
</select>
<insert id="insertSocialUser" parameterType="SocialUser" useGeneratedKeys="true" keyProperty="socialUserId">
<insert id="insertSocialUser" parameterType="com.ruoyi.iot.domain.SocialUser" useGeneratedKeys="true" keyProperty="socialUserId">
insert into iot_social_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uuid != null and uuid != ''">uuid,</if>
@@ -169,7 +169,7 @@
</trim>
</insert>
<update id="updateSocialUser" parameterType="SocialUser">
<update id="updateSocialUser" parameterType="com.ruoyi.iot.domain.SocialUser">
update iot_social_user
<trim prefix="SET" suffixOverrides=",">
<if test="uuid != null and uuid != ''">uuid = #{uuid},</if>