提交 d730c2b9 作者: zhenjie

用户查询

上级 fc56802f
......@@ -16,6 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author: zj
* @Date: 2023/5/15 15:32
......@@ -49,4 +51,12 @@ public class UserAccountController {
return userAccountService.getUserSimpleInfo(userAccountId);
}
@ApiOperation(value = "根据用户地区查询后台用户id")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountSimpleDTO.class) })
@GetMapping("feignListUserAccountIds")
public List<Integer>feignListUserAccountIds(@RequestParam Integer provinceCode, @RequestParam(required = false) Integer cityCode, @RequestParam(required = false) Integer districtCode){
return userAccountService.feignListUserAccountIds(provinceCode, cityCode, districtCode);
}
}
......@@ -3,6 +3,8 @@ package com.mmc.iuav.user.dao;
import com.mmc.iuav.user.entity.UserAccountDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author: zj
* @Date: 2023/5/16 19:26
......@@ -34,4 +36,13 @@ public interface UserServiceDao {
* @param userAccountDO
*/
void update(UserAccountDO userAccountDO);
/**
* 根据用户地区查询后台用户id
* @param provinceCode
* @param cityCode
* @param districtCode
* @return
*/
List<Integer> listUserAccountIdsByDistrictCode(Integer provinceCode, Integer cityCode, Integer districtCode);
}
......@@ -5,6 +5,8 @@ import com.mmc.iuav.user.entity.UserAccountDO;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.vo.UserAccountVO;
import java.util.List;
/**
* @author: zj
* @Date: 2023/5/16 13:48
......@@ -43,4 +45,13 @@ public interface UserAccountService {
* @return
*/
UserAccountSimpleDTO getUserSimpleInfo(Integer userAccountId);
/**
* 根据用户地区查询后台用户id
* @param provinceCode
* @param cityCode
* @param districtCode
* @return
*/
List<Integer> feignListUserAccountIds(Integer provinceCode, Integer cityCode, Integer districtCode);
}
......@@ -11,6 +11,8 @@ import com.mmc.iuav.user.service.UserAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author: zj
* @Date: 2023/5/16 13:48
......@@ -64,4 +66,10 @@ public class UserAccountServiceImpl implements UserAccountService {
}
return userAccountSimpleDTO;
}
@Override
public List<Integer> feignListUserAccountIds(Integer provinceCode, Integer cityCode, Integer districtCode) {
List<Integer> ids = userServiceDao.listUserAccountIdsByDistrictCode(provinceCode, cityCode, districtCode);
return ids;
}
}
......@@ -42,6 +42,8 @@ spring:
enabled: true
login-username: druid
login-password: druid
jackson:
date-format: yyyy-MM-dd HH:mm:ss
#mybatis
mybatis:
......
......@@ -81,4 +81,18 @@
from user_account
where id = #{id}
</select>
<select id="listUserAccountIdsByDistrictCode" resultType="java.lang.Integer">
select id from user_account
where is_deleted = 0 and port_type = 0
<if test="provinceCode != null">
and province_code = #{provinceCode}
</if>
<if test="cityCode != null">
and city_code = #{cityCode}
</if>
<if test="districtCode != null">
and district_code = #{districtCode}
</if>
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论