Commit 3f095ebb by 弓厶

Merge remote-tracking branch 'origin/master'

parents 8d6b344f de1bb3bd
...@@ -5,10 +5,16 @@ import com.winsun.bean.School; ...@@ -5,10 +5,16 @@ import com.winsun.bean.School;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
@Mapper @Mapper
@Component @Component
public interface SchoolMapper extends BaseMapper<School> { public interface SchoolMapper extends BaseMapper<School> {
@Select(" select * from hhr_school where id in( select school_id from hhr_user_school where user_id= #{userId} )")
List<Map<String,Object>> getuserToSchool(@Param("userId")String userId);
} }
package com.winsun.controller;
import com.winsun.auth.core.common.model.ResponseData;
import com.winsun.mapper.SchoolMapper;
import com.winsun.mapper.SchoolPackageMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @Author xuede
* @Date 2020/3/10 10:16
* @Version 1.0
*/
@Slf4j
@RestController
public class StartSelectController {
@Autowired
private SchoolMapper schoolMapper;
@RequestMapping("/findStartData")
public ResponseData<Map<String, Object>> findStartData(@RequestParam("id") String id){
if (StringUtils.isEmpty(id)){
return ResponseData.error("请输入合伙人id");
}
List<Map<String, Object>> mapList = schoolMapper.getuserToSchool(id);
if (CollectionUtils.isEmpty(mapList)){
return ResponseData.error("没有查询相关的合伙人id的信息");
}
Map<String, Object> map = mapList.get(0);
return ResponseData.success(map);
}
}
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