| @@ -2,13 +2,263 @@ package com.simple.domain.vo; | |||||
| import com.simple.domain.po.WxCouponOrder; | import com.simple.domain.po.WxCouponOrder; | ||||
| import javax.persistence.Id; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| public class WxCouponOrderBVo extends WxCouponOrder{ | public class WxCouponOrderBVo extends WxCouponOrder{ | ||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| private static final long serialVersionUID = 6687954932922444531L; | private static final long serialVersionUID = 6687954932922444531L; | ||||
| @Id | |||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<Long> ids; | |||||
| @Transient | |||||
| protected String sortColumns; | |||||
| public Long getId() { | |||||
| return id; | |||||
| } | |||||
| public void setId(Long id) { | |||||
| this.id = id; | |||||
| } | |||||
| public String getSortColumns() { | |||||
| return sortColumns; | |||||
| } | |||||
| public List<Long> getIds() { | |||||
| return ids; | |||||
| } | |||||
| public void setIds(List<Long> ids) { | |||||
| this.ids = ids; | |||||
| } | |||||
| /* 基础购买到的券信息 */ | |||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "tenantId") | |||||
| private String tenantId; | |||||
| /*单张券ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "单张券ID", name = "couponId") | |||||
| private Long couponId; | |||||
| /*c端用户id**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "c端用户id", name = "cUserId") | |||||
| private Long cUserId; | |||||
| /*操作券B端小程序用户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "操作券B端小程序用户ID", name = "bUserId") | |||||
| private Long bUserId; | |||||
| /*用户订单ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId") | |||||
| private Long orderId; | |||||
| /*该订单对应券的实际过期时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间 ", name = "expiredTime") | |||||
| private Date expiredTime; | |||||
| /*状态:0,待使用 1,已核销 2,已过期 3,已作废 **/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus") | |||||
| private Integer couponOrderStatus; | |||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "createDate") | |||||
| private Date createDate; | |||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate") | |||||
| private Date updateDate; | |||||
| /*单券实际购买价格**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice") | |||||
| private Integer couponPrice; | |||||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | |||||
| private Integer type; | |||||
| /*券名称**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||||
| private String title; | |||||
| /*售价(适用于类型2,3,4,5)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | |||||
| private Integer salePrice; | |||||
| /*使用条件金额(适用于类型1,2,3,4)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||||
| private Integer usePrice; | |||||
| /*面额**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||||
| private Integer price; | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String _tenantId) { | |||||
| tenantId = _tenantId; | |||||
| } | |||||
| public Long getCouponId() { | |||||
| return couponId; | |||||
| } | |||||
| public void setCouponId(Long _couponId) { | |||||
| couponId = _couponId; | |||||
| } | |||||
| public Long getCUserId() { | |||||
| return cUserId; | |||||
| } | |||||
| public void setCUserId(Long _cUserId) { | |||||
| cUserId = _cUserId; | |||||
| } | |||||
| public Long getBUserId() { | |||||
| return bUserId; | |||||
| } | |||||
| public void setBUserId(Long _bUserId) { | |||||
| bUserId = _bUserId; | |||||
| } | |||||
| public Long getOrderId() { | |||||
| return orderId; | |||||
| } | |||||
| public void setOrderId(Long _orderId) { | |||||
| orderId = _orderId; | |||||
| } | |||||
| public Date getExpiredTime() { | |||||
| return expiredTime; | |||||
| } | |||||
| public void setExpiredTime(Date _expiredTime) { | |||||
| expiredTime = _expiredTime; | |||||
| } | |||||
| public Integer getCouponOrderStatus() { | |||||
| return couponOrderStatus; | |||||
| } | |||||
| public void setCouponOrderStatus(Integer _couponOrderStatus) { | |||||
| couponOrderStatus = _couponOrderStatus; | |||||
| } | |||||
| public Date getCreateDate() { | |||||
| return createDate; | |||||
| } | |||||
| public void setCreateDate(Date _createDate) { | |||||
| createDate = _createDate; | |||||
| } | |||||
| public Date getUpdateDate() { | |||||
| return updateDate; | |||||
| } | |||||
| public void setUpdateDate(Date _updateDate) { | |||||
| updateDate = _updateDate; | |||||
| } | |||||
| public Integer getCouponPrice() { | |||||
| return couponPrice; | |||||
| } | |||||
| public void setCouponPrice(Integer _couponPrice) { | |||||
| couponPrice = _couponPrice; | |||||
| } | |||||
| public Integer getType() { | |||||
| return type; | |||||
| } | |||||
| public void setType(Integer _type) { | |||||
| type = _type; | |||||
| } | |||||
| public String getTitle() { | |||||
| return title; | |||||
| } | |||||
| public void setTitle(String _title) { | |||||
| title = _title; | |||||
| } | |||||
| public Integer getSalePrice() { | |||||
| return salePrice; | |||||
| } | |||||
| public void setSalePrice(Integer _salePrice) { | |||||
| salePrice = _salePrice; | |||||
| } | |||||
| public Integer getUsePrice() { | |||||
| return usePrice; | |||||
| } | |||||
| public void setUsePrice(Integer _usePrice) { | |||||
| usePrice = _usePrice; | |||||
| } | |||||
| public Integer getPrice() { | |||||
| return price; | |||||
| } | |||||
| public void setPrice(Integer _price) { | |||||
| price = _price; | |||||
| } | |||||
| public static enum Field { | |||||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), | |||||
| TenantId_ASC("`tenantId` ASC"), | |||||
| TenantId_DESC("`tenantId` DESC"), | |||||
| CouponId_ASC("`couponId` ASC"), | |||||
| CouponId_DESC("`couponId` DESC"), | |||||
| CUserId_ASC("`cUserId` ASC"), | |||||
| CUserId_DESC("`cUserId` DESC"), | |||||
| BUserId_ASC("`bUserId` ASC"), | |||||
| BUserId_DESC("`bUserId` DESC"), | |||||
| OrderId_ASC("`orderId` ASC"), | |||||
| OrderId_DESC("`orderId` DESC"), | |||||
| ExpiredTime_ASC("`expiredTime` ASC"), | |||||
| ExpiredTime_DESC("`expiredTime` DESC"), | |||||
| CouponOrderStatus_ASC("`couponOrderStatus` ASC"), | |||||
| CouponOrderStatus_DESC("`couponOrderStatus` DESC"), | |||||
| CreateDate_ASC("`createDate` ASC"), | |||||
| CreateDate_DESC("`createDate` DESC"), | |||||
| UpdateDate_ASC("`updateDate` ASC"), | |||||
| UpdateDate_DESC("`updateDate` DESC"), | |||||
| CouponPrice_ASC("`couponPrice` ASC"), | |||||
| CouponPrice_DESC("`couponPrice` DESC"); | |||||
| private String value; | |||||
| Field(String value) { | |||||
| this.value = value; | |||||
| } | |||||
| public String getValue() { | |||||
| return value; | |||||
| } | |||||
| public void setCol(String value) { | |||||
| this.value = value; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| return this.getValue(); | |||||
| } | |||||
| } | |||||
| public void setSortColumns(WxCouponOrder.Field... fields) { | |||||
| if (fields == null || fields.length == 0) { | |||||
| return; | |||||
| } | |||||
| for (int k = 0; k < fields.length; k++) { | |||||
| if (fields[k] == null) { | |||||
| return; | |||||
| } | |||||
| } | |||||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||||
| for (int k = 1; k < fields.length; k++) { | |||||
| sb.append(","); | |||||
| sb.append(fields[k].toString()); | |||||
| } | |||||
| } | |||||
| public void setSortColumns(String sortColumns) { | |||||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||||
| return; | |||||
| } | |||||
| if (sortColumns.contains(",")) { | |||||
| String[] cols = sortColumns.split(","); | |||||
| java.util.List<WxCouponOrder.Field> fList = new java.util.ArrayList(); | |||||
| for (int k = 0; k < cols.length; k++) { | |||||
| fList.add(WxCouponOrder.Field.valueOf(cols[k])); | |||||
| } | |||||
| this.setSortColumns(fList.toArray(new WxCouponOrder.Field[fList.size()])); | |||||
| } else { | |||||
| this.setSortColumns(WxCouponOrder.Field.valueOf(sortColumns)); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -122,6 +122,24 @@ public class WxCouponOrderCVo extends WxCouponOrder{ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="status") | @io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="status") | ||||
| private Integer merchantStatus; | private Integer merchantStatus; | ||||
| /*地址**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="地址",name="addr") | |||||
| private String addr; | |||||
| /*百度poi(省市区县street等)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="百度poi(省市区县street等)",name="baiduPoi") | |||||
| private String baiduPoi; | |||||
| /*商铺编号**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | |||||
| private String shopNumber; | |||||
| /*楼座号**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName") | |||||
| private String buildingName; | |||||
| /*楼层号**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName") | |||||
| private String floorName; | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| } | } | ||||
| @@ -245,6 +263,35 @@ public class WxCouponOrderCVo extends WxCouponOrder{ | |||||
| remark = _remark; | remark = _remark; | ||||
| } | } | ||||
| public String getBuildingName() {return buildingName; } | |||||
| public void setBuildingName(String _building) { | |||||
| buildingName = _building; | |||||
| } | |||||
| public String getFloorName() { | |||||
| return floorName; | |||||
| } | |||||
| public void setFloorName(String _floor) { | |||||
| floorName = _floor; | |||||
| } | |||||
| public String getShopNumber() { | |||||
| return shopNumber; | |||||
| } | |||||
| public void setShopNumber(String _shopNumber) { | |||||
| shopNumber = _shopNumber; | |||||
| } | |||||
| public String getBaiduPoi() { | |||||
| return baiduPoi; | |||||
| } | |||||
| public void setBaiduPoi(String _baiduPoi) { | |||||
| baiduPoi = _baiduPoi; | |||||
| } | |||||
| public String getAddr() { | |||||
| return addr; | |||||
| } | |||||
| public void setAddr(String _addr) { | |||||
| addr = _addr; | |||||
| } | |||||
| public String getMerChantImgUrl() { | public String getMerChantImgUrl() { | ||||
| return merchantImgUrl; | return merchantImgUrl; | ||||
| @@ -91,6 +91,9 @@ | |||||
| </select> | </select> | ||||
| <sql id="allCouponOrderColumns"> | <sql id="allCouponOrderColumns"> | ||||
| c.id,c.tenant_id,c.coupon_id,c.c_user_id,c.b_user_id,c.order_id,c.expired_time,c.coupon_order_status,c.create_date,c.update_date,c.coupon_price | c.id,c.tenant_id,c.coupon_id,c.c_user_id,c.b_user_id,c.order_id,c.expired_time,c.coupon_order_status,c.create_date,c.update_date,c.coupon_price | ||||
| </sql> | </sql> | ||||
| @@ -130,11 +133,14 @@ | |||||
| <sql id="allCUserCouponOrderDetailColumns"> | <sql id="allCUserCouponOrderDetailColumns"> | ||||
| c.id,c.tenant_id,c.coupon_id,c.c_user_id,c.b_user_id,c.order_id,c.expired_time,c.coupon_order_status,c.create_date,c.update_date,c.coupon_price, | c.id,c.tenant_id,c.coupon_id,c.c_user_id,c.b_user_id,c.order_id,c.expired_time,c.coupon_order_status,c.create_date,c.update_date,c.coupon_price, | ||||
| co.merchant_id,co.type,co.cover_img,co.title,co.sub_title,co.sale_price,co.use_price,co.price,co.detail, | |||||
| m.img_url,m.name,m.link_phone,m.status | |||||
| co.merchant_id,co.type,co.cover_img,co.title,co.sub_title,co.sale_price,co.use_price,co.price,co.detail,co.remark, | |||||
| m.img_url,m.name,m.link_phone,m.status, | |||||
| s.addr,s.shop_number,s.baidu_poi, | |||||
| mb.building_name,mf.floor_name | |||||
| </sql> | </sql> | ||||
| <resultMap id="CVoResultMap" type="com.simple.domain.vo.WxCouponOrderCVo"> | <resultMap id="CVoResultMap" type="com.simple.domain.vo.WxCouponOrderCVo"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| <result column="tenant_id" jdbcType="BIGINT" property="tenantId" /> | <result column="tenant_id" jdbcType="BIGINT" property="tenantId" /> | ||||
| <result column="coupon_id" jdbcType="BIGINT" property="couponId" /> | <result column="coupon_id" jdbcType="BIGINT" property="couponId" /> | ||||
| @@ -147,6 +153,7 @@ | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| <result column="coupon_price" jdbcType="INTEGER" property="couponPrice" /> | <result column="coupon_price" jdbcType="INTEGER" property="couponPrice" /> | ||||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | ||||
| <result column="type" jdbcType="INTEGER" property="type" /> | <result column="type" jdbcType="INTEGER" property="type" /> | ||||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg" /> | <result column="cover_img" jdbcType="VARCHAR" property="coverImg" /> | ||||
| @@ -158,15 +165,24 @@ | |||||
| <result column="price" jdbcType="INTEGER" property="price" /> | <result column="price" jdbcType="INTEGER" property="price" /> | ||||
| <result column="remark" jdbcType="VARCHAR" property="remark" /> | <result column="remark" jdbcType="VARCHAR" property="remark" /> | ||||
| <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl" /> | <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl" /> | ||||
| <result column="name" jdbcType="VARCHAR" property="merchantName" /> | <result column="name" jdbcType="VARCHAR" property="merchantName" /> | ||||
| <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone" /> | <result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone" /> | ||||
| <result column="status" jdbcType="VARCHAR" property="merchantStatus" /> | <result column="status" jdbcType="VARCHAR" property="merchantStatus" /> | ||||
| <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> | </resultMap> | ||||
| <select id="findListOfCUser" parameterType="map" resultMap="CVoResultMap"> | <select id="findListOfCUser" parameterType="map" resultMap="CVoResultMap"> | ||||
| select <include refid="allCUserCouponOrderListColumns" /> from wx_coupon_order c,wx_coupon co,wx_merchant m | |||||
| select <include refid="allCUserCouponOrderListColumns" /> | |||||
| from wx_coupon_order c,wx_coupon co,wx_merchant m | |||||
| where c.c_user_id = #{cUserId} | where c.c_user_id = #{cUserId} | ||||
| and c.tenant_id = #{tenantId} | and c.tenant_id = #{tenantId} | ||||
| and c.coupon_id = co.id | and c.coupon_id = co.id | ||||
| @@ -177,12 +193,20 @@ | |||||
| </select> | </select> | ||||
| <select id="selectDetailOfCUser" parameterType="map" resultMap="CVoResultMap"> | <select id="selectDetailOfCUser" parameterType="map" resultMap="CVoResultMap"> | ||||
| select <include refid="allCUserCouponOrderDetailColumns" /> from wx_coupon_order c,wx_coupon co,wx_merchant m | |||||
| select <include refid="allCUserCouponOrderDetailColumns" /> | |||||
| from wx_coupon_order c,wx_coupon co,wx_merchant m, | |||||
| wx_shop s,wx_merchant_shop ms, | |||||
| wx_mall_building mb, | |||||
| wx_mall_floor mf | |||||
| where c.c_user_id = #{cUserId} | where c.c_user_id = #{cUserId} | ||||
| and c.tenant_id = #{tenantId} | and c.tenant_id = #{tenantId} | ||||
| and c.coupon_id = co.id | and c.coupon_id = co.id | ||||
| and c.id = #{couponOrderId} | and c.id = #{couponOrderId} | ||||
| and co.merchant_id = m.id | and co.merchant_id = m.id | ||||
| and ms.merchant_id = m.id | |||||
| and ms.shop_id = s.id | |||||
| and s.building = mb.id | |||||
| and s.floor = mf.id | |||||
| </select> | </select> | ||||