| @@ -49,6 +49,13 @@ public class WxMerchant implements Serializable { | |||||
| @Transient | @Transient | ||||
| private List<WxMerchantBUser> bUsers; | private List<WxMerchantBUser> bUsers; | ||||
| /*租期开始时间**/ | |||||
| @Transient | |||||
| private Date rentalStartDate; | |||||
| /*租期结束时间**/ | |||||
| @Transient | |||||
| private Date rentalEndDate; | |||||
| /*租户ID**/ | /*租户ID**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| @@ -86,6 +93,10 @@ public class WxMerchant implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="状态1可用0停用",name="status") | @io.swagger.annotations.ApiModelProperty(value="状态1可用0停用",name="status") | ||||
| private Integer status; | private Integer status; | ||||
| @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") | |||||
| private String linkPerson; | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| } | } | ||||
| @@ -196,20 +207,44 @@ public class WxMerchant implements Serializable { | |||||
| this.bUsers = bUsers; | this.bUsers = bUsers; | ||||
| } | } | ||||
| public Date getRentalStartDate() { | |||||
| return rentalStartDate; | |||||
| } | |||||
| public void setRentalStartDate(Date rentalStartDate) { | |||||
| this.rentalStartDate = rentalStartDate; | |||||
| } | |||||
| public Date getRentalEndDate() { | |||||
| return rentalEndDate; | |||||
| } | |||||
| public void setRentalEndDate(Date rentalEndDate) { | |||||
| this.rentalEndDate = rentalEndDate; | |||||
| } | |||||
| public String getLinkPerson() { | |||||
| return linkPerson; | |||||
| } | |||||
| public void setLinkPerson(String linkPerson) { | |||||
| this.linkPerson = linkPerson; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||||
| ,ImgUrl_ASC("`imgUrl` ASC"),ImgUrl_DESC("`imgUrl` DESC") | |||||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||||
| ,ImgUrl_ASC("`img_url` ASC"),ImgUrl_DESC("`img_url` DESC") | |||||
| ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") | ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") | ||||
| ,LinkPhone_ASC("`linkPhone` ASC"),LinkPhone_DESC("`linkPhone` DESC") | |||||
| ,BankCard_ASC("`bankCard` ASC"),BankCard_DESC("`bankCard` DESC") | |||||
| ,BankName_ASC("`bankName` ASC"),BankName_DESC("`bankName` DESC") | |||||
| ,PayId_ASC("`payId` ASC"),PayId_DESC("`payId` DESC") | |||||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||||
| ,CarVendorType_ASC("`carVendorType` ASC"),CarVendorType_DESC("`carVendorType` DESC") | |||||
| ,CarParams_ASC("`carParams` ASC"),CarParams_DESC("`carParams` DESC") | |||||
| ,LinkPhone_ASC("`link_phone` ASC"),LinkPhone_DESC("`link_phone` DESC") | |||||
| ,BankCard_ASC("`bank_card` ASC"),BankCard_DESC("`bank_card` DESC") | |||||
| ,BankName_ASC("`bank_name` ASC"),BankName_DESC("`bank_name` DESC") | |||||
| ,PayId_ASC("`pay_id` ASC"),PayId_DESC("`pay_id` DESC") | |||||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") | |||||
| ,CarVendorType_ASC("`car_vendor_type` ASC"),CarVendorType_DESC("`car_vendor_type` DESC") | |||||
| ,CarParams_ASC("`car_params` ASC"),CarParams_DESC("`car_params` DESC") | |||||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | ||||
| ; | ; | ||||
| @@ -244,7 +279,8 @@ public class WxMerchant implements Serializable { | |||||
| sb.append(","); | sb.append(","); | ||||
| sb.append(fields[k].toString()); | sb.append(fields[k].toString()); | ||||
| } | } | ||||
| this.sortColumns=sb.toString(); | |||||
| } | } | ||||
| public void setSortColumns(String sortColumns) | public void setSortColumns(String sortColumns) | ||||
| @@ -1,12 +1,11 @@ | |||||
| package com.simple.domain.po; | package com.simple.domain.po; | ||||
| import javax.persistence.*; | |||||
| import java.util.*; | |||||
| import java.math.*; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.List; | |||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import javax.persistence.Table; | |||||
| import javax.persistence.Transient; | |||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Table(name = "wx_merchant_shop") | @Table(name = "wx_merchant_shop") | ||||
| public class WxMerchantShop implements Serializable { | public class WxMerchantShop implements Serializable { | ||||
| @@ -62,6 +61,10 @@ public class WxMerchantShop implements Serializable { | |||||
| /*租期结束时间**/ | /*租期结束时间**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="租期结束时间",name="rentalEndDate") | @io.swagger.annotations.ApiModelProperty(value="租期结束时间",name="rentalEndDate") | ||||
| private Date rentalEndDate; | private Date rentalEndDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value="删除状态",name="isDel") | |||||
| private Integer isDel; | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| } | } | ||||
| @@ -105,7 +108,13 @@ public class WxMerchantShop implements Serializable { | |||||
| rentalEndDate = _rentalEndDate; | rentalEndDate = _rentalEndDate; | ||||
| } | } | ||||
| public Integer getIsDel() { | |||||
| return isDel; | |||||
| } | |||||
| public void setIsDel(Integer isDel) { | |||||
| this.isDel = isDel; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| @@ -149,7 +158,9 @@ public class WxMerchantShop implements Serializable { | |||||
| sb.append(","); | sb.append(","); | ||||
| sb.append(fields[k].toString()); | sb.append(fields[k].toString()); | ||||
| } | } | ||||
| this.sortColumns=sb.toString(); | |||||
| } | } | ||||
| public void setSortColumns(String sortColumns) | public void setSortColumns(String sortColumns) | ||||
| @@ -50,10 +50,13 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(id); | WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(id); | ||||
| WxMerchantShop wxMerchantShop=new WxMerchantShop(); | WxMerchantShop wxMerchantShop=new WxMerchantShop(); | ||||
| wxMerchantShop.setMerchantId(wxMerchant.getId()); | wxMerchantShop.setMerchantId(wxMerchant.getId()); | ||||
| wxMerchantShop.setIsDel(0); | |||||
| List<WxShop> shops = new ArrayList<>(); | List<WxShop> shops = new ArrayList<>(); | ||||
| List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); | List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); | ||||
| for(WxMerchantShop merchantShop:wxMerchantShopList){ | for(WxMerchantShop merchantShop:wxMerchantShopList){ | ||||
| wxMerchant.setRentalStartDate(merchantShop.getRentalStartDate()); | |||||
| wxMerchant.setRentalEndDate(merchantShop.getRentalStartDate()); | |||||
| WxShop wxShop = WxShopMapper.selectByPrimaryKey(merchantShop.getShopId()); | WxShop wxShop = WxShopMapper.selectByPrimaryKey(merchantShop.getShopId()); | ||||
| if(wxShop!=null) | if(wxShop!=null) | ||||
| shops.add(wxShop); | shops.add(wxShop); | ||||
| @@ -113,8 +116,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| Date shopdate = new Date(); | Date shopdate = new Date(); | ||||
| wxMerchantShop.setUpdateDate(shopdate); | wxMerchantShop.setUpdateDate(shopdate); | ||||
| wxMerchantShop.setCreateDate(shopdate); | wxMerchantShop.setCreateDate(shopdate); | ||||
| wxMerchantShop.setRentalEndDate(shopdate); | |||||
| wxMerchantShop.setRentalStartDate(shopdate); | |||||
| wxMerchantShop.setIsDel(0); | |||||
| wxMerchantShop.setRentalStartDate(wxMerchant.getRentalStartDate()); | |||||
| wxMerchantShop.setRentalEndDate(wxMerchant.getRentalEndDate()); | |||||
| wxMerchantShopMapper.insertSelective(wxMerchantShop); | wxMerchantShopMapper.insertSelective(wxMerchantShop); | ||||
| //更新商铺状态 | //更新商铺状态 | ||||
| @@ -155,7 +159,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxMerchantShopQuery.setMerchantId(wxMerchant.getId()); | wxMerchantShopQuery.setMerchantId(wxMerchant.getId()); | ||||
| List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShopQuery); | List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShopQuery); | ||||
| for(WxMerchantShop merchantShop:wxMerchantShopList){ | for(WxMerchantShop merchantShop:wxMerchantShopList){ | ||||
| wxMerchantShopMapper.delete(merchantShop); | |||||
| merchantShop.setIsDel(1); | |||||
| wxMerchantShopMapper.updateByPrimaryKeySelective(merchantShop); | |||||
| //更新商铺状态 | //更新商铺状态 | ||||
| WxShop wxShop = new WxShop(); | WxShop wxShop = new WxShop(); | ||||
| @@ -175,8 +180,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| Date shopdate = new Date(); | Date shopdate = new Date(); | ||||
| wxMerchantShop.setUpdateDate(shopdate); | wxMerchantShop.setUpdateDate(shopdate); | ||||
| wxMerchantShop.setCreateDate(shopdate); | wxMerchantShop.setCreateDate(shopdate); | ||||
| wxMerchantShop.setRentalEndDate(shopdate); | |||||
| wxMerchantShop.setRentalStartDate(shopdate); | |||||
| wxMerchantShop.setRentalStartDate(wxMerchant.getRentalStartDate()); | |||||
| wxMerchantShop.setRentalEndDate(wxMerchant.getRentalEndDate()); | |||||
| wxMerchantShop.setIsDel(0); | |||||
| wxMerchantShopMapper.insertSelective(wxMerchantShop); | wxMerchantShopMapper.insertSelective(wxMerchantShop); | ||||
| //更新商铺状态 | //更新商铺状态 | ||||
| @@ -15,11 +15,12 @@ | |||||
| <result column="car_vendor_type" jdbcType="INTEGER" property="carVendorType" /> | <result column="car_vendor_type" jdbcType="INTEGER" property="carVendorType" /> | ||||
| <result column="car_params" jdbcType="VARCHAR" property="carParams" /> | <result column="car_params" jdbcType="VARCHAR" property="carParams" /> | ||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="link_person" jdbcType="VARCHAR" property="linkPerson" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`img_url`,`name`,`link_phone`,`bank_card`,`bank_name`,`receiver_account`,`create_date`,`update_date`,`car_vendor_type`,`car_params`,`status` | |||||
| `id`,`tenant_id`,`img_url`,`name`,`link_phone`,`bank_card`,`bank_name`,`receiver_account`,`create_date`,`update_date`,`car_vendor_type`,`car_params`,`status`,`link_person` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -87,8 +88,12 @@ | |||||
| <if test=" null != status "> | <if test=" null != status "> | ||||
| and `status` = #{status} | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != linkPerson "> | |||||
| and `link_person` = #{linkPerson} | |||||
| </if> | </if> | ||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| @@ -10,10 +10,12 @@ | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| <result column="rental_start_date" jdbcType="TIMESTAMP" property="rentalStartDate" /> | <result column="rental_start_date" jdbcType="TIMESTAMP" property="rentalStartDate" /> | ||||
| <result column="rental_end_date" jdbcType="TIMESTAMP" property="rentalEndDate" /> | <result column="rental_end_date" jdbcType="TIMESTAMP" property="rentalEndDate" /> | ||||
| <result column="is_del" jdbcType="SMALLINT" property="isDel" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`merchant_id`,`shop_id`,`create_date`,`update_date`,`rental_start_date`,`rental_end_date` | |||||
| `id`,`tenant_id`,`merchant_id`,`shop_id`,`create_date`,`update_date`,`rental_start_date`,`rental_end_date`,`is_del` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -55,9 +57,11 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != rentalEndDate "> | <if test=" null != rentalEndDate "> | ||||
| and `rental_end_date` = #{rentalEndDate} | |||||
| </if> | |||||
| and `rental_end_date` = #{rentalEndDate} | |||||
| </if> | |||||
| <if test=" null != isDel "> | |||||
| and `is_del` = #{isDel} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||