Commit 1eab6097 authored by cq990612's avatar cq990612

增加实体类,mapper,mapper.xml

parent d8d28246
......@@ -2,10 +2,13 @@ package cn.wisenergy.mapper;
import cn.wisenergy.model.app.Users;
import cn.wisenergy.model.app.dto.UsersInfoDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author 86187
......@@ -39,4 +42,9 @@ public interface UsersMapper extends BaseMapper<Users> {
*/
int delById(@Param("id") Integer id);
/*************** chenqi****************/
List<UsersInfoDto> getUsersById(Long userId);
}
......@@ -153,4 +153,23 @@
where id = #{id}
</delete>
<!--*****************************************chenqi***************************************-->
<select id="getUsersById" resultType="cn.wisenergy.model.app.dto.UsersInfoDto">
SELECT u.id,a.real_name,a.id_number,u.phone,u.rank
FROM users u LEFT actives a ON u.id = a.user_id
LEFT user_recharge ur ON u.id = ur.user_id
LEFT user_withdraws uw ON u.id = uw.user_id
<where>
</where>
</select>
</mapper>
package cn.wisenergy.model.app.dto;
import io.swagger.annotations.ApiModelProperty;
/**
* @Authotr:陈奇
* @QQ1799796883
*/
public class UsersInfoDto {
@ApiModelProperty(name = "id", value = "会员ID")
private Long id;
@ApiModelProperty(name = "realName",value = "姓名")
private String realName;
@ApiModelProperty(name = "idNumber",value = "身份证号")
private String idNumber;
@ApiModelProperty(name = "phone", value = "用户手机号")
private String phone;
@ApiModelProperty(name = "totalRecharge", value = "充值总额")
private String totalRecharge;
@ApiModelProperty(name = "totalWithdrawal", value = "提现总额")
private String totalWithdrawal;
@ApiModelProperty(name = "rank", value = "层级")
private Integer rank;
@ApiModelProperty(name = "bottom", value = "向下最深层级层级数")
private Integer bottom;
@ApiModelProperty(name = "totalPeople", value = "伞下人员总和")
private Integer totalPeople;
}
......@@ -82,7 +82,6 @@
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.4.3" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.2.5" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.5" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.4.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.4.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.4.5" level="project" />
......@@ -190,5 +189,8 @@
<orderEntry type="library" name="Maven: org.glassfish.jaxb:txw2:2.3.3" level="project" />
<orderEntry type="library" name="Maven: com.sun.istack:istack-commons-runtime:3.0.11" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.activation:jakarta.activation:1.2.2" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.13.2" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:2.2" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
</component>
</module>
\ No newline at end of file
package cn.wisenergy.service.app;
import cn.wisenergy.model.app.Users;
import cn.wisenergy.model.app.dto.UsersInfoDto;
import java.util.List;
/**
* @Authotr:陈奇
......@@ -8,5 +10,5 @@ import cn.wisenergy.model.app.Users;
*/
public interface TestUserService {
Users getByUserInfoById(Long userId);
List<UsersInfoDto> getByUserInfoById(Long userId);
}
......@@ -4,11 +4,14 @@ import cn.wisenergy.common.enums.RespCodeEnum;
import cn.wisenergy.common.utils.exception.BaseCustomException;
import cn.wisenergy.mapper.UsersMapper;
import cn.wisenergy.model.app.Users;
import cn.wisenergy.model.app.dto.UsersInfoDto;
import cn.wisenergy.service.app.TestUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Authotr:陈奇
* @QQ1799796883
......@@ -21,7 +24,7 @@ public class TestUserServiceImpl implements TestUserService {
private UsersMapper usersMapper;
@Override
public Users getByUserInfoById(Long userId) {
public List<UsersInfoDto> getByUserInfoById(Long userId) {
log.info("TestUserServiceImpl[]getByUserInfoById[]input.param.userId:" + userId);
if (null == userId) {
throw new BaseCustomException(RespCodeEnum.INPUT_PARAMETER_ISEMPTY);
......
package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.model.app.Users;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.Users;
import cn.wisenergy.model.app.dto.UsersInfoDto;
import cn.wisenergy.service.app.TestUserService;
import cn.wisenergy.web.common.BaseController;
import io.swagger.annotations.Api;
......@@ -12,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author ASUS
*/
......@@ -26,10 +29,10 @@ public class TestUserController2 extends BaseController {
@ApiOperation(value = "获取用户信息", notes = "获取用户信息", httpMethod = "GET")
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "int")
@GetMapping("/getByUserId")
public R<Users> getUserInfoById(Long userId) {
public R<List<UsersInfoDto>> getUserInfoById(Long userId) {
log.info("TestUserController2[]getUserInfoById[]input.param.userId:" + userId);
Users user = testUserService.getByUserInfoById(userId);
return R.ok(user);
List<UsersInfoDto> users = testUserService.getByUserInfoById(userId);
return R.ok(users);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment