Commit 9571e0db authored by unset's avatar unset

修改车辆节假日价格信息

parent ad3606ab
package com.xxfc.platform.vehicle.pojo.vo;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class VehicleHolidayPriceInfoVo {
private Integer festivalId;
private String festivalDay;
private String startTime;
private String endTime;
private BigDecimal rentPrice;
private Integer rentFreeDay;
}
......@@ -228,6 +228,10 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
}
public ObjectRestResponse getAll(Integer festivalId) {
return ObjectRestResponse.succ(mapper.getAll(festivalId));
}
public static Set<String> getAllDate(String startDate, String endDate) {
......
package com.xxfc.platform.vehicle.mapper;
import com.xxfc.platform.vehicle.entity.VehicleHolidayPriceInfo;
import com.xxfc.platform.vehicle.pojo.vo.VehicleHolidayPriceInfoVo;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 车辆节假日价格信息表
*
......@@ -11,5 +14,5 @@ import tk.mybatis.mapper.common.Mapper;
* @date 2020-05-11 09:16:23
*/
public interface VehicleHolidayPriceInfoMapper extends Mapper<VehicleHolidayPriceInfo> {
List<VehicleHolidayPriceInfoVo> getAll(Integer festivalId);
}
......@@ -16,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("vehicleHolidayPriceInfo")
......@@ -78,4 +77,10 @@ public class VehicleHolidayPriceInfoController extends BaseController<VehicleHol
public ObjectRestResponse getOne(Integer id) {
return ObjectRestResponse.succ(baseBiz.selectById(id));
}
@GetMapping(value = "getAll")
public ObjectRestResponse getAll(Integer festivalId) {
return baseBiz.getAll(festivalId);
}
}
\ No newline at end of file
......@@ -3,5 +3,10 @@
<mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleHolidayPriceInfoMapper">
<select id="getAll" resultType=" com.xxfc.platform.vehicle.pojo.vo.VehicleHolidayPriceInfoVo">
select festival_id, festival_day, MIN(festival_date) as startTime, MAX(festival_date) as endTime, rent_price, rent_free_day from vehicle_holiday_price_info
GROUP BY festival_id,festival_day,rent_price, rent_free_day
HAVING festival_id = #{festivalId}
</select>
</mapper>
\ No newline at end of file
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