| @@ -1,4 +1,6 @@ | |||
| .idea/** | |||
| mallinkAdmin/target/** | |||
| mallinkApi/target/** | |||
| mallinkService/target/** | |||
| mallinkService/target/** | |||
| logs/** | |||
| uploads/** | |||
| @@ -19,7 +19,7 @@ import com.simple.service.MallPermissionService; | |||
| */ | |||
| @RestController | |||
| @RequestMapping("permission") | |||
| public class SysPermissionController { | |||
| public class MallPermissionController { | |||
| @Autowired | |||
| MallPermissionService mallPermissionService; | |||
| @@ -1,78 +1,78 @@ | |||
| package com.simple.controller; | |||
| import com.simple.domain.po.MallRole; | |||
| import com.simple.service.MallRoleService; | |||
| import com.simple.service.MallRolePermissionService; | |||
| import io.swagger.annotations.Api; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.util.Assert; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| @RestController | |||
| @RequestMapping("role") | |||
| @Api(description="角色相关接口") | |||
| public class RoleController { | |||
| @Autowired | |||
| private MallRoleService sysRoleService; | |||
| @Autowired | |||
| private MallRolePermissionService SysRolePermissionService; | |||
| private Logger logger = Logger.getLogger(RoleController.class); | |||
| @GetMapping("list") | |||
| public ResultData list(MallRole sysRole, Integer pageNum, Integer pageSize) { | |||
| final PageInfo<MallRole> page = sysRoleService.listAsPage(sysRole, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @PostMapping("add") | |||
| public ResultData add(MallRole sysRole) { | |||
| Assert.notNull(sysRole.getName(), "角色名不能为空"); | |||
| Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| sysRoleService.saveOrUpdate(sysRole); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(MallRole sysRole) { | |||
| if (sysRole.getName() != null) { | |||
| System.out.println(checkUnique(sysRole.getName(), sysRole.getId())); | |||
| Assert.isTrue(!checkUnique(sysRole.getName(), sysRole.getId()), "角色名已存在"); | |||
| } | |||
| sysRoleService.saveOrUpdate(sysRole); | |||
| // Assert.notNull(sysRole.getName(), "角色名不能为空"); | |||
| return new ResultData(); | |||
| } | |||
| @GetMapping("/del") | |||
| public ResultData delete(Long id) { | |||
| sysRoleService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @GetMapping("setPermission") | |||
| public ResultData setPermission(Long roleId, String perId) { | |||
| Assert.notNull(perId,"请选择权限"); | |||
| /*String[] perIds = perId.split(","); | |||
| SysRolePermissionService.savePermissions(roleId, perIds);*/ | |||
| //TODO | |||
| return new ResultData(Result.SUCCESS, "设置角色权限成功", null); | |||
| } | |||
| private boolean checkUnique(String name, Long id) { | |||
| return sysRoleService.countByName(name, id) > 0 ? true : false; | |||
| } | |||
| } | |||
| package com.simple.controller; | |||
| import com.simple.domain.po.MallRole; | |||
| import com.simple.service.MallRoleService; | |||
| import com.simple.service.MallRolePermissionService; | |||
| import io.swagger.annotations.Api; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.util.Assert; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| @RestController | |||
| @RequestMapping("role") | |||
| @Api(description="角色相关接口") | |||
| public class MallRoleController { | |||
| @Autowired | |||
| private MallRoleService sysRoleService; | |||
| @Autowired | |||
| private MallRolePermissionService SysRolePermissionService; | |||
| private Logger logger = Logger.getLogger(MallRoleController.class); | |||
| @GetMapping("list") | |||
| public ResultData list(MallRole sysRole, Integer pageNum, Integer pageSize) { | |||
| final PageInfo<MallRole> page = sysRoleService.listAsPage(sysRole, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @PostMapping("add") | |||
| public ResultData add(MallRole sysRole) { | |||
| Assert.notNull(sysRole.getName(), "角色名不能为空"); | |||
| Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| sysRoleService.saveOrUpdate(sysRole); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(MallRole sysRole) { | |||
| if (sysRole.getName() != null) { | |||
| System.out.println(checkUnique(sysRole.getName(), sysRole.getId())); | |||
| Assert.isTrue(!checkUnique(sysRole.getName(), sysRole.getId()), "角色名已存在"); | |||
| } | |||
| sysRoleService.saveOrUpdate(sysRole); | |||
| // Assert.notNull(sysRole.getName(), "角色名不能为空"); | |||
| return new ResultData(); | |||
| } | |||
| @GetMapping("/del") | |||
| public ResultData delete(Long id) { | |||
| sysRoleService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @GetMapping("setPermission") | |||
| public ResultData setPermission(Long roleId, String perId) { | |||
| Assert.notNull(perId,"请选择权限"); | |||
| /*String[] perIds = perId.split(","); | |||
| SysRolePermissionService.savePermissions(roleId, perIds);*/ | |||
| //TODO | |||
| return new ResultData(Result.SUCCESS, "设置角色权限成功", null); | |||
| } | |||
| private boolean checkUnique(String name, Long id) { | |||
| return sysRoleService.countByName(name, id) > 0 ? true : false; | |||
| } | |||
| } | |||
| @@ -32,7 +32,7 @@ import io.swagger.annotations.ApiOperation; | |||
| @Api(value = "API - UserInfoController", description = "用户接口") | |||
| @RestController | |||
| @RequestMapping("user") | |||
| public class UserInfoController { | |||
| public class MallUserInfoController { | |||
| @Autowired | |||
| MallUserInfoService userInfoService; | |||
| @@ -47,6 +47,9 @@ public class WxBusiness implements Serializable { | |||
| /*业态名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="业态名",name="title") | |||
| private String title; | |||
| /*1.优惠券**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="1.优惠券",name="type") | |||
| private Integer type; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @@ -65,6 +68,12 @@ public class WxBusiness implements Serializable { | |||
| public void setTitle(String _title) { | |||
| title = _title; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer _type) { | |||
| type = _type; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| @@ -85,6 +94,7 @@ public class WxBusiness implements Serializable { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ; | |||
| @@ -104,7 +114,7 @@ public class WxBusiness implements Serializable { | |||
| } | |||
| } | |||
| public void setSortColumns(WxBusiness.Field... fields) | |||
| public void setSortColumns(Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| @@ -129,7 +139,7 @@ public class WxBusiness implements Serializable { | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| List<Field> fList = new ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| @@ -11,15 +11,15 @@ import java.io.Serializable; | |||
| @Table(name = "wx_coupon") | |||
| public class WxCoupon implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| @@ -27,20 +27,20 @@ public class WxCoupon implements Serializable { | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| @@ -68,6 +68,12 @@ public class WxCoupon implements Serializable { | |||
| /*限领张数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") | |||
| private Integer useLimitQuantity; | |||
| /*投放频道位置(1.banner图,2.限时抢购)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="投放频道位置(1.banner图,2.限时抢购)",name="targetAd") | |||
| private Integer targetAd; | |||
| /*1.主动领取2.定向投放**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") | |||
| private Integer sendType; | |||
| /*发放开始时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="发放开始时间",name="sendStartDate") | |||
| private Date sendStartDate; | |||
| @@ -86,7 +92,6 @@ public class WxCoupon implements Serializable { | |||
| /*须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | |||
| private String detail; | |||
| /*业态**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="业态",name="businesses") | |||
| private String businesses; | |||
| @@ -99,6 +104,9 @@ public class WxCoupon implements Serializable { | |||
| /*总数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="总数",name="total") | |||
| private Integer total; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="使用须知",name="remark") | |||
| private String remark; | |||
| /*状态(0:草稿,1:待生效,2:已生效,3:已失效,4:已作废)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:草稿,1:待生效,2:已生效,3:已失效,4:已作废)",name="status") | |||
| private Integer status; | |||
| @@ -108,6 +116,9 @@ public class WxCoupon implements Serializable { | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| /*业态**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="业态",name="business") | |||
| private String business; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| @@ -162,6 +173,18 @@ public class WxCoupon implements Serializable { | |||
| public void setUseLimitQuantity(Integer _useLimitQuantity) { | |||
| useLimitQuantity = _useLimitQuantity; | |||
| } | |||
| public Integer getTargetAd() { | |||
| return targetAd; | |||
| } | |||
| public void setTargetAd(Integer _targetAd) { | |||
| targetAd = _targetAd; | |||
| } | |||
| public Integer getSendType() { | |||
| return sendType; | |||
| } | |||
| public void setSendType(Integer _sendType) { | |||
| sendType = _sendType; | |||
| } | |||
| public Date getSendStartDate() { | |||
| return sendStartDate; | |||
| } | |||
| @@ -198,7 +221,6 @@ public class WxCoupon implements Serializable { | |||
| public void setDetail(String _detail) { | |||
| detail = _detail; | |||
| } | |||
| public String getBusinesses() { | |||
| return businesses; | |||
| } | |||
| @@ -223,6 +245,12 @@ public class WxCoupon implements Serializable { | |||
| public void setTotal(Integer _total) { | |||
| total = _total; | |||
| } | |||
| public String getRemark() { | |||
| return remark; | |||
| } | |||
| public void setRemark(String _remark) { | |||
| remark = _remark; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| @@ -241,37 +269,45 @@ public class WxCoupon implements Serializable { | |||
| public void setUpdateDate(Date _updateDate) { | |||
| updateDate = _updateDate; | |||
| } | |||
| public String getBusiness() { | |||
| return business; | |||
| } | |||
| public void setBusiness(String _business) { | |||
| business = _business; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,CoverImg_ASC("`coverImg` ASC"),CoverImg_DESC("`coverImg` DESC") | |||
| ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") | |||
| ,SubTitle_ASC("`subTitle` ASC"),SubTitle_DESC("`subTitle` DESC") | |||
| ,SalePrice_ASC("`salePrice` ASC"),SalePrice_DESC("`salePrice` DESC") | |||
| ,UsePrice_ASC("`usePrice` ASC"),UsePrice_DESC("`usePrice` DESC") | |||
| ,UseLimitQuantity_ASC("`useLimitQuantity` ASC"),UseLimitQuantity_DESC("`useLimitQuantity` DESC") | |||
| ,SendStartDate_ASC("`sendStartDate` ASC"),SendStartDate_DESC("`sendStartDate` DESC") | |||
| ,SendEndDate_ASC("`sendEndDate` ASC"),SendEndDate_DESC("`sendEndDate` DESC") | |||
| ,ValidStartDate_ASC("`validStartDate` ASC"),ValidStartDate_DESC("`validStartDate` DESC") | |||
| ,ValidEndDate_ASC("`validEndDate` ASC"),ValidEndDate_DESC("`validEndDate` DESC") | |||
| ,ValidDays_ASC("`validDays` ASC"),ValidDays_DESC("`validDays` DESC") | |||
| ,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` DESC") | |||
| ,SendType_ASC("`sendType` ASC"),SendType_DESC("`sendType` DESC") | |||
| ,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` DESC") | |||
| ,Businesses_ASC("`businesses` ASC"),Businesses_DESC("`businesses` DESC") | |||
| ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") | |||
| ,Number_ASC("`number` ASC"),Number_DESC("`number` DESC") | |||
| ,Total_ASC("`total` ASC"),Total_DESC("`total` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ; | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,CoverImg_ASC("`coverImg` ASC"),CoverImg_DESC("`coverImg` DESC") | |||
| ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") | |||
| ,SubTitle_ASC("`subTitle` ASC"),SubTitle_DESC("`subTitle` DESC") | |||
| ,SalePrice_ASC("`salePrice` ASC"),SalePrice_DESC("`salePrice` DESC") | |||
| ,UsePrice_ASC("`usePrice` ASC"),UsePrice_DESC("`usePrice` DESC") | |||
| ,UseLimitQuantity_ASC("`useLimitQuantity` ASC"),UseLimitQuantity_DESC("`useLimitQuantity` DESC") | |||
| ,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` DESC") | |||
| ,SendType_ASC("`sendType` ASC"),SendType_DESC("`sendType` DESC") | |||
| ,SendStartDate_ASC("`sendStartDate` ASC"),SendStartDate_DESC("`sendStartDate` DESC") | |||
| ,SendEndDate_ASC("`sendEndDate` ASC"),SendEndDate_DESC("`sendEndDate` DESC") | |||
| ,ValidStartDate_ASC("`validStartDate` ASC"),ValidStartDate_DESC("`validStartDate` DESC") | |||
| ,ValidEndDate_ASC("`validEndDate` ASC"),ValidEndDate_DESC("`validEndDate` DESC") | |||
| ,ValidDays_ASC("`validDays` ASC"),ValidDays_DESC("`validDays` DESC") | |||
| ,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` DESC") | |||
| ,Businesses_ASC("`businesses` ASC"),Businesses_DESC("`businesses` DESC") | |||
| ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") | |||
| ,Number_ASC("`number` ASC"),Number_DESC("`number` DESC") | |||
| ,Total_ASC("`total` ASC"),Total_DESC("`total` DESC") | |||
| ,Remark_ASC("`remark` ASC"),Remark_DESC("`remark` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ,Business_ASC("`business` ASC"),Business_DESC("`business` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| @@ -287,7 +323,7 @@ public class WxCoupon implements Serializable { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxCoupon.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| @@ -303,9 +339,9 @@ public class WxCoupon implements Serializable { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| @@ -68,9 +68,18 @@ public class WxShop implements Serializable { | |||
| /*店铺相对位置y**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="店铺相对位置y",name="y") | |||
| private BigDecimal y; | |||
| /*百度poi**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="百度poi",name="baiduPoi") | |||
| /*地址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="地址",name="addr") | |||
| private String addr; | |||
| /*百度poi(省市区县street等)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="百度poi(省市区县street等)",name="baiduPoi") | |||
| private String baiduPoi; | |||
| /*经度- baidu poi**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="经度- baidu poi",name="longitude") | |||
| private BigDecimal longitude; | |||
| /*维度-baidu poi**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="维度-baidu poi",name="latitude") | |||
| private BigDecimal latitude; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @@ -131,12 +140,30 @@ public class WxShop implements Serializable { | |||
| public void setY(BigDecimal _y) { | |||
| y = _y; | |||
| } | |||
| public String getAddr() { | |||
| return addr; | |||
| } | |||
| public void setAddr(String _addr) { | |||
| addr = _addr; | |||
| } | |||
| public String getBaiduPoi() { | |||
| return baiduPoi; | |||
| } | |||
| public void setBaiduPoi(String _baiduPoi) { | |||
| baiduPoi = _baiduPoi; | |||
| } | |||
| public BigDecimal getLongitude() { | |||
| return longitude; | |||
| } | |||
| public void setLongitude(BigDecimal _longitude) { | |||
| longitude = _longitude; | |||
| } | |||
| public BigDecimal getLatitude() { | |||
| return latitude; | |||
| } | |||
| public void setLatitude(BigDecimal _latitude) { | |||
| latitude = _latitude; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| @@ -164,7 +191,10 @@ public class WxShop implements Serializable { | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,X_ASC("`x` ASC"),X_DESC("`x` DESC") | |||
| ,Y_ASC("`y` ASC"),Y_DESC("`y` DESC") | |||
| ,Addr_ASC("`addr` ASC"),Addr_DESC("`addr` DESC") | |||
| ,BaiduPoi_ASC("`baiduPoi` ASC"),BaiduPoi_DESC("`baiduPoi` DESC") | |||
| ,Longitude_ASC("`longitude` ASC"),Longitude_DESC("`longitude` DESC") | |||
| ,Latitude_ASC("`latitude` ASC"),Latitude_DESC("`latitude` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ; | |||
| @@ -32,7 +32,7 @@ public class MallPermissionServiceImpl implements MallPermissionService { | |||
| public void saveOrUpdate(MallPermission record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| record.setId(new IdWorker(0, 0).nextId()); | |||
| mallPermissionMapper.insertSelective(record); | |||
| } else { | |||
| mallPermissionMapper.updateByPrimaryKeySelective(record); | |||
| @@ -5,12 +5,13 @@ | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="title" jdbcType="VARCHAR" property="title" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`title`,`create_date`,`update_date` | |||
| `id`,`tenant_id`,`title`,`type`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -31,6 +32,11 @@ | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| @@ -12,6 +12,8 @@ | |||
| <result column="sale_price" jdbcType="DECIMAL" property="salePrice" /> | |||
| <result column="use_price" jdbcType="DECIMAL" property="usePrice" /> | |||
| <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity" /> | |||
| <result column="target_ad" jdbcType="INTEGER" property="targetAd" /> | |||
| <result column="send_type" jdbcType="INTEGER" property="sendType" /> | |||
| <result column="send_start_date" jdbcType="TIMESTAMP" property="sendStartDate" /> | |||
| <result column="send_end_date" jdbcType="TIMESTAMP" property="sendEndDate" /> | |||
| <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate" /> | |||
| @@ -22,13 +24,15 @@ | |||
| <result column="price" jdbcType="DECIMAL" property="price" /> | |||
| <result column="number" jdbcType="INTEGER" property="number" /> | |||
| <result column="total" jdbcType="INTEGER" property="total" /> | |||
| <result column="remark" jdbcType="VARCHAR" property="remark" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="business" jdbcType="VARCHAR" property="business" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`merchant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`send_start_date`,`send_end_date`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`send_type`,`target_ad`,`businesses`,`price`,`number`,`total`,`status`,`create_date`,`update_date` | |||
| `id`,`tenant_id`,`merchant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`target_ad`,`send_type`,`send_start_date`,`send_end_date`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`businesses`,`price`,`number`,`total`,`remark`,`status`,`create_date`,`update_date`,`business` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -84,6 +88,16 @@ | |||
| </if> | |||
| <if test=" null != targetAd "> | |||
| and `target_ad` = #{targetAd} | |||
| </if> | |||
| <if test=" null != sendType "> | |||
| and `send_type` = #{sendType} | |||
| </if> | |||
| <if test=" null != sendStartDate "> | |||
| and `send_start_date` = #{sendStartDate} | |||
| @@ -113,7 +127,6 @@ | |||
| and `detail` like concat('%', #{detail},'%') | |||
| </if> | |||
| <if test=" null != businesses "> | |||
| and `businesses` like concat('%', #{businesses},'%') | |||
| @@ -135,6 +148,11 @@ | |||
| </if> | |||
| <if test=" null != remark "> | |||
| and `remark` like concat('%', #{remark},'%') | |||
| </if> | |||
| <if test=" null != status "> | |||
| and `status` = #{status} | |||
| @@ -148,6 +166,11 @@ | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != business "> | |||
| and `business` like concat('%', #{business},'%') | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -12,13 +12,16 @@ | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="x" jdbcType="DECIMAL" property="x" /> | |||
| <result column="y" jdbcType="DECIMAL" property="y" /> | |||
| <result column="addr" jdbcType="VARCHAR" property="addr" /> | |||
| <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi" /> | |||
| <result column="longitude" jdbcType="DECIMAL" property="longitude" /> | |||
| <result column="latitude" jdbcType="DECIMAL" property="latitude" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,`floor`,`status`,`x`,`y`,`baidu_poi`,`create_date`,`update_date` | |||
| `id`,`tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,`floor`,`status`,`x`,`y`,`addr`,`baidu_poi`,`longitude`,`latitude`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -74,11 +77,26 @@ | |||
| </if> | |||
| <if test=" null != addr "> | |||
| and `addr` like concat('%', #{addr},'%') | |||
| </if> | |||
| <if test=" null != baiduPoi "> | |||
| and `baidu_poi` like concat('%', #{baiduPoi},'%') | |||
| </if> | |||
| <if test=" null != longitude "> | |||
| and `longitude` = #{longitude} | |||
| </if> | |||
| <if test=" null != latitude "> | |||
| and `latitude` = #{latitude} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||