From ec0c71cc88407098e0c088dbf1e44cddf856b8f8 Mon Sep 17 00:00:00 2001 From: jyy <935090232@qq.com> Date: Tue, 26 Jan 2021 16:30:55 +0800 Subject: [PATCH] Merge branch 'api' into hive2.0 --- zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml | 39 +++++++++++++++++++++------------------ 1 files changed, 21 insertions(+), 18 deletions(-) diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml index 25f544d..2e0c943 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml @@ -16,7 +16,7 @@ <result property="sort" column="sort" /> <result property="createtiem" column="createtiem" /> <result property="url" column="url" /> - <result property="shopId" column="shop_id"/> + <result property="companyId" column="company_id"/> <result property="articleTypeName" column="article_type_name" /> @@ -43,7 +43,7 @@ url, like_number, classify, - shop_id + company_id ) VALUES ( #{id}, @@ -59,7 +59,7 @@ #{url}, #{likeNumber}, #{classify}, - #{shopId} + #{companyId} ) </insert> @@ -143,7 +143,7 @@ url, classify, like_number, - shop_id, + company_id, (select article_type_name from article_type c where type_id = c.id) articleTypeName, (select type from article_type c where type_id = c.id) type from article @@ -188,8 +188,8 @@ <if test="record.likeNumber != null and record.likeNumber !='' "> and like_number = #{record.likeNumber} </if> - <if test="record.shopId != null and record.shopId !='' "> - and shop_id = #{record.shopId} + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} </if> <if test="record.type != null and record.type !='' "> and (select type from article_type c where type_id = c.id) = #{record.type} @@ -228,7 +228,7 @@ url, classify, like_number, - shop_id, + company_id, (select article_type_name from article_type c where type_id = c.id) articleTypeName, (select type from article_type c where type_id = c.id) type from article @@ -279,8 +279,8 @@ <if test="record.articleTypeName != null and record.url !='' "> and (select article_type_name from article_type c where type_id = c.id) = #{record.articleTypeName} </if> - <if test="record.shopId != null and record.shopId !='' "> - and shop_id = #{record.shopId} + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} </if> </if> order by type_id,sort,createtiem desc @@ -338,8 +338,8 @@ <if test="record.articleTypeName != null and record.url !='' "> and (select article_type_name from article_type c where type_id = c.id) = #{record.articleTypeName} </if> - <if test="record.shopId != null and record.shopId !='' "> - and shop_id = #{record.shopId} + <if test="record.companyId != null and record.companyId !='' "> + and company_id = #{record.companyId} </if> </if> </select> @@ -360,12 +360,14 @@ url, like_number, classify, - shop_id, + company_id, (select article_type_name from article_type c where type_id = c.id) articleTypeName<!-- 所属门店名称 --> from article where id=#{id} - </select> - + </select> + + + <!-- 根据对象查询--> <select id="selectByModel" resultMap="ArticleMap"> @@ -383,7 +385,7 @@ a.url, a.classify, a.like_number, - a.shop_id, + a.company_id, (select article_type_name from article_type c where a.type_id = c.id) articleTypeName,<!-- 所属门店名称 --> (select count(*) from article_comment ac where ac.article_id=a.id) commentNum from article a @@ -431,8 +433,8 @@ <if test="record.articleTypeName != null and record.url !='' "> and (select article_type_name from article_type c where a.type_id = c.id) = #{record.articleTypeName} </if> - <if test="record.shopId != null and record.shopId !='' "> - and a.shop_id = #{record.shopId} + <if test="record.companyId != null and record.companyId !='' "> + and a.company_id = #{record.companyId} </if> </if> order by type_id,sort,createtiem desc @@ -441,7 +443,7 @@ <select id="selectApiArticleListInPage" resultMap="ArticleMap"> select * from article a inner join article_type b on a.type_id=b.id - where a.type_id=#{record.typeId} or find_in_set(#{record.typeId}, b.parent_ids) + where a.company_id=#{record.companyId} and (a.type_id=#{record.typeId} or find_in_set(#{record.typeId}, b.parent_ids)) order by a.createtiem desc <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> <if test="pageVo.offset >=0 and pageVo.limit >0"> @@ -451,4 +453,5 @@ </if> </select> + </mapper> \ No newline at end of file -- Gitblit v1.9.1