Prechádzať zdrojové kódy

pc修改-根据互市区查商品

linbl 1 rok pred
rodič
commit
58634f07f7

+ 8 - 2
sp-service/level-one-server/src/main/java/com/pj/tb_goods/TbGoodsMapper.xml

@@ -13,14 +13,18 @@
 
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select *
-		from tb_goods
+		select g.*
+		from tb_goods g
 	</sql>
 
 
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 	<select id="getList" resultMap="model">
 		<include refid="select_sql"></include>
+
+		<if test=' this.has("tradeAreaId") '>
+			left join re_trade_area_goods ta on g.id = ta.goods_id
+		</if>
 		<where>
 			<if test=' this.has("id") '> and id = #{id} </if>
 			<if test=' this.has("name") '> and name like concat('%', #{name}, '%')</if>
@@ -34,6 +38,8 @@
 			<if test=' this.has("unit") '> and unit = #{unit} </if>
 			<if test=' this.has("singlePrice") '> and single_price = #{singlePrice} </if>
 			<if test=' this.has("taxNo") '> and tax_no = #{taxNo} </if>
+
+			<if test=' this.has("tradeAreaId") '> and ta.area_id = #{tradeAreaId} </if>
 		</where>
 		order by
 		<choose>