Commit a9d02fa6 authored by mlchun's avatar mlchun

Dao层优化,删除无用内容

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