From a13a93a493e7e94e28b2225c26e7e13b52d3288c Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 12 Apr 2021 19:48:45 +0800
Subject: [PATCH] 20210412  tqq环境

---
 zq-erp/src/main/resources/mybatis/mapper/hive/ArticleDao.xml |   40 ++++++++++++++++++++++------------------
 1 files changed, 22 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 d7b9b0c..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
@@ -440,7 +442,8 @@
 
 	<select id="selectApiArticleListInPage" resultMap="ArticleMap">
 		select * from article a
-		inner join article_type b on a.type_id=b.id and find_in_set(#{record.typeId}, b.parent_ids)
+		inner join article_type b on a.type_id=b.id
+		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">
@@ -450,4 +453,5 @@
 		</if>
 	</select>
 
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1