Browse Source

[C端][修改][显示多商铺]

release_toaliyun_real
gongbiao 7 years ago
parent
commit
03f742cdab
4 changed files with 49 additions and 62 deletions
  1. +4
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java
  2. +1
    -20
      mallinkService/src/main/resources/mapper/WxCouponMerchantMapper.xml
  3. +25
    -42
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml
  4. +19
    -0
      mallinkService/src/main/resources/mapper/WxShopMapper.xml

+ 4
- 0
mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java View File

@@ -28,4 +28,8 @@ public interface WxShopMapper extends CommonMapper<WxShop, String> {
int hasShopNumber(WxShop wxShop);

List<WxShopVo> findListWithMerchantMap(WxShop record);

List<WxShopVo> findShopVoList(Map map);


}

+ 1
- 20
mallinkService/src/main/resources/mapper/WxCouponMerchantMapper.xml View File

@@ -80,30 +80,11 @@
<collection column="{merchantId=id}" property="shopVoList"
ofType="com.iformall.domain.vo.WxShopVo"
javaType="java.util.List"
select="com.iformall.mapper.WxCouponMerchantMapper.findShopVoList">
select="com.iformall.mapper.WxShopMapper.findShopVoList">
</collection>
</resultMap>
<resultMap id="ShopVoResultMap" type="com.iformall.domain.vo.WxShopVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="addr" jdbcType="VARCHAR" property="addr"/>
<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="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
</resultMap>
<select id="findShopVoList" parameterType="java.util.Map" resultMap="ShopVoResultMap">
select s.id,s.shop_number,b.building_name,f.floor_name,s.addr,s.baidu_poi
from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id
left join wx_merchant m on ms.merchant_id=m.id
left join wx_mall_building b on s.building=b.id
left join wx_mall_floor f on s.floor=f.id
where s.is_del=0 and ms.is_del=0
and m.id=#{merchantId}
</select>
<select id="findMerchantVoList" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
select
<include refid="allMerchantVoColumns"/>


+ 25
- 42
mallinkService/src/main/resources/mapper/WxMerchantMapper.xml View File

@@ -114,36 +114,15 @@
<sql id="allMerchantVoColumns">
m.id,
m.img_url,m.name,m.link_phone,m.status,m.business_id,m.sub_business_id,
s.addr,s.shop_number,s.baidu_poi,
mb.building_name,mf.floor_name,m.is_public,m.email
m.is_public,m.email
</sql>

<resultMap id="MerchantVoResultMap" type="com.iformall.domain.vo.WxMerchantVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl"/>
<result column="name" jdbcType="VARCHAR" property="merchantName"/>
<result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>
<result column="status" jdbcType="VARCHAR" property="merchantStatus"/>
<result column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="sub_business_id" jdbcType="INTEGER" property="subBusinessId"/>
<result column="addr" jdbcType="VARCHAR" property="addr"/>
<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="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
<result column="is_public" jdbcType="SMALLINT" property="isPublic"/>
<result column="email" property="email"/>
</resultMap>


<select id="getMerchantByCode" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
select
<include refid="allMerchantVoColumns"/>
FROM wx_merchant m
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
left join wx_merchant_shop ms on ms.merchant_id = m.id
where ms.is_del = 0
<where>
<if test=" null != tenantId ">
and m.`tenant_id` = #{tenantId}
@@ -156,16 +135,32 @@
</if>
</where>
</select>
<resultMap id="MerchantVoResultMap" type="com.iformall.domain.vo.WxMerchantVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl"/>
<result column="name" jdbcType="VARCHAR" property="merchantName"/>
<result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>
<result column="status" jdbcType="VARCHAR" property="merchantStatus"/>
<result column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="sub_business_id" jdbcType="INTEGER" property="subBusinessId"/>
<result column="is_public" jdbcType="INTEGER" property="isPublic"/>
<result column="email" jdbcType="VARCHAR" property="email"/>
<collection column="{merchantId=id}" property="shopVoList"
ofType="com.iformall.domain.vo.WxShopVo"
javaType="java.util.List"
select="com.iformall.mapper.WxShopMapper.findShopVoList">
</collection>
</resultMap>

<select id="findListCVo" parameterType="com.iformall.domain.vo.WxMerchantVo" resultMap="MerchantVoResultMap">
select
<include refid="allMerchantVoColumns"/>
FROM wx_merchant m
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
where 1 = 1
left join wx_merchant_shop ms on ms.merchant_id = m.id
where ms.is_del = 0
<if test=" null != merchantName and ''!=merchantName ">
and m.`name` like concat('%', #{merchantName},'%')
</if>
@@ -185,18 +180,6 @@
<if test=" null != merchantStatus ">
and m.`status` = #{merchantStatus}
</if>

<if test=" null != shopNumber and ''!=shopNumber ">
and s.`shop_number` like concat('%', #{shopNumber},'%')
</if>

<if test=" null != buildingName and ''!=buildingName ">
and mb.`building_name` like concat('%', #{buildingName},'%')
</if>

<if test=" null != floorName and ''!=floorName ">
and mf.`floor_name` like concat('%', #{floorName},'%')
</if>
<if test=" null != isPublic">
and m.`is_public` = #{isPublic}


+ 19
- 0
mallinkService/src/main/resources/mapper/WxShopMapper.xml View File

@@ -479,5 +479,24 @@
and id != #{id}
</if>
</select>
<resultMap id="ShopVoResultMap" type="com.iformall.domain.vo.WxShopVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="addr" jdbcType="VARCHAR" property="addr"/>
<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="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
</resultMap>
<select id="findShopVoList" parameterType="java.util.Map" resultMap="ShopVoResultMap">
select s.id,s.shop_number,b.building_name,f.floor_name,s.addr,s.baidu_poi
from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id
left join wx_merchant m on ms.merchant_id=m.id
left join wx_mall_building b on s.building=b.id
left join wx_mall_floor f on s.floor=f.id
where s.is_del=0 and ms.is_del=0
and m.id=#{merchantId}
</select>

</mapper>

Loading…
Cancel
Save