ソースを参照

行业资讯查询

guomengjiao 3 週間 前
コミット
fe45d8169e

+ 14 - 5
modules/report/src/main/java/com/jeesite/modules/report/entity/MarketInfo.java

@@ -1,16 +1,15 @@
 package com.jeesite.modules.report.entity;
 
-import javax.validation.constraints.Size;
-import java.util.Date;
-import com.jeesite.common.mybatis.annotation.JoinTable;
-import com.jeesite.common.mybatis.annotation.JoinTable.Type;
 import com.fasterxml.jackson.annotation.JsonFormat;
-
 import com.jeesite.common.entity.DataEntity;
 import com.jeesite.common.mybatis.annotation.Column;
 import com.jeesite.common.mybatis.annotation.Table;
 import com.jeesite.common.mybatis.mapper.query.QueryType;
 
+import javax.validation.constraints.Size;
+import java.util.Date;
+import java.util.List;
+
 /**
  * 市场资讯Entity
  * @author wx
@@ -58,6 +57,8 @@ public class MarketInfo extends DataEntity<MarketInfo> {
 	private String fileName;	// 名称
 	// 新增字段
 	private String webTitle;	// 网站标题
+	//市场分类 多选
+	private List<String> marketTypeList;
 
 	public MarketInfo() {
 		this(null);
@@ -202,4 +203,12 @@ public class MarketInfo extends DataEntity<MarketInfo> {
 	public void setWebTitle(String webTitle) {
 		this.webTitle = webTitle;
 	}
+
+	public List<String> getMarketTypeList() {
+		return marketTypeList;
+	}
+
+	public void setMarketTypeList(List<String> marketTypeList) {
+		this.marketTypeList = marketTypeList;
+	}
 }

+ 12 - 10
modules/report/src/main/resources/mappings/modules/report/MarketInfoDao.xml

@@ -33,15 +33,7 @@
 		left join bjfl_config.js_sys_file_upload c on c.biz_key = b.id and c.status = '0'
 		left join bjfl_config.js_sys_file_entity d on d.file_id = c.file_id
 		where b.status = '0' and b.lang = #{info.lang}
-		<if test="info.marketCategory != null and info.marketCategory !=''">
-			and b.market_category = #{info.marketCategory}
-		</if>
-		<if test="info.marketType != null and info.marketType !=''">
-			and b.market_type = #{info.marketType}
-		</if>
-		<if test="info.keyword != null and info.keyword != ''">
-			and b.title like concat('%',#{info.keyword},'%')
-		</if>
+		<include refid="where_find"/>
 		order by b.update_date desc
 		limit ${info.pageSize * (info.pageNo - 1)},${info.pageSize}
 	</select>
@@ -50,6 +42,10 @@
 		resultType="java.lang.Long">
 		select count(*) from market_info b
 		where b.status = '0' and b.lang = #{info.lang}
+		<include refid="where_find"/>
+	</select>
+
+	<sql id="where_find">
 		<if test="info.marketCategory != null and info.marketCategory !=''">
 			and b.market_category = #{info.marketCategory}
 		</if>
@@ -59,7 +55,13 @@
 		<if test="info.keyword != null and info.keyword != ''">
 			and b.title like concat('%',#{info.keyword},'%')
 		</if>
-	</select>
+		<if test="info.marketTypeList != null and info.marketTypeList.size() > 0">
+			AND b.market_type in
+			<foreach item="marketType" collection="info.marketTypeList" open="(" separator="," close=")">
+				#{marketType}
+			</foreach>
+		</if>
+	</sql>
 
 	<select id="getMarketInfoLast" resultType="com.jeesite.modules.report.entity.MarketInfo">
 		select id,title from market_info where status = '0' and update_date = (