| @@ -18,10 +18,13 @@ import com.alibaba.fastjson.JSONObject; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.dto.WxCuerBasicInfoDto; | |||||
| import com.simple.domain.po.WxCUser; | |||||
| import com.simple.domain.po.WxCUserBasicInfo; | import com.simple.domain.po.WxCUserBasicInfo; | ||||
| import com.simple.domain.po.WxCUserTags; | import com.simple.domain.po.WxCUserTags; | ||||
| import com.simple.domain.po.WxTags; | import com.simple.domain.po.WxTags; | ||||
| import com.simple.service.WxCUserBasicInfoService; | import com.simple.service.WxCUserBasicInfoService; | ||||
| import com.simple.service.WxCUserService; | |||||
| import com.simple.service.WxCUserTagsService; | import com.simple.service.WxCUserTagsService; | ||||
| import com.simple.service.WxTagsService; | import com.simple.service.WxTagsService; | ||||
| @@ -43,6 +46,9 @@ public class WxCUserBasicInfoController extends BaseController | |||||
| @Autowired | @Autowired | ||||
| private WxTagsService wxTagsService; | private WxTagsService wxTagsService; | ||||
| @Autowired | |||||
| private WxCUserService wxCUserService; | |||||
| private Logger logger = Logger.getLogger(WxCUserBasicInfoController.class); | private Logger logger = Logger.getLogger(WxCUserBasicInfoController.class); | ||||
| @@ -51,12 +57,36 @@ public class WxCUserBasicInfoController extends BaseController | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | ||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxCUserBasicInfo wxCUserBasicInfo,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCUserBasicInfo) wxCUserBasicInfo = new WxCUserBasicInfo(); | |||||
| wxCUserBasicInfo.setTenantId(getTenantId()); | |||||
| final PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageNum, pageSize); | |||||
| public ResultData list(@ModelAttribute WxCuerBasicInfoDto wxCUserBasicInfo,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCUserBasicInfo) wxCUserBasicInfo = new WxCuerBasicInfoDto(); | |||||
| String tenantId = getTenantId(); | |||||
| wxCUserBasicInfo.setTenantId(tenantId); | |||||
| PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.list(wxCUserBasicInfo, pageNum, pageSize); | |||||
| if(page.getSize()==0 && StringUtils.isNotBlank(wxCUserBasicInfo.getPhone()) | |||||
| && wxCUserBasicInfo.getEndTime()==null && wxCUserBasicInfo.getStartTime()==null | |||||
| && StringUtils.isBlank(wxCUserBasicInfo.getName()) | |||||
| ) {//当只有手机号查询并且查不到数据 ,新增 | |||||
| WxCUser cUser = new WxCUser(); | |||||
| cUser.setTenantId(tenantId); | |||||
| cUser.setPhone(wxCUserBasicInfo.getPhone()); | |||||
| PageInfo<WxCUser> cUsers = wxCUserService.listAsPage(cUser, 1, 1); | |||||
| if(cUsers.getSize()>0) { | |||||
| createUserBasicInfo(cUsers.getList().get(0)); | |||||
| page = wxCUserBasicInfoService.list(wxCUserBasicInfo, pageNum, pageSize); | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| private void createUserBasicInfo(WxCUser wxCUser) { | |||||
| WxCUserBasicInfo wxCUserBasicInfo =new WxCUserBasicInfo(); | |||||
| wxCUserBasicInfo.setCUserId(wxCUser.getId()); | |||||
| wxCUserBasicInfo.setPhone(wxCUser.getPhone()); | |||||
| wxCUserBasicInfo.setTenantId(wxCUser.getTenantId()); | |||||
| wxCUserBasicInfoService.saveOrUpdate(wxCUserBasicInfo); | |||||
| } | |||||
| // @ApiOperation("新增接口") | // @ApiOperation("新增接口") | ||||
| // @PostMapping("add") | // @PostMapping("add") | ||||
| @@ -73,7 +103,7 @@ public class WxCUserBasicInfoController extends BaseController | |||||
| wxCUserBasicInfo.setTenantId(getTenantId()); | wxCUserBasicInfo.setTenantId(getTenantId()); | ||||
| if(StringUtils.isNotBlank(wxCUserBasicInfo.getTags())) { | if(StringUtils.isNotBlank(wxCUserBasicInfo.getTags())) { | ||||
| WxCUserTags record =new WxCUserTags(); | WxCUserTags record =new WxCUserTags(); | ||||
| record.setUserId(wxCUserBasicInfo.getcUserId()); | |||||
| record.setUserId(wxCUserBasicInfo.getCUserId()); | |||||
| record.setTenantId(getTenantId()); | record.setTenantId(getTenantId()); | ||||
| PageInfo<WxCUserTags> page = wxCUserTagsService.listAsPage(record, 1, 1); | PageInfo<WxCUserTags> page = wxCUserTagsService.listAsPage(record, 1, 1); | ||||
| if(page.getSize()>0) { | if(page.getSize()>0) { | ||||
| @@ -0,0 +1,80 @@ | |||||
| package com.simple.domain.dto; | |||||
| import java.io.Serializable; | |||||
| import java.util.Date; | |||||
| import javax.persistence.Transient; | |||||
| /** | |||||
| * 用户查询dto | |||||
| * @author jinguo | |||||
| * | |||||
| */ | |||||
| public class WxCuerBasicInfoDto implements Serializable{ | |||||
| /** | |||||
| * | |||||
| */ | |||||
| private static final long serialVersionUID = -1116465873573690766L; | |||||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="startTime") | |||||
| private Date startTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime") | |||||
| private Date endTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="手机号",name="phone") | |||||
| private String phone; | |||||
| @io.swagger.annotations.ApiModelProperty(value="姓名",name="name") | |||||
| private String name; | |||||
| /*租户id**/ | |||||
| // @io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId") | |||||
| @Transient | |||||
| private String tenantId; | |||||
| public String getName() { | |||||
| return name; | |||||
| } | |||||
| public void setName(String name) { | |||||
| this.name = name; | |||||
| } | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String tenantId) { | |||||
| this.tenantId = tenantId; | |||||
| } | |||||
| public Date getStartTime() { | |||||
| return startTime; | |||||
| } | |||||
| public void setStartTime(Date startTime) { | |||||
| this.startTime = startTime; | |||||
| } | |||||
| public Date getEndTime() { | |||||
| return endTime; | |||||
| } | |||||
| public void setEndTime(Date endTime) { | |||||
| this.endTime = endTime; | |||||
| } | |||||
| public String getPhone() { | |||||
| return phone; | |||||
| } | |||||
| public void setPhone(String phone) { | |||||
| this.phone = phone; | |||||
| } | |||||
| } | |||||
| @@ -78,17 +78,16 @@ public class WxCUserBasicInfo implements Serializable { | |||||
| /*租户id**/ | /*租户id**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| /*商户id**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") | |||||
| private Long merchantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="标签-传json",name="tags") | |||||
| /*用户姓名**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="用户姓名",name="name") | |||||
| private String name; | |||||
| @Transient | @Transient | ||||
| private String tags ; | |||||
| private String tags; | |||||
| @Transient | @Transient | ||||
| private List<WxTags> tagList; | private List<WxTags> tagList; | ||||
| public List<WxTags> getTagList() { | public List<WxTags> getTagList() { | ||||
| return tagList; | return tagList; | ||||
| } | } | ||||
| @@ -97,14 +96,6 @@ public class WxCUserBasicInfo implements Serializable { | |||||
| this.tagList = tagList; | this.tagList = tagList; | ||||
| } | } | ||||
| public Long getcUserId() { | |||||
| return cUserId; | |||||
| } | |||||
| public void setcUserId(Long cUserId) { | |||||
| this.cUserId = cUserId; | |||||
| } | |||||
| public String getTags() { | public String getTags() { | ||||
| return tags; | return tags; | ||||
| } | } | ||||
| @@ -185,11 +176,12 @@ public class WxCUserBasicInfo implements Serializable { | |||||
| public void setTenantId(String _tenantId) { | public void setTenantId(String _tenantId) { | ||||
| tenantId = _tenantId; | tenantId = _tenantId; | ||||
| } | } | ||||
| public Long getMerchantId() { | |||||
| return merchantId; | |||||
| public String getName() { | |||||
| return name; | |||||
| } | } | ||||
| public void setMerchantId(Long _merchantId) { | |||||
| merchantId = _merchantId; | |||||
| public void setName(String _name) { | |||||
| name = _name; | |||||
| } | } | ||||
| @@ -209,7 +201,7 @@ public class WxCUserBasicInfo implements Serializable { | |||||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | ||||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | ||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | ||||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||||
| ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") | |||||
| ; | ; | ||||
| private String value; | private String value; | ||||
| Field(String value){ | Field(String value){ | ||||
| @@ -1,161 +1,161 @@ | |||||
| 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_tags") | |||||
| public class WxTags implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @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; | |||||
| } | |||||
| /*租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||||
| private String tenantId; | |||||
| /*名称**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="名称",name="name") | |||||
| private String name; | |||||
| /*1基础2生活属性3消费偏好4行为偏好**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="1基础2生活属性3消费偏好4行为偏好",name="type1") | |||||
| private String type1; | |||||
| /*二级属性 性别等**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="二级属性 性别等",name="type2") | |||||
| private String type2; | |||||
| /*创建时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| /*更新时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String _tenantId) { | |||||
| tenantId = _tenantId; | |||||
| } | |||||
| public String getName() { | |||||
| return name; | |||||
| } | |||||
| public void setName(String _name) { | |||||
| name = _name; | |||||
| } | |||||
| public String getType1() { | |||||
| return type1; | |||||
| } | |||||
| public void setType1(String _type1) { | |||||
| type1 = _type1; | |||||
| } | |||||
| public String getType2() { | |||||
| return type2; | |||||
| } | |||||
| public void setType2(String _type2) { | |||||
| type2 = _type2; | |||||
| } | |||||
| 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 static enum Field | |||||
| { | |||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||||
| ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") | |||||
| ,Type1_ASC("`type1` ASC"),Type1_DESC("`type1` DESC") | |||||
| ,Type2_ASC("`type2` ASC"),Type2_DESC("`type2` DESC") | |||||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` 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(WxTags.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)); | |||||
| } | |||||
| } | |||||
| } | |||||
| 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_tags") | |||||
| public class WxTags implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| @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; | |||||
| } | |||||
| /*租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||||
| private String tenantId; | |||||
| /*名称**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="名称",name="name") | |||||
| private String name; | |||||
| /*1基础2生活属性3消费偏好4行为偏好**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="1基础2生活属性3消费偏好4行为偏好",name="type1") | |||||
| private String type1; | |||||
| /*二级属性 性别等**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="二级属性 性别等",name="type2") | |||||
| private String type2; | |||||
| /*创建时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| /*更新时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String _tenantId) { | |||||
| tenantId = _tenantId; | |||||
| } | |||||
| public String getName() { | |||||
| return name; | |||||
| } | |||||
| public void setName(String _name) { | |||||
| name = _name; | |||||
| } | |||||
| public String getType1() { | |||||
| return type1; | |||||
| } | |||||
| public void setType1(String _type1) { | |||||
| type1 = _type1; | |||||
| } | |||||
| public String getType2() { | |||||
| return type2; | |||||
| } | |||||
| public void setType2(String _type2) { | |||||
| type2 = _type2; | |||||
| } | |||||
| 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 static enum Field | |||||
| { | |||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||||
| ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") | |||||
| ,Type1_ASC("`type1` ASC"),Type1_DESC("`type1` DESC") | |||||
| ,Type2_ASC("`type2` ASC"),Type2_DESC("`type2` DESC") | |||||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` 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(WxTags.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)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -3,6 +3,8 @@ package com.simple.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.simple.common.CommonMapper; | import com.simple.common.CommonMapper; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| import com.simple.domain.dto.WxCuerBasicInfoDto; | |||||
| import com.simple.domain.po.WxCUserBasicInfo; | import com.simple.domain.po.WxCUserBasicInfo; | ||||
| public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, String> { | public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, String> { | ||||
| @@ -11,7 +13,7 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||||
| List<WxCUserBasicInfo> list(WxCuerBasicInfoDto record); | |||||
| } | } | ||||
| @@ -1,7 +1,7 @@ | |||||
| package com.simple.service; | package com.simple.service; | ||||
| import java.util.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.domain.dto.WxCuerBasicInfoDto; | |||||
| import com.simple.domain.po.WxCUserBasicInfo; | import com.simple.domain.po.WxCUserBasicInfo; | ||||
| public interface WxCUserBasicInfoService { | public interface WxCUserBasicInfoService { | ||||
| @@ -40,7 +40,7 @@ public interface WxCUserBasicInfoService { | |||||
| PageInfo<WxCUserBasicInfo> list(WxCuerBasicInfoDto record, Integer pageIndex, Integer pageSize); | |||||
| @@ -3,6 +3,7 @@ package com.simple.service.impl; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.domain.dto.WxCuerBasicInfoDto; | |||||
| import com.simple.domain.po.WxCUserBasicInfo; | import com.simple.domain.po.WxCUserBasicInfo; | ||||
| import com.simple.mapper.WxCUserBasicInfoMapper; | import com.simple.mapper.WxCUserBasicInfoMapper; | ||||
| import com.simple.service.WxCUserBasicInfoService; | import com.simple.service.WxCUserBasicInfoService; | ||||
| @@ -21,8 +22,17 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| public PageInfo<WxCUserBasicInfo> listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxCUserBasicInfo> listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize) { | ||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.findList(record)); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public PageInfo<WxCUserBasicInfo> list(WxCuerBasicInfoDto record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.list(record)); | |||||
| } | |||||
| @Override | |||||
| public WxCUserBasicInfo getById(Long id) { | public WxCUserBasicInfo getById(Long id) { | ||||
| return wxCUserBasicInfoMapper.selectByPrimaryKey(id); | return wxCUserBasicInfoMapper.selectByPrimaryKey(id); | ||||
| } | } | ||||
| @@ -15,11 +15,11 @@ | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | ||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | ||||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||||
| <result column="name" jdbcType="VARCHAR" property="name" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,`c_user_id`,`create_date`,`update_date`,`tenant_id`,`merchant_id` | |||||
| `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,`c_user_id`,`create_date`,`update_date`,`tenant_id`,`name` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -90,8 +90,9 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != merchantId "> | |||||
| and `merchant_id` = #{merchantId} | |||||
| <if test=" null != name "> | |||||
| and `name` like concat('%', #{name},'%') | |||||
| </if> | </if> | ||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| @@ -109,7 +110,28 @@ | |||||
| </select> | </select> | ||||
| <select id="list" parameterType="com.simple.domain.po.WxCUserBasicInfo" resultMap="BaseResultMap"> | |||||
| select <include refid="allColumns" /> from wx_c_user_basic_info where 1=1 | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != phone "> | |||||
| and `phone` = #{phone} | |||||
| </if> | |||||
| <if test=" null != startTime"> | |||||
| and create_date >= #{startTime} | |||||
| </if> | |||||
| <if test=" null != endTime"> | |||||
| and create_date <= #{endTime} | |||||
| </if> | |||||
| <if test=" null != name "> | |||||
| and `name` like concat('%', #{name},'%') | |||||
| </if> | |||||
| </select> | |||||