@@ -16,6 +16,8 @@ public interface StaffRepository extends AbstractRepository<Staff, Long> { | |||||
List<StaffSearchInfo> findAllStaffSearchInfoByIdIn(List<Long> ids); | List<StaffSearchInfo> findAllStaffSearchInfoByIdIn(List<Long> ids); | ||||
Optional<Staff> findByStaffId(@Param("staffId") String staffId); | Optional<Staff> findByStaffId(@Param("staffId") String staffId); | ||||
Optional<StaffSearchInfo> findStaffSearchInfoById(@Param("id") Long id); | |||||
Optional<Staff> findByUserId(@Param("userId") Long userId); | Optional<Staff> findByUserId(@Param("userId") Long userId); | ||||
Optional<List<Staff>> findAllByTeamIdAndDeletedFalse(Long id); | Optional<List<Staff>> findAllByTeamIdAndDeletedFalse(Long id); | ||||
} | } |
@@ -50,6 +50,9 @@ open class SkillService( | |||||
+ " from skill s " | + " from skill s " | ||||
+ " where s.deleted = false " | + " where s.deleted = false " | ||||
) | ) | ||||
if (args.containsKey("id")) { | |||||
sql.append("and s.id = :id") | |||||
} | |||||
return jdbcDao.queryForList(sql.toString(), args) | return jdbcDao.queryForList(sql.toString(), args) | ||||
} | } | ||||
open fun combo(args: Map<String, Any>): List<Map<String, Any>> { | open fun combo(args: Map<String, Any>): List<Map<String, Any>> { | ||||
@@ -19,6 +19,13 @@ class SkillController(private val skillService: SkillService) { | |||||
fun saveSkill(@Valid @RequestBody newSkill: NewSkillRequest): Skill { | fun saveSkill(@Valid @RequestBody newSkill: NewSkillRequest): Skill { | ||||
return skillService.saveOrUpdate(newSkill) | return skillService.saveOrUpdate(newSkill) | ||||
} | } | ||||
@GetMapping("/{id}") | |||||
fun list(@Valid @PathVariable id: Long): List<Map<String, Any>> { | |||||
val args: MutableMap<String, Any> = HashMap() | |||||
args["id"] = id | |||||
return skillService.list(args); | |||||
} | |||||
@GetMapping | @GetMapping | ||||
fun list(): List<Map<String, Any>> { | fun list(): List<Map<String, Any>> { | ||||
val args: MutableMap<String, Any> = HashMap() | val args: MutableMap<String, Any> = HashMap() | ||||
@@ -50,13 +50,11 @@ class StaffsController(private val staffsService: StaffsService) { | |||||
@GetMapping("/combo") | @GetMapping("/combo") | ||||
@Throws(ServletRequestBindingException::class) | @Throws(ServletRequestBindingException::class) | ||||
fun combo(request: HttpServletRequest?): RecordsRes<Map<String, Any>> { | |||||
fun combo(request: HttpServletRequest?): List<Map<String, Any>> { | |||||
println(request) | println(request) | ||||
return RecordsRes<Map<String, Any>>( | |||||
staffsService.combo( | |||||
CriteriaArgsBuilder.withRequest(request) | |||||
.build() | |||||
) | |||||
return staffsService.combo( | |||||
CriteriaArgsBuilder.withRequest(request) | |||||
.build() | |||||
) | ) | ||||
} | } | ||||
@PostMapping("/save") | @PostMapping("/save") | ||||