|
@@ -16,38 +16,53 @@
|
|
|
select *
|
|
|
from tb_trade_area
|
|
|
</sql>
|
|
|
+ <insert id="addGoodsToTradeArea">
|
|
|
+ insert into tb_goods_trade_area_relation
|
|
|
+ (goods_id,trade_area_id)
|
|
|
+ values(
|
|
|
+ <if test="goodsId!=null and goodsId!=''"> #{goodsId},</if>
|
|
|
+ <if test="tradeAreaId!=null and tradeAreaId!=''"> #{tradeAreaId}</if>
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
|
|
|
+ <delete id="delGoodsFromTradeArea">
|
|
|
+ delete from tb_goods_trade_area_relation
|
|
|
+ <where>
|
|
|
+ <if test="goodsId!=null and goodsId!=''"> goods_id=#{goodsId}</if>
|
|
|
+ <if test="tradeAreaId!=null and tradeAreaId!=''"> and trade_area_id=#{tradeAreaId}</if>
|
|
|
+ </where>
|
|
|
+ </delete>
|
|
|
|
|
|
<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
|
|
|
<select id="getList" resultMap="model">
|
|
|
<include refid="select_sql"></include>
|
|
|
- <where>
|
|
|
- <if test=' this.has("id") '> and id = #{id} </if>
|
|
|
- <if test=' this.has("name") '> and name = #{name} </if>
|
|
|
- <if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
|
|
|
- <if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>
|
|
|
- <if test=' this.has("address") '> and address = #{address} </if>
|
|
|
- <if test=' this.has("createBy") '> and create_by = #{createBy} </if>
|
|
|
- <if test=' this.has("createName") '> and create_name = #{createName} </if>
|
|
|
- <if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>
|
|
|
- <if test=' this.has("updateName") '> and update_name = #{updateName} </if>
|
|
|
- <if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
|
|
|
- </where>
|
|
|
- order by
|
|
|
- <choose>
|
|
|
- <when test='sortType == 1'> id desc </when>
|
|
|
- <when test='sortType == 2'> name desc </when>
|
|
|
- <when test='sortType == 3'> address_ids desc </when>
|
|
|
- <when test='sortType == 4'> detail_address desc </when>
|
|
|
- <when test='sortType == 5'> address desc </when>
|
|
|
- <when test='sortType == 6'> create_time desc </when>
|
|
|
- <when test='sortType == 7'> create_by desc </when>
|
|
|
- <when test='sortType == 8'> create_name desc </when>
|
|
|
- <when test='sortType == 9'> update_by desc </when>
|
|
|
- <when test='sortType == 10'> update_name desc </when>
|
|
|
- <when test='sortType == 11'> update_time desc </when>
|
|
|
- <otherwise> id desc </otherwise>
|
|
|
- </choose>
|
|
|
+<!-- <where>-->
|
|
|
+<!-- <if test=' this.has("id") '> and id = #{id} </if>-->
|
|
|
+<!-- <if test=' this.has("name") '> and name = #{name} </if>-->
|
|
|
+<!-- <if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>-->
|
|
|
+<!-- <if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>-->
|
|
|
+<!-- <if test=' this.has("address") '> and address = #{address} </if>-->
|
|
|
+<!-- <if test=' this.has("createBy") '> and create_by = #{createBy} </if>-->
|
|
|
+<!-- <if test=' this.has("createName") '> and create_name = #{createName} </if>-->
|
|
|
+<!-- <if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>-->
|
|
|
+<!-- <if test=' this.has("updateName") '> and update_name = #{updateName} </if>-->
|
|
|
+<!-- <if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>-->
|
|
|
+<!-- </where>-->
|
|
|
+<!-- order by-->
|
|
|
+<!-- <choose>-->
|
|
|
+<!-- <when test='sortType == 1'> id desc </when>-->
|
|
|
+<!-- <when test='sortType == 2'> name desc </when>-->
|
|
|
+<!-- <when test='sortType == 3'> address_ids desc </when>-->
|
|
|
+<!-- <when test='sortType == 4'> detail_address desc </when>-->
|
|
|
+<!-- <when test='sortType == 5'> address desc </when>-->
|
|
|
+<!-- <when test='sortType == 6'> create_time desc </when>-->
|
|
|
+<!-- <when test='sortType == 7'> create_by desc </when>-->
|
|
|
+<!-- <when test='sortType == 8'> create_name desc </when>-->
|
|
|
+<!-- <when test='sortType == 9'> update_by desc </when>-->
|
|
|
+<!-- <when test='sortType == 10'> update_name desc </when>-->
|
|
|
+<!-- <when test='sortType == 11'> update_time desc </when>-->
|
|
|
+<!-- <otherwise> id desc </otherwise>-->
|
|
|
+<!-- </choose>-->
|
|
|
</select>
|
|
|
|
|
|
|