受访者下拉框后端接口修改
This commit is contained in:
@@ -121,11 +121,11 @@ public class AppointmentController {
|
|||||||
/**
|
/**
|
||||||
* 受访人下拉框值
|
* 受访人下拉框值
|
||||||
*/
|
*/
|
||||||
@PostMapping("/person/selector")
|
@GetMapping("/person/selector")
|
||||||
public Result<List<ReceptionPersonVo>> personSelector() {
|
public Result<List<ReceptionPersonVo>> personSelector(@RequestParam String department) {
|
||||||
System.out.println("----------------------------------");
|
System.out.println("----------------------------------");
|
||||||
// 异步处理,立即返回
|
// 异步处理,立即返回
|
||||||
List<ReceptionPersonVo> list = appointmentService.personSelector();
|
List<ReceptionPersonVo> list = appointmentService.personSelector(department);
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,4 +8,5 @@ public class ReceptionPersonPO {
|
|||||||
private Long id;
|
private Long id;
|
||||||
private String personId;
|
private String personId;
|
||||||
private String personName;
|
private String personName;
|
||||||
|
private String department;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ package com.example.mini_program.mapper;
|
|||||||
|
|
||||||
import com.example.mini_program.entity.ReceptionPersonPO;
|
import com.example.mini_program.entity.ReceptionPersonPO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ReceptionPersonMapper {
|
public interface ReceptionPersonMapper {
|
||||||
List<ReceptionPersonPO> selectReceptionPerson();
|
List<ReceptionPersonPO> selectReceptionPerson(@Param("department") String department);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,12 +170,12 @@ public class AppointmentService {
|
|||||||
/**
|
/**
|
||||||
* 获取受访者下拉框的值
|
* 获取受访者下拉框的值
|
||||||
*/
|
*/
|
||||||
public List<ReceptionPersonVo> personSelector() {
|
public List<ReceptionPersonVo> personSelector(String department) {
|
||||||
List<ReceptionPersonPO> receiptPersonList = receptionPersonMapper.selectReceptionPerson();
|
List<ReceptionPersonPO> receiptPersonList = receptionPersonMapper.selectReceptionPerson(department);
|
||||||
List<ReceptionPersonVo> voList = new ArrayList<>();
|
List<ReceptionPersonVo> voList = new ArrayList<>();
|
||||||
for(ReceptionPersonPO po : receiptPersonList){
|
for(ReceptionPersonPO po : receiptPersonList){
|
||||||
ReceptionPersonVo vo = new ReceptionPersonVo();
|
ReceptionPersonVo vo = new ReceptionPersonVo();
|
||||||
BeanUtils.copyProperties(vo, po);
|
BeanUtils.copyProperties(po, vo);
|
||||||
voList.add(vo);
|
voList.add(vo);
|
||||||
}
|
}
|
||||||
return voList;
|
return voList;
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ public class ReceptionPersonVo {
|
|||||||
|
|
||||||
private String personId;
|
private String personId;
|
||||||
private String personName;
|
private String personName;
|
||||||
|
private String department;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,13 @@
|
|||||||
<id column="id" property="id"/>
|
<id column="id" property="id"/>
|
||||||
<result column="person_name" property="personName"/>
|
<result column="person_name" property="personName"/>
|
||||||
<result column="person_id" property="personId"/>
|
<result column="person_id" property="personId"/>
|
||||||
|
<result column="department" property="department"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectReceptionPerson" resultMap="BaseResultMap">
|
<select id="selectReceptionPerson" resultMap="BaseResultMap">
|
||||||
SELECT id,person_id,person_name
|
SELECT id,person_id,person_name,department
|
||||||
FROM reception_person
|
FROM reception_person
|
||||||
|
where department = #{department}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user