| @@ -1,71 +0,0 @@ | |||||
| package com.simple.controller; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.common.Result; | |||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.WxBanners; | |||||
| import com.simple.service.WxBannersService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxBanners") | |||||
| public class WxBannersController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxBannersService wxBannersService; | |||||
| private Logger logger = Logger.getLogger(WxBannersController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxBanners wxBanners,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxBanners) wxBanners = new WxBanners(); | |||||
| final PageInfo<WxBanners> page = wxBannersService.listAsPage(wxBanners, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxBanners wxBanners) { | |||||
| //Assert.notNull(wxBanners.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxBannersService.saveOrUpdate(wxBanners); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxBanners wxBanners) { | |||||
| wxBannersService.saveOrUpdate(wxBanners); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxBannersService.deleteById(id); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData findById(Long id) { | |||||
| return new ResultData(Result.SUCCESS,"查询成功",wxBannersService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -8,9 +8,11 @@ import java.util.Date; | |||||
| import cn.binarywang.wx.miniapp.api.WxMaService; | import cn.binarywang.wx.miniapp.api.WxMaService; | ||||
| import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; | import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; | ||||
| import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig; | import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig; | ||||
| import com.simple.common.ErrorCode; | |||||
| import com.simple.domain.po.WxAppinfo; | import com.simple.domain.po.WxAppinfo; | ||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.domain.po.WxMerchantBUser; | import com.simple.domain.po.WxMerchantBUser; | ||||
| import com.simple.exception.MallinkException; | |||||
| import com.simple.interceptor.AuthorizationInterceptor; | import com.simple.interceptor.AuthorizationInterceptor; | ||||
| import com.simple.service.WxAppinfoService; | import com.simple.service.WxAppinfoService; | ||||
| import com.simple.service.WxCUserService; | import com.simple.service.WxCUserService; | ||||
| @@ -59,6 +61,8 @@ public class BaseController { | |||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | ||||
| Long cUserId = (Long) request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | Long cUserId = (Long) request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | ||||
| WxMerchantBUser user = wxMerchantBUserService.getById(cUserId); | WxMerchantBUser user = wxMerchantBUserService.getById(cUserId); | ||||
| if (user == null) | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||||
| return user; | return user; | ||||
| } | } | ||||
| @@ -66,6 +70,8 @@ public class BaseController { | |||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | ||||
| Long cUserId = (Long) request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | Long cUserId = (Long) request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | ||||
| WxMerchantBUser user = wxMerchantBUserService.getById(cUserId); | WxMerchantBUser user = wxMerchantBUserService.getById(cUserId); | ||||
| if (user == null) | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||||
| return user.getTenantId(); | return user.getTenantId(); | ||||
| } | } | ||||
| @@ -99,6 +99,8 @@ public class WxCouponOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | ||||
| } | } | ||||
| return new ResultData(wxCouponOrderService.detailBUserVo(getUser().getId(), couponOrderId)); | return new ResultData(wxCouponOrderService.detailBUserVo(getUser().getId(), couponOrderId)); | ||||
| } | } | ||||
| @@ -9,8 +9,10 @@ import cn.binarywang.wx.miniapp.api.WxMaService; | |||||
| import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; | import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; | ||||
| import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig; | import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig; | ||||
| import com.simple.annotation.AuthIgnore; | import com.simple.annotation.AuthIgnore; | ||||
| import com.simple.common.ErrorCode; | |||||
| import com.simple.domain.po.WxAppinfo; | import com.simple.domain.po.WxAppinfo; | ||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.exception.MallinkException; | |||||
| import com.simple.interceptor.AuthorizationInterceptor; | import com.simple.interceptor.AuthorizationInterceptor; | ||||
| import com.simple.service.WxAppinfoService; | import com.simple.service.WxAppinfoService; | ||||
| import com.simple.service.WxCUserService; | import com.simple.service.WxCUserService; | ||||
| @@ -57,6 +59,8 @@ public class BaseController { | |||||
| HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); | HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); | ||||
| Long cUserId = (Long)request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | Long cUserId = (Long)request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | ||||
| WxCUser user = wxCUserService.getById(cUserId); | WxCUser user = wxCUserService.getById(cUserId); | ||||
| if (user == null) | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||||
| return user; | return user; | ||||
| } | } | ||||
| @@ -70,10 +74,13 @@ public class BaseController { | |||||
| HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); | HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); | ||||
| Long cUserId = (Long)request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | Long cUserId = (Long)request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | ||||
| WxCUser user = wxCUserService.getById(cUserId); | WxCUser user = wxCUserService.getById(cUserId); | ||||
| if (user == null) | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||||
| return user.getTenantId(); | return user.getTenantId(); | ||||
| } | } | ||||
| public WxAppinfo getAppInfo(String appId) { | public WxAppinfo getAppInfo(String appId) { | ||||
| return wxAppinfoService.getByAppId(appId); | return wxAppinfoService.getByAppId(appId); | ||||
| } | } | ||||
| @@ -1,71 +0,0 @@ | |||||
| package com.simple.controller; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.common.Result; | |||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.WxBanners; | |||||
| import com.simple.service.WxBannersService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxBanners") | |||||
| public class WxBannersController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxBannersService wxBannersService; | |||||
| private Logger logger = Logger.getLogger(WxBannersController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxBanners wxBanners,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxBanners) wxBanners = new WxBanners(); | |||||
| final PageInfo<WxBanners> page = wxBannersService.listAsPage(wxBanners, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxBanners wxBanners) { | |||||
| //Assert.notNull(wxBanners.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxBannersService.saveOrUpdate(wxBanners); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxBanners wxBanners) { | |||||
| wxBannersService.saveOrUpdate(wxBanners); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxBannersService.deleteById(id); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData findById(Long id) { | |||||
| return new ResultData(Result.SUCCESS,"查询成功",wxBannersService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -23,7 +23,7 @@ import java.util.List; | |||||
| import static com.simple.domain.po.WxCampaign.Field.SortNum_ASC; | import static com.simple.domain.po.WxCampaign.Field.SortNum_ASC; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCampaign") | |||||
| @RequestMapping("/api/wxCampaign") | |||||
| @Api(description="促销和banner接口") | @Api(description="促销和banner接口") | ||||
| public class WxCampaignController extends BaseController | public class WxCampaignController extends BaseController | ||||
| { | { | ||||
| @@ -1,191 +0,0 @@ | |||||
| 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 java.io.Serializable; | |||||
| @Table(name = "wx_banners") | |||||
| public class WxBanners implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @Id | |||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<String> 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<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; | |||||
| /*封面图**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="facePicUrl") | |||||
| private String facePicUrl; | |||||
| /*活动类型 1h5页面2视频**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="活动类型 1h5页面2视频",name="activityType") | |||||
| private Integer activityType; | |||||
| /*链接**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="链接",name="url") | |||||
| private String url; | |||||
| /*排序**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="排序",name="sortNum") | |||||
| private Integer sortNum; | |||||
| /*创建时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||||
| private Date createtime; | |||||
| /*上线时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="上线时间",name="uptime") | |||||
| private Date uptime; | |||||
| /*说明**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="说明",name="desc") | |||||
| private String desc; | |||||
| /*状态 1启用 2停用**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="状态 1启用 2停用",name="isEnable") | |||||
| private Integer isEnable; | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String _tenantId) { | |||||
| tenantId = _tenantId; | |||||
| } | |||||
| public String getFacePicUrl() { | |||||
| return facePicUrl; | |||||
| } | |||||
| public void setFacePicUrl(String _facePicUrl) { | |||||
| facePicUrl = _facePicUrl; | |||||
| } | |||||
| public Integer getActivityType() { | |||||
| return activityType; | |||||
| } | |||||
| public void setActivityType(Integer _activityType) { | |||||
| activityType = _activityType; | |||||
| } | |||||
| public String getUrl() { | |||||
| return url; | |||||
| } | |||||
| public void setUrl(String _url) { | |||||
| url = _url; | |||||
| } | |||||
| public Integer getSortNum() { | |||||
| return sortNum; | |||||
| } | |||||
| public void setSortNum(Integer _sortNum) { | |||||
| sortNum = _sortNum; | |||||
| } | |||||
| public Date getCreatetime() { | |||||
| return createtime; | |||||
| } | |||||
| public void setCreatetime(Date _createtime) { | |||||
| createtime = _createtime; | |||||
| } | |||||
| public Date getUptime() { | |||||
| return uptime; | |||||
| } | |||||
| public void setUptime(Date _uptime) { | |||||
| uptime = _uptime; | |||||
| } | |||||
| public String getDesc() { | |||||
| return desc; | |||||
| } | |||||
| public void setDesc(String _desc) { | |||||
| desc = _desc; | |||||
| } | |||||
| public Integer getIsEnable() { | |||||
| return isEnable; | |||||
| } | |||||
| public void setIsEnable(Integer _isEnable) { | |||||
| isEnable = _isEnable; | |||||
| } | |||||
| public static enum Field | |||||
| { | |||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||||
| ,FacePicUrl_ASC("`facePicUrl` ASC"),FacePicUrl_DESC("`facePicUrl` DESC") | |||||
| ,ActivityType_ASC("`activityType` ASC"),ActivityType_DESC("`activityType` DESC") | |||||
| ,Url_ASC("`url` ASC"),Url_DESC("`url` DESC") | |||||
| ,SortNum_ASC("`sortNum` ASC"),SortNum_DESC("`sortNum` DESC") | |||||
| ,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` DESC") | |||||
| ,Uptime_ASC("`uptime` ASC"),Uptime_DESC("`uptime` DESC") | |||||
| ,Desc_ASC("`desc` ASC"),Desc_DESC("`desc` DESC") | |||||
| ,IsEnable_ASC("`isEnable` ASC"),IsEnable_DESC("`isEnable` 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(WxBanners.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<Field> fList = new java.util.ArrayList(); | |||||
| for (int k = 0; k < cols.length; k++) { | |||||
| fList.add(Field.valueOf(cols[k])); | |||||
| } | |||||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||||
| } else { | |||||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -1,17 +0,0 @@ | |||||
| package com.simple.mapper; | |||||
| import java.util.*; | |||||
| import com.simple.common.CommonMapper; | |||||
| import org.apache.ibatis.annotations.Param; | |||||
| import com.simple.domain.po.WxBanners; | |||||
| public interface WxBannersMapper extends CommonMapper<WxBanners, String> { | |||||
| List<WxBanners> findList(WxBanners wxBanners); | |||||
| } | |||||
| @@ -1,48 +0,0 @@ | |||||
| package com.simple.service; | |||||
| import java.util.*; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.domain.po.WxBanners; | |||||
| public interface WxBannersService { | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param offset | |||||
| * @param limit | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxBanners> listAsPage(WxBanners record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxBanners getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxBanners record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| } | |||||
| @@ -1,54 +0,0 @@ | |||||
| package com.simple.service.impl; | |||||
| import java.util.*; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.domain.po.WxBanners; | |||||
| import com.simple.mapper.WxBannersMapper; | |||||
| import com.simple.service.WxBannersService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.simple.common.IdWorker; | |||||
| @Service | |||||
| public class WxBannersServiceImpl implements WxBannersService { | |||||
| @Autowired | |||||
| WxBannersMapper wxBannersMapper; | |||||
| @Override | |||||
| public PageInfo<WxBanners> listAsPage(WxBanners record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBannersMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxBanners getById(Long id) { | |||||
| return wxBannersMapper.selectByPrimaryKey(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxBanners record) { | |||||
| if (record.getId() == null) { | |||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| wxBannersMapper.insertSelective(record); | |||||
| } else { | |||||
| wxBannersMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| wxBannersMapper.deleteByPrimaryKey(id); | |||||
| } | |||||
| } | |||||
| @@ -200,8 +200,10 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| paramMap.put("merchantId", wxMerchant.getId()); | paramMap.put("merchantId", wxMerchant.getId()); | ||||
| paramMap.put("tenantId", wxMerchant.getTenantId()); | paramMap.put("tenantId", wxMerchant.getTenantId()); | ||||
| paramMap.put("couponOrderId", couponOrderId); | paramMap.put("couponOrderId", couponOrderId); | ||||
| return new ResultData(wxCouponOrderMapper.selectDetailOfCUser(paramMap)); | |||||
| WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderMapper.selectDetailOfCUser(paramMap); | |||||
| if (wxCouponOrderCVo == null) | |||||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||||
| return new ResultData(wxCouponOrderCVo); | |||||
| } | } | ||||
| @@ -1,92 +0,0 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.simple.mapper.WxBannersMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.simple.domain.po.WxBanners"> | |||||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="face_pic_url" jdbcType="VARCHAR" property="facePicUrl" /> | |||||
| <result column="activity_type" jdbcType="INTEGER" property="activityType" /> | |||||
| <result column="url" jdbcType="VARCHAR" property="url" /> | |||||
| <result column="sort_num" jdbcType="INTEGER" property="sortNum" /> | |||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | |||||
| <result column="uptime" jdbcType="TIMESTAMP" property="uptime" /> | |||||
| <result column="desc" jdbcType="VARCHAR" property="desc" /> | |||||
| <result column="is_enable" jdbcType="INTEGER" property="isEnable" /> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`face_pic_url`,`activity_type`,`url`,`sort_num`,`createtime`,`uptime`,`desc`,`is_enable` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| </if> | |||||
| <if test=" null != facePicUrl "> | |||||
| and `face_pic_url` like concat('%', #{facePicUrl},'%') | |||||
| </if> | |||||
| <if test=" null != activityType "> | |||||
| and `activity_type` = #{activityType} | |||||
| </if> | |||||
| <if test=" null != url "> | |||||
| and `url` like concat('%', #{url},'%') | |||||
| </if> | |||||
| <if test=" null != sortNum "> | |||||
| and `sort_num` = #{sortNum} | |||||
| </if> | |||||
| <if test=" null != createtime "> | |||||
| and `createtime` = #{createtime} | |||||
| </if> | |||||
| <if test=" null != uptime "> | |||||
| and `uptime` = #{uptime} | |||||
| </if> | |||||
| <if test=" null != desc "> | |||||
| and `desc` like concat('%', #{desc},'%') | |||||
| </if> | |||||
| <if test=" null != isEnable "> | |||||
| and `is_enable` = #{isEnable} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.simple.domain.po.WxBanners" resultMap="BaseResultMap"> | |||||
| select <include refid="allColumns" /> from wx_banners | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| </mapper> | |||||