| @@ -12,6 +12,7 @@ import lombok.ToString; | |||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | |||||
| @TableName(value = "wx_shop") | @TableName(value = "wx_shop") | ||||
| @Data | @Data | ||||
| @@ -20,7 +21,9 @@ import java.util.Date; | |||||
| public class WxShop extends TenantEntity { | public class WxShop extends TenantEntity { | ||||
| protected Long id; | protected Long id; | ||||
| @TableField(exist = false) | |||||
| private List<Long> notInIdList; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long rentContractId; | private Long rentContractId; | ||||
| @@ -59,4 +59,6 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||||
| List<Map<String, Object>> currentValidByMerchantId(WxRentContract rentContract); | List<Map<String, Object>> currentValidByMerchantId(WxRentContract rentContract); | ||||
| List<Long> getUsedRentShopIds(WxRentContract wxRentContract); | |||||
| } | } | ||||
| @@ -475,6 +475,12 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| @Override | @Override | ||||
| public PageInfo<Map<String, Object>> listShopFromContract(WxShop wxShop, Integer pageIndex, Integer pageSize) { | public PageInfo<Map<String, Object>> listShopFromContract(WxShop wxShop, Integer pageIndex, Integer pageSize) { | ||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| WxRentContract wxRentContractQ = new WxRentContract(); | |||||
| wxRentContractQ.updateTenantInfo(wxShop); | |||||
| List<Long> usedShopIds = wxRentContractMapper.getUsedRentShopIds(wxRentContractQ); | |||||
| if (null != usedShopIds && usedShopIds.size() > 0 ) { | |||||
| wxShop.setNotInIdList(usedShopIds); | |||||
| } | |||||
| List<Map<String,Object>> shops = wxShopMapper.listShopFromContract(wxShop); | List<Map<String,Object>> shops = wxShopMapper.listShopFromContract(wxShop); | ||||
| if (null != shops) { | if (null != shops) { | ||||
| Map<Long, String> floorMap = this.getFloorMap(wxShop); | Map<Long, String> floorMap = this.getFloorMap(wxShop); | ||||
| @@ -536,6 +536,17 @@ | |||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id="getUsedRentShopIds" parameterType="com.iformall.domain.po.WxRentContract" resultType="Long"> | |||||
| SELECT distinct shop_id FROM wx_rent_contract WHERE status in(1,2,3,4,8) | |||||
| and rent_shop_type=2 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -461,16 +461,11 @@ | |||||
| <if test=" null != status"> | <if test=" null != status"> | ||||
| and s.`status` = #{status} | and s.`status` = #{status} | ||||
| </if> | </if> | ||||
| <if test="null!=status and status==1 and type!=null and type==2"> | |||||
| <if test="null != notInIdList and null!=status and status==1 and type!=null and type==2"> | |||||
| and s.id not in( | and s.id not in( | ||||
| SELECT shop_id FROM wx_rent_contract WHERE status in(1,2,3,4,8) | |||||
| and rent_shop_type=2 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <foreach collection="notInIdList" index="index" item="notInIdItem" open="(" separator="," close=")"> | |||||
| #{notInIdItem} | |||||
| </foreach> | |||||
| ) | ) | ||||
| </if> | </if> | ||||
| <if test=" null != type "> | <if test=" null != type "> | ||||