| @@ -104,6 +104,10 @@ public class WxBillDaily implements Serializable { | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Integer getReceivePay() { | |||
| return receivePay; | |||
| } | |||
| @@ -189,7 +193,13 @@ public class WxBillDaily implements Serializable { | |||
| updatetime = _updatetime; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| @@ -98,6 +98,9 @@ public class WxBillDeposit implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| @@ -219,6 +222,14 @@ public class WxBillDeposit implements Serializable { | |||
| this.merchantName = merchantName; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -115,6 +115,10 @@ public class WxBillOther implements Serializable { | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Integer getReceivePay() { | |||
| return receivePay; | |||
| } | |||
| @@ -200,7 +204,13 @@ public class WxBillOther implements Serializable { | |||
| updatetime = _updatetime; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| @@ -98,6 +98,9 @@ public class WxBillProperty implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| @@ -222,6 +225,14 @@ public class WxBillProperty implements Serializable { | |||
| this.merchantName = merchantName; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -98,6 +98,9 @@ public class WxBillPropertyDeposit implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| @@ -221,6 +224,14 @@ public class WxBillPropertyDeposit implements Serializable { | |||
| this.merchantName = merchantName; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -100,6 +100,9 @@ public class WxBillRent implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| @@ -223,6 +226,14 @@ public class WxBillRent implements Serializable { | |||
| this.updatetime = updatetime; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.service; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| @@ -66,4 +67,8 @@ public interface WxRentContractService { | |||
| void updateApplyStatus(WxRentContract wxRentContract); | |||
| void buildRent(WxMerchant wxMerchant, Long userId); | |||
| void buildDeposit(WxMerchant wxMerchant, Long userId); | |||
| } | |||
| @@ -14,6 +14,7 @@ import com.iformall.mapper.*; | |||
| import com.iformall.service.WxCouponService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxProfitSharingReceiverService; | |||
| import com.iformall.service.WxRentContractService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -75,6 +76,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| @Autowired | |||
| WxCouponMerchantMapper wxCouponMerchantMapper; | |||
| @Autowired | |||
| WxRentContractService wxRentContractService; | |||
| @Override | |||
| public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { | |||
| @@ -311,9 +315,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); | |||
| wxRentContractMapper.updateByPrimaryKeySelective(wxRentContract); | |||
| //创建账单 | |||
| buildRent(wxMerchant, userId); | |||
| wxRentContractService.buildRent(wxMerchant, userId); | |||
| //创建押金 | |||
| buildDeposit(wxMerchant, userId); | |||
| wxRentContractService.buildDeposit(wxMerchant, userId); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "商户创建成功", merchantId); | |||
| } catch (Exception e) { | |||
| @@ -507,165 +511,4 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| } | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildDeposit(WxMerchant wxMerchant, Long userId) { | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| wxRentContract.setMerchantId(wxMerchant.getId()); | |||
| List<WxRentContract> list = wxRentContractMapper.findList(wxRentContract); | |||
| if (list.size() > 0) { | |||
| wxRentContract = list.get(0); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxBillDeposit wxBillDeposit = new WxBillDeposit(); | |||
| wxBillDeposit.setId(idWorker.nextId()); | |||
| wxBillDeposit.setRentContractId(wxRentContract.getId()); | |||
| wxBillDeposit.setReceivePay(0); | |||
| wxBillDeposit.setPay(0); | |||
| int needpay = wxRentContract.getDeposit(); | |||
| wxBillDeposit.setNeedPay(needpay); | |||
| wxBillDeposit.setOwe(needpay); | |||
| Date date = new Date(); | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(wxRentContract.getRentalStartDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| wxBillDeposit.setReceiveDate(time); | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillDeposit.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillDeposit.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillDeposit.getReceiveDate()); | |||
| instance.add(Calendar.MONTH, wxRentContract.getLease()); | |||
| wxBillDeposit.setEndtime(instance.getTime()); | |||
| //截止收租日在当前时间之前 | |||
| if (wxBillDeposit.getReceiveDate().before(date)) { | |||
| long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000); | |||
| wxBillDeposit.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||
| wxBillDeposit.setExpiredDay(day); | |||
| } else { | |||
| wxBillDeposit.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||
| wxBillDeposit.setExpiredDay(0L); | |||
| } | |||
| wxBillDeposit.setTenantId(wxMerchant.getTenantId()); | |||
| wxBillDeposit.setIsDel(0); | |||
| wxBillDeposit.setMerchantId(wxMerchant.getId()); | |||
| wxBillDeposit.setUserId(userId); | |||
| wxBillDeposit.setShopId(wxRentContract.getShopId()); | |||
| wxBillDeposit.setCreatetime(date); | |||
| wxBillDeposit.setUpdatetime(date); | |||
| try { | |||
| wxBillDepositMapper.insertSelective(wxBillDeposit); | |||
| } catch (Exception e) { | |||
| logger.error("添加押金账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildRent(WxMerchant wxMerchant, Long userId) { | |||
| WxRentContract wxRentContract = new WxRentContract(); | |||
| wxRentContract.setMerchantId(wxMerchant.getId()); | |||
| //根据商户ID找出合同 | |||
| List<WxRentContract> list = wxRentContractMapper.findList(wxRentContract); | |||
| if (list.size() > 0) { | |||
| wxRentContract = list.get(0); | |||
| int receivePeriod = wxRentContract.getReceivePeriod().intValue(); | |||
| Integer lease = wxRentContract.getLease(); | |||
| int extralease = lease % receivePeriod; | |||
| int extracount = extralease > 0 ? 1 : 0; | |||
| int paycount = lease / receivePeriod + extracount; | |||
| int index = paycount - 1; | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| for (int i = 0; i < paycount; i++) { | |||
| WxBillRent wxBillRent = new WxBillRent(); | |||
| wxBillRent.setId(idWorker.nextId()); | |||
| wxBillRent.setRentContractId(wxRentContract.getId()); | |||
| wxBillRent.setReceivePay(0); | |||
| wxBillRent.setPay(0); | |||
| Date date = new Date(); | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(wxRentContract.getRentalStartDate()); | |||
| instance.add(Calendar.MONTH, receivePeriod * i); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| wxBillRent.setReceiveDate(time); | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillRent.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getStarttime()); | |||
| instance.add(Calendar.MONTH, receivePeriod); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| wxBillRent.setEndtime(instance.getTime()); | |||
| int needpay = wxRentContract.getPrice() * receivePeriod; | |||
| if (extracount > 0 && i == index) { | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillRent.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getStarttime()); | |||
| instance.add(Calendar.MONTH, extralease); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| wxBillRent.setEndtime(instance.getTime()); | |||
| needpay = wxRentContract.getPrice() * extralease; | |||
| } | |||
| wxBillRent.setNeedPay(needpay); | |||
| wxBillRent.setOwe(needpay); | |||
| //截止收租日在当前时间之前 | |||
| if (wxBillRent.getReceiveDate().before(date)) { | |||
| long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000); | |||
| wxBillRent.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||
| wxBillRent.setExpiredDay(day); | |||
| } else {//截止收租日在当前时间之后 | |||
| Calendar now = Calendar.getInstance(); | |||
| now.add(Calendar.MONTH, receivePeriod); | |||
| Date currenttime = now.getTime(); | |||
| //当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴 | |||
| if (currenttime.before(wxBillRent.getReceiveDate())) { | |||
| wxBillRent.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode()); | |||
| wxBillRent.setExpiredDay(0L); | |||
| } else { | |||
| wxBillRent.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||
| wxBillRent.setExpiredDay(0L); | |||
| } | |||
| } | |||
| wxBillRent.setTenantId(wxRentContract.getTenantId()); | |||
| wxBillRent.setIsDel(0); | |||
| wxBillRent.setMerchantId(wxRentContract.getMerchantId()); | |||
| wxBillRent.setUserId(userId); | |||
| wxBillRent.setShopId(wxRentContract.getShopId()); | |||
| wxBillRent.setCreatetime(date); | |||
| wxBillRent.setUpdatetime(date); | |||
| try { | |||
| wxBillRentMapper.insertSelective(wxBillRent); | |||
| } catch (Exception e) { | |||
| logger.error("添加租赁账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -168,7 +168,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| wxRentContractMapper.insertSelective(record); | |||
| //建立账单 | |||
| if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) | |||
| /*if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) | |||
| && record.getReceivePeriod() != null && record.getDeposit() > 0 && record.getPrice() > 0) { | |||
| WxBillRent wxBillRent = new WxBillRent(); | |||
| wxBillRent.setMerchantId(record.getMerchantId()); | |||
| @@ -182,7 +182,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //押金 | |||
| buildDeposit(wxMerchant, userId); | |||
| } | |||
| } | |||
| }*/ | |||
| } catch (Exception e) { | |||
| logger.error("保存租赁合同信息失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| @@ -244,7 +244,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| wxRentContractMapper.updateByPrimaryKeySelective(record); | |||
| //建立账单 | |||
| if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) | |||
| /*if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) | |||
| && record.getReceivePeriod() != null && record.getDeposit() > 0 && record.getPrice() > 0) { | |||
| WxBillRent wxBillRent = new WxBillRent(); | |||
| wxBillRent.setMerchantId(record.getMerchantId()); | |||
| @@ -258,7 +258,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //押金 | |||
| buildDeposit(wxMerchant, userId); | |||
| } | |||
| } | |||
| }*/ | |||
| } catch (Exception e) { | |||
| logger.error("更新租赁合同信息失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| @@ -18,11 +18,14 @@ | |||
| <result column="shop_id" jdbcType="BIGINT" property="shopId" /> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`type` | |||
| `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | |||
| `tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`type`, | |||
| `rent_shop_type` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -43,6 +46,7 @@ | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != type "> and `type` = #{type} </if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -62,7 +66,7 @@ | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||
| br.`merchant_id` merchantId,br.shop_id shopId,br.type | |||
| br.`merchant_id` merchantId,br.shop_id shopId,br.type,br.`rent_shop_type` rentShopType | |||
| from wx_bill_daily br left join wx_merchant m on br.merchant_id=m.id | |||
| left join wx_shop s on br.shop_id=s.id | |||
| <where> | |||
| @@ -73,6 +77,8 @@ | |||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | |||
| <if test=" null != type ">and br.`type` = #{type}</if> | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| </where> | |||
| order by id desc | |||
| </select> | |||
| @@ -19,10 +19,14 @@ | |||
| <result column="user_id" jdbcType="BIGINT" property="userId" /> | |||
| <result column="shop_id" jdbcType="BIGINT" property="shopId" /> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> | |||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime` | |||
| `id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`, | |||
| `expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime`, | |||
| `rent_shop_type` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -42,8 +46,10 @@ | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime ">and `updatetime` = #{updatetime}</if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -63,7 +69,7 @@ | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||
| br.`merchant_id` merchantId | |||
| br.`merchant_id` merchantId,br.`rent_shop_type` rentShopType | |||
| from wx_bill_rent_deposit br left join wx_merchant m on br.merchant_id=m.id | |||
| left join wx_shop s on br.shop_id=s.id | |||
| <where> | |||
| @@ -73,6 +79,7 @@ | |||
| <if test=" null != tenantId ">and br.`tenant_id` = #{tenantId}</if> | |||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| </where> | |||
| order by id desc | |||
| @@ -19,11 +19,14 @@ | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> | |||
| <result column="name" jdbcType="VARCHAR" property="name" /> | |||
| <result column="comments" jdbcType="VARCHAR" property="comments" /> | |||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`name`,`comments` | |||
| `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | |||
| `tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`name`,`comments`, | |||
| `rent_shop_type` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -44,6 +47,7 @@ | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != name "> and `name` = #{name} </if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -63,7 +67,7 @@ | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||
| br.`merchant_id` merchantId,br.shop_id shopId,br.name,br.comments | |||
| br.`merchant_id` merchantId,br.shop_id shopId,br.name,br.comments,br.`rent_shop_type` rentShopType | |||
| from wx_bill_other br left join wx_merchant m on br.merchant_id=m.id | |||
| left join wx_shop s on br.shop_id=s.id | |||
| <where> | |||
| @@ -74,6 +78,8 @@ | |||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | |||
| <if test=" null != name ">and br.`name` = #{name}</if> | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| </where> | |||
| order by id desc | |||
| </select> | |||
| @@ -19,10 +19,14 @@ | |||
| <result column="user_id" jdbcType="INTEGER" property="userId" /> | |||
| <result column="shop_id" jdbcType="INTEGER" property="shopId" /> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> | |||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime` | |||
| `id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`, | |||
| `pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`, | |||
| `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -42,8 +46,10 @@ | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime ">and `updatetime` = #{updatetime}</if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -62,7 +68,7 @@ | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||
| br.`merchant_id` merchantId | |||
| br.`merchant_id` merchantId,br.`rent_shop_type` rentShopType | |||
| from wx_bill_property_deposit br left join wx_merchant m on br.merchant_id=m.id | |||
| left join wx_shop s on br.shop_id=s.id | |||
| <where> | |||
| @@ -72,6 +78,8 @@ | |||
| <if test=" null != tenantId ">and br.`tenant_id` = #{tenantId}</if> | |||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| </where> | |||
| order by id desc | |||
| @@ -19,10 +19,14 @@ | |||
| <result column="user_id" jdbcType="INTEGER" property="userId" /> | |||
| <result column="shop_id" jdbcType="INTEGER" property="shopId" /> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> | |||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime` | |||
| `id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | |||
| `createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`, | |||
| `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -42,8 +46,10 @@ | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime ">and `updatetime` = #{updatetime}</if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -62,7 +68,7 @@ | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||
| br.`merchant_id` merchantId | |||
| br.`merchant_id` merchantId,br.`rent_shop_type` rentShopType | |||
| from wx_bill_property br left join wx_merchant m on br.merchant_id=m.id | |||
| left join wx_shop s on br.shop_id=s.id | |||
| <where> | |||
| @@ -73,7 +79,8 @@ | |||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | |||
| <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if> | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| </where> | |||
| order by id desc | |||
| </select> | |||
| @@ -19,12 +19,15 @@ | |||
| <result column="user_id" jdbcType="BIGINT" property="userId"/> | |||
| <result column="shop_id" jdbcType="BIGINT" property="shopId"/> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime` | |||
| `id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | |||
| `createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`, | |||
| `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -46,7 +49,7 @@ | |||
| <if test=" null != userId ">and `user_id` = #{userId}</if> | |||
| <if test=" null != shopId ">and `shop_id` = #{shopId}</if> | |||
| <if test=" null != updatetime ">and `updatetime` = #{updatetime}</if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -69,7 +72,7 @@ | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||
| br.`merchant_id` merchantId | |||
| br.`merchant_id` merchantId,br.`rent_shop_type` rentShopType | |||
| from wx_bill_rent br left join wx_merchant m on br.merchant_id=m.id | |||
| left join wx_shop s on br.shop_id=s.id | |||
| <where> | |||
| @@ -80,6 +83,8 @@ | |||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | |||
| <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if> | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| </where> | |||
| order by id desc | |||
| </select> | |||
| @@ -303,6 +303,13 @@ | |||
| SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and status!=1 and status!=5 and status!=6 and status!=7 and merchant_id is not null | |||
| ) | |||
| </if> | |||
| <if test=" null != type "> | |||
| and s.`type` = #{type} | |||
| </if> | |||
| <if test=" null != pointType "> | |||
| and s.`point_type` = #{pointType} | |||
| </if> | |||
| <if test=" null != sortColumns">order by s.${sortColumns}</if> | |||
| </select> | |||