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