Просмотр исходного кода

[折扣商户][修改]:商户商铺关系修改

release_toaliyun_real
Stormeye Wu 7 лет назад
Родитель
Сommit
ed66888f49
2 измененных файлов: 103 добавлений и 101 удалений
  1. +7
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxLevelMerchantCVo.java
  2. +96
    -101
      mallinkService/src/main/resources/mapper/WxLevelMerchantMapper.xml

+ 7
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxLevelMerchantCVo.java Просмотреть файл

@@ -1,10 +1,13 @@
package com.iformall.domain.vo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.Id;
import java.io.Serializable;
import java.util.List;

@JsonIgnoreProperties(value = {"handler"})
@Data
public class WxLevelMerchantCVo implements Serializable {
private static final long serialVersionUID = 6687964942922444531L;
@@ -17,6 +20,7 @@ public class WxLevelMerchantCVo implements Serializable {
private String merchantName;
@io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="linkPhone")
private String merchantLinkPhone;

@io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber")
private String shopNumber;
@io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName")
@@ -24,6 +28,9 @@ public class WxLevelMerchantCVo implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName")
private String floorName;

@io.swagger.annotations.ApiModelProperty(value = "店铺列表", name = "shopVoList")
private List<WxShopVo> shopVoList;

@io.swagger.annotations.ApiModelProperty(value="折扣",name="discount")
private Integer discount;



+ 96
- 101
mallinkService/src/main/resources/mapper/WxLevelMerchantMapper.xml Просмотреть файл

@@ -1,119 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.iformall.mapper.WxLevelMerchantMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxLevelMerchant">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="level_id" jdbcType="BIGINT" property="levelId" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="discount" jdbcType="INTEGER" property="discount" />
</resultMap>
<sql id="allColumns">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxLevelMerchant">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
<result column="level_id" jdbcType="BIGINT" property="levelId"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="discount" jdbcType="INTEGER" property="discount"/>
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`merchant_id`,`level_id`,`create_date`,`discount`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>

<if test=" null != merchantId ">
and `merchant_id` = #{merchantId}

</if>

<if test=" null != levelId ">
and `level_id` = #{levelId}

</if>

<if test=" null != createDate ">
and `create_date` = #{createDate}
</if>

<if test=" null != discount ">
and `discount` = #{discount}

</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>
<select id="findList" parameterType="com.iformall.domain.po.WxLevelMerchant" resultMap="BaseResultMap">
select <include refid="allColumns" /> from wx_level_merchant
<include refid="dynamicWhereConditions" />
</select>


<resultMap id="CVoResultMap" type="com.iformall.domain.vo.WxLevelMerchantCVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="name" jdbcType="VARCHAR" property="merchantName"/>
<result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>

<result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
<result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
<result column="floor_name" jdbcType="VARCHAR" property="floorName"/>

<result column="discount" jdbcType="INTEGER" property="discount" />
</resultMap>

<sql id="allCVoColumns">
<sql id="dynamicWhereConditions">
where 1 = 1

<if test=" null != id ">
and `id` = #{id}
</if>

<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>

<if test=" null != merchantId ">
and `merchant_id` = #{merchantId}
</if>

<if test=" null != levelId ">
and `level_id` = #{levelId}
</if>

<if test=" null != createDate ">
and `create_date` = #{createDate}
</if>

<if test=" null != discount ">
and `discount` = #{discount}
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>

<select id="findList" parameterType="com.iformall.domain.po.WxLevelMerchant" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_level_merchant
<include refid="dynamicWhereConditions"/>
</select>


<resultMap id="CVoResultMap" type="com.iformall.domain.vo.WxLevelMerchantCVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="name" jdbcType="VARCHAR" property="merchantName"/>
<result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>

<result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
<result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
<result column="floor_name" jdbcType="VARCHAR" property="floorName"/>

<result column="discount" jdbcType="INTEGER" property="discount"/>

<collection column="{merchantId=id}" property="shopVoList"
ofType="com.iformall.domain.vo.WxShopVo"
javaType="java.util.List"
select="com.iformall.mapper.WxShopMapper.findShopVoList">
</collection>
</resultMap>

<sql id="allCVoColumns">
m.id,m.name,m.link_phone,
s.shop_number,
mb.building_name,
mf.floor_name,
lm.discount
</sql>

<sql id="allCVoDynamicWhereConditions">
where 1 = 1
<sql id="allCVoDynamicWhereConditions">
where 1 = 1

<if test=" null != tenantId ">
and lm.tenant_id = #{tenantId}
</if>
<if test=" null != tenantId ">
and lm.tenant_id = #{tenantId}
</if>

<if test=" null != merchantId ">
and lm.merchant_id = #{merchantId}
</if>
<if test=" null != merchantId ">
and lm.merchant_id = #{merchantId}
</if>

<if test=" null != levelId ">
and lm.level_id = #{levelId}
<if test=" null != levelId ">
and lm.level_id = #{levelId}
</if>

</if>
<if test=" null != discount ">
and lm.discount = #{discount}
</if>

<if test=" null != discount ">
and lm.discount = #{discount}
</if>

<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>

<select id="findListCVo" parameterType="com.iformall.domain.po.WxLevelMerchant" resultMap="CVoResultMap">
select <include refid="allCVoColumns" />
from wx_level_merchant lm
inner join wx_merchant m on m.status = 1 and lm.merchant_id = m.id
left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0
left join wx_shop s on ms.shop_id = s.id
left join wx_mall_building mb on s.building = mb.id
left join wx_mall_floor mf on s.floor = mf.id
<include refid="allCVoDynamicWhereConditions" />
</select>
<select id="findListCVo" parameterType="com.iformall.domain.po.WxLevelMerchant" resultMap="CVoResultMap">
select
<include refid="allCVoColumns"/>
from wx_level_merchant lm
inner join wx_merchant m on m.status = 1 and lm.merchant_id = m.id
<include refid="allCVoDynamicWhereConditions"/>
</select>

</mapper>

Загрузка…
Отмена
Сохранить