Commit a9d02fa6 authored by mlchun's avatar mlchun

Dao层优化,删除无用内容

parent bb9eb9b5
...@@ -27,7 +27,7 @@ public class SwaggerConfig { ...@@ -27,7 +27,7 @@ public class SwaggerConfig {
@Bean @Bean
public Docket createRestApi() { public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
// .host("byyl.zjhmit.com") .host("byyl.zjhmit.com")
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
//加了ApiOperation注解的类,才生成接口文档 //加了ApiOperation注解的类,才生成接口文档
......
...@@ -17,10 +17,6 @@ public interface PensionOrderDao extends BaseDao<PensionOrderEntity> { ...@@ -17,10 +17,6 @@ public interface PensionOrderDao extends BaseDao<PensionOrderEntity> {
IPage<PensionOrderDTO> getTodayNoProceedOrderPage(IPage<PensionOrderEntity> page); IPage<PensionOrderDTO> getTodayNoProceedOrderPage(IPage<PensionOrderEntity> page);
IPage<PensionOrderEntity> getOrderPageByStatus(IPage<PensionOrderEntity> page, Long userId, Integer status);
PensionOrderEntity getOrderInfoByIdAndUserId(Long orderId, Long userId);
PensionOrderEntity getOrderInfoByIdAndStatus(Long orderId, Integer status); PensionOrderEntity getOrderInfoByIdAndStatus(Long orderId, Integer status);
IPage<PensionOrderDTO> getOrderPageByStatusOrUserId(IPage<PensionOrderEntity> page, Long userId, Integer status); IPage<PensionOrderDTO> getOrderPageByStatusOrUserId(IPage<PensionOrderEntity> page, Long userId, Integer status);
......
...@@ -21,9 +21,6 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen ...@@ -21,9 +21,6 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
//查询今日订单 //查询今日订单
PageData<PensionOrderDTO> getTodayOrderPage(Map<String, Object> params); PageData<PensionOrderDTO> getTodayOrderPage(Map<String, Object> params);
//查询预约订单详情
PensionOrderDTO getOrderInfoByIdAndUserId(Long id, Long userId);
//根据订单Id和订单状态查询 (接单时使用) //根据订单Id和订单状态查询 (接单时使用)
PensionOrderDTO getOrderInfoByIdAndStatus(Long orderId, Integer status); PensionOrderDTO getOrderInfoByIdAndStatus(Long orderId, Integer status);
......
...@@ -38,6 +38,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -38,6 +38,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
@Autowired @Autowired
private PensionOrderDao pensionOrderDao; private PensionOrderDao pensionOrderDao;
//查询全部订单
@Override @Override
public PageData<PensionOrderDTO> getAllOrderPage(Map<String, Object> params, Long userId) { public PageData<PensionOrderDTO> getAllOrderPage(Map<String, Object> params, Long userId) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false); IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
...@@ -45,6 +46,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -45,6 +46,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class); return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class);
} }
//查询今日订单
@Override @Override
public PageData<PensionOrderDTO> getTodayOrderPage(Map<String, Object> params) { public PageData<PensionOrderDTO> getTodayOrderPage(Map<String, Object> params) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false); IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
...@@ -53,24 +55,14 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -53,24 +55,14 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return getPageData(pensionOrderDTOIPage, PensionOrderDTO.class); return getPageData(pensionOrderDTOIPage, PensionOrderDTO.class);
} }
@Override //根据订单Id和订单状态查询 (接单时使用)
public PensionOrderDTO getOrderInfoByIdAndUserId(Long id, Long userId) {
PensionOrderEntity orderEntity = pensionOrderDao.getOrderInfoByIdAndUserId(id, userId);
orderEntity.setServiceId(null);
orderEntity.setOrderRecipientId(null);
orderEntity.setDeptId(null);
orderEntity.setCreator(null);
orderEntity.setUpdater(null);
orderEntity.setUpdateDate(null);
return ConvertUtils.sourceToTarget(orderEntity, PensionOrderDTO.class);
}
@Override @Override
public PensionOrderDTO getOrderInfoByIdAndStatus(Long id, Integer status) { public PensionOrderDTO getOrderInfoByIdAndStatus(Long id, Integer status) {
PensionOrderEntity orderEntity = pensionOrderDao.getOrderInfoByIdAndStatus(id, status); PensionOrderEntity orderEntity = pensionOrderDao.getOrderInfoByIdAndStatus(id, status);
return ConvertUtils.sourceToTarget(orderEntity, PensionOrderDTO.class); return ConvertUtils.sourceToTarget(orderEntity, PensionOrderDTO.class);
} }
//查询已完成订单
@Override @Override
public PageData<PensionOrderDTO> getOrderPageByStatus(Map<String, Object> params, Long userId, Integer status) { public PageData<PensionOrderDTO> getOrderPageByStatus(Map<String, Object> params, Long userId, Integer status) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false); IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
...@@ -78,6 +70,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -78,6 +70,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return getPageData(pensionOrderDTOIPage, PensionOrderDTO.class); return getPageData(pensionOrderDTOIPage, PensionOrderDTO.class);
} }
//根据用户ID或订单状态查询(带图)
@Override @Override
public PensionOrderDTO getOrderInfoByIdAndUserIdOrStatus(Long orderId, Long userId, Integer status) { public PensionOrderDTO getOrderInfoByIdAndUserIdOrStatus(Long orderId, Long userId, Integer status) {
PensionOrderDTO pensionOrderDTO = pensionOrderDao.getOrderInfoByIdAndUserIdOrStatus(orderId, userId, status); PensionOrderDTO pensionOrderDTO = pensionOrderDao.getOrderInfoByIdAndUserIdOrStatus(orderId, userId, status);
......
...@@ -28,14 +28,6 @@ ...@@ -28,14 +28,6 @@
<result property="updateDate" column="update_date"/> <result property="updateDate" column="update_date"/>
</resultMap> </resultMap>
<select id="getOrderPageByStatus" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity">
SELECT * FROM pension_order WHERE pension_order.status = #{status} and order_recipient_id = #{userId}
</select>
<select id="getOrderInfoByIdAndUserId" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity">
SELECT * FROM pension_order WHERE pension_order.id = #{orderId} and pension_order.order_recipient_id = #{userId}
</select>
<select id="getOrderInfoByIdAndStatus" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity"> <select id="getOrderInfoByIdAndStatus" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity">
SELECT * FROM pension_order WHERE pension_order.id = #{orderId} and pension_order.status = #{status} SELECT * FROM pension_order WHERE pension_order.id = #{orderId} and pension_order.status = #{status}
</select> </select>
......
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