Commit 91b013da authored by mlchun's avatar mlchun

社工查询

parent 746eb729
...@@ -119,6 +119,37 @@ public class PensionOrderController { ...@@ -119,6 +119,37 @@ public class PensionOrderController {
return new Result<PageData<PensionOrderDTO>>().ok(page); return new Result<PageData<PensionOrderDTO>>().ok(page);
} }
@Login
@GetMapping("getAllOrderByCommunityUserIdPage")
@ApiOperation("本社区全部订单(社工)")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
public Result<PageData<PensionOrderDTO>> getAllOrderByCommunityUserIdPage(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getAllOrderByCommunityUserIdPage(params, user.getId());
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("getElderAllOrderByCommunityUserIdPage")
@ApiOperation("查询本社区某老人全部订单(社工)")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = "name", value = "需要查询老人的名字", paramType = "query",required = true, dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
public Result<PageData<PensionOrderDTO>> getElderAllOrderByCommunityUserIdPage(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getElderAllOrderByCommunityUserIdPage(params, user.getId(), params.get("name").toString());
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login @Login
@GetMapping("orderInfo/{id}") @GetMapping("orderInfo/{id}")
@ApiOperation("预约订单详情(志愿者)") @ApiOperation("预约订单详情(志愿者)")
......
...@@ -48,5 +48,20 @@ public interface PensionOrderDao extends BaseDao<PensionOrderEntity> { ...@@ -48,5 +48,20 @@ public interface PensionOrderDao extends BaseDao<PensionOrderEntity> {
*/ */
List<PensionOrderDTO> getElderAllOrderOrByStatusList(Map<String, Object> params, Long creator, Integer status); List<PensionOrderDTO> getElderAllOrderOrByStatusList(Map<String, Object> params, Long creator, Integer status);
/**
* 社工:查询本社区全部订单(根据社区人员id查询所属社区内全部订单)
* @param page
* @param userId
* @return
*/
IPage<PensionOrderDTO> getAllOrderByCommunityUserIdPage(IPage<PensionOrderEntity> page, Long userId);
/**
* 社工:查询本社区某老人全部订单
* @param page
* @param userId
* @return
*/
IPage<PensionOrderDTO> getElderAllOrderByCommunityUserIdPage(IPage<PensionOrderEntity> page, Long userId, String appointmentPerson);
} }
...@@ -39,4 +39,9 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen ...@@ -39,4 +39,9 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
//老人全部订单或根据订单状态查询 //老人全部订单或根据订单状态查询
PageData<PensionOrderDTO> getElderAllOrderOrByStatusPage(Map<String, Object> params, Long creator, Integer status); PageData<PensionOrderDTO> getElderAllOrderOrByStatusPage(Map<String, Object> params, Long creator, Integer status);
//社工:查询本社区全部订单(根据社区人员id查询所属社区内全部订单)
PageData<PensionOrderDTO> getAllOrderByCommunityUserIdPage(Map<String, Object> params, Long userId);
//社工:查询本社区某老人全部订单(模糊查询)
PageData<PensionOrderDTO> getElderAllOrderByCommunityUserIdPage(Map<String, Object> params, Long userId, String appointmentPerson);
} }
...@@ -107,4 +107,18 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -107,4 +107,18 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return getPageData(list, page.getTotal(), PensionOrderDTO.class); return getPageData(list, page.getTotal(), PensionOrderDTO.class);
} }
@Override
public PageData<PensionOrderDTO> getAllOrderByCommunityUserIdPage(Map<String, Object> params, Long userId) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderDTO> pensionOrderDTOIPage = pensionOrderDao.getAllOrderByCommunityUserIdPage(page, userId);
return getPageData(pensionOrderDTOIPage, PensionOrderDTO.class);
}
@Override
public PageData<PensionOrderDTO> getElderAllOrderByCommunityUserIdPage(Map<String, Object> params, Long userId, String appointmentPerson) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderDTO> pensionOrderDTOIPage = pensionOrderDao.getElderAllOrderByCommunityUserIdPage(page, userId, appointmentPerson);
return getPageData(pensionOrderDTOIPage, PensionOrderDTO.class);
}
} }
...@@ -120,4 +120,27 @@ ...@@ -120,4 +120,27 @@
</if> </if>
</select> </select>
<select id="getAllOrderByCommunityUserIdPage" resultType="io.hmit.modules.serviceOrder.dto.PensionOrderDTO">
SELECT po.id, po.order_num, po.status, po.status_name, po.address, po.service_id, po.service_name,
po.appointment_person, po.appointment_phone, po.appointment_time, po.remark,
po.order_recipient_id, po.order_recipient_name, po.order_recipient_time, po.order_recipient_phone,
po.act_price, po.community_name, po.community_id, po.dept_id,
po.creator, po.creator_name, po.creator_tel, po.create_date,
ps.icon
FROM pension_order po, pension_service ps, tb_user tu
WHERE po.service_id = ps.id AND po.community_id = tu.community_id AND tu.id = #{userId}
</select>
<select id="getElderAllOrderByCommunityUserIdPage" resultType="io.hmit.modules.serviceOrder.dto.PensionOrderDTO">
SELECT po.id, po.order_num, po.status, po.status_name, po.address, po.service_id, po.service_name,
po.appointment_person, po.appointment_phone, po.appointment_time, po.remark,
po.order_recipient_id, po.order_recipient_name, po.order_recipient_time, po.order_recipient_phone,
po.act_price, po.community_name, po.community_id, po.dept_id,
po.creator, po.creator_name, po.creator_tel, po.create_date,
ps.icon
FROM pension_order po, pension_service ps, tb_user tu
WHERE po.service_id = ps.id AND po.community_id = tu.community_id
AND tu.id = #{userId} AND po.appointment_person LIKE CONCAT('%', #{appointmentPerson}, '%')
</select>
</mapper> </mapper>
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