| @@ -50,15 +50,15 @@ public class WxBillRentController extends BaseController | |||||
| } | } | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) | |||||
| public ResultData delete(String id) { | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxBillRentService.deleteById(id); | wxBillRentService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) | |||||
| public ResultData findById(String id) { | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData findById(Long id) { | |||||
| return new ResultData(Result.SUCCESS,"查询成功",wxBillRentService.getById(id)); | return new ResultData(Result.SUCCESS,"查询成功",wxBillRentService.getById(id)); | ||||
| } | } | ||||
| @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCUserBasicInfo") | @RequestMapping("wxCUserBasicInfo") | ||||
| @@ -53,20 +54,21 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| if (null == wxCUserBasicInfo) wxCUserBasicInfo = new WxCUserBasicInfoDto(); | if (null == wxCUserBasicInfo) wxCUserBasicInfo = new WxCUserBasicInfoDto(); | ||||
| String tenantId = getTenantId(); | String tenantId = getTenantId(); | ||||
| wxCUserBasicInfo.setTenantId(tenantId); | 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); | |||||
| } | |||||
| } | |||||
| PageInfo<Map<String,Object>> page = wxCUserBasicInfoService.queryListMap(wxCUserBasicInfo, pageNum, pageSize); | |||||
| // 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); | ||||
| } | } | ||||
| @@ -17,7 +17,7 @@ public class WxBillRent implements Serializable { | |||||
| protected Long id; | protected Long id; | ||||
| @Transient | @Transient | ||||
| protected List<String> ids; | |||||
| protected List<Long> ids; | |||||
| @Transient | @Transient | ||||
| protected String sortColumns; | protected String sortColumns; | ||||
| @@ -31,10 +31,10 @@ public class WxBillRent implements Serializable { | |||||
| return sortColumns; | return sortColumns; | ||||
| } | } | ||||
| public List<String> getIds() { | |||||
| public List<Long> getIds() { | |||||
| return ids; | return ids; | ||||
| } | } | ||||
| public void setIds(List<String> ids) { | |||||
| public void setIds(List<Long> ids) { | |||||
| this.ids = ids; | this.ids = ids; | ||||
| } | } | ||||
| @@ -1,11 +1,11 @@ | |||||
| package com.simple.mapper; | package com.simple.mapper; | ||||
| import java.util.*; | |||||
| import com.simple.common.CommonMapper; | import com.simple.common.CommonMapper; | ||||
| import com.simple.domain.dto.WxCUserBasicInfoDto; | import com.simple.domain.dto.WxCUserBasicInfoDto; | ||||
| import com.simple.domain.po.WxCUserBasicInfo; | import com.simple.domain.po.WxCUserBasicInfo; | ||||
| import java.util.List; | |||||
| public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, String> { | public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, String> { | ||||
| List<WxCUserBasicInfo> findList(WxCUserBasicInfo wxCUserBasicInfo); | List<WxCUserBasicInfo> findList(WxCUserBasicInfo wxCUserBasicInfo); | ||||
| @@ -19,4 +19,7 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||||
| long findCountBySex(WxCUserBasicInfoDto dto); | long findCountBySex(WxCUserBasicInfoDto dto); | ||||
| long findCountByAge(WxCUserBasicInfoDto dto); | long findCountByAge(WxCUserBasicInfoDto dto); | ||||
| void findListMap(WxCUserBasicInfoDto record); | |||||
| } | } | ||||
| @@ -36,7 +36,7 @@ public interface WxBillRentService { | |||||
| * | * | ||||
| * @param id | * @param id | ||||
| */ | */ | ||||
| void deleteById(String id); | |||||
| void deleteById(Long id); | |||||
| @@ -4,6 +4,8 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.simple.domain.dto.WxCUserBasicInfoDto; | import com.simple.domain.dto.WxCUserBasicInfoDto; | ||||
| import com.simple.domain.po.WxCUserBasicInfo; | import com.simple.domain.po.WxCUserBasicInfo; | ||||
| import java.util.Map; | |||||
| public interface WxCUserBasicInfoService { | public interface WxCUserBasicInfoService { | ||||
| /** | /** | ||||
| @@ -61,7 +63,8 @@ public interface WxCUserBasicInfoService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| long findCountByAge(WxCUserBasicInfoDto dto); | long findCountByAge(WxCUserBasicInfoDto dto); | ||||
| PageInfo<Map<String, Object>> queryListMap(WxCUserBasicInfoDto wxCUserBasicInfo, Integer pageNum, Integer pageSize); | |||||
| } | } | ||||
| @@ -48,7 +48,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void deleteById(String id) { | |||||
| public void deleteById(Long id) { | |||||
| wxBillRentMapper.deleteByPrimaryKey(id); | wxBillRentMapper.deleteByPrimaryKey(id); | ||||
| } | } | ||||
| @@ -11,6 +11,8 @@ 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; | ||||
| import java.util.Map; | |||||
| @Service | @Service | ||||
| public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | ||||
| @@ -75,6 +77,11 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| return wxCUserBasicInfoMapper.findCountByAge(dto); | return wxCUserBasicInfoMapper.findCountByAge(dto); | ||||
| } | } | ||||
| @Override | |||||
| public PageInfo<Map<String, Object>> queryListMap(WxCUserBasicInfoDto record, Integer pageNum, Integer pageSize) { | |||||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.findListMap(record)); | |||||
| } | |||||
| } | } | ||||
| @@ -165,4 +165,18 @@ | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id="findListMap" parameterType="com.simple.domain.dto.WxCUserBasicInfoDto" resultType="hashmap"> | |||||
| select cu.id,cu.tenant_id tenantId,cu.open_id openId,cu.union_id unionId, | |||||
| cu.nick_name nickName,cu.gender,cu.avatar_url avatarUrl,cu.phone, | |||||
| cu.pure_phone purePhone,cu.city,cu.province,cu.`language`,cu.country_code countryCode, | |||||
| cu.register_ip registerIp,cu.verify_code_phone verifyCodePhone,cu.qrcode_source qrcodeSource, | |||||
| cu.scene,cu.scene_address sceneAddress,cu.score,cu.update_date updateDate, | |||||
| cu.create_date createDate,cu.app_id appId,cu.session_key sessionKey,cu.token, | |||||
| cu.expire_time expireTime,cu.latitude,cu.longitude,cubi.birthdate,cubi.education, | |||||
| cubi.sex,cubi.email,cubi.address,cubi.poins,cubi.`name`,cubi.`level`,cubi.id cubiid | |||||
| from wx_c_user cu left join wx_c_user_basic_info cubi | |||||
| on cu.phone=cubi.phone and cu.tenant_id=cubi.tenant_id | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||