Commit b70595ff authored by unset's avatar unset

修改车辆节假日价格信息

parent a22768dc
......@@ -80,6 +80,7 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
VehicleHolidayPriceInfo oldValue = getByVehicleId(vehicleHolidayPriceInfo.getVehicleId(), date);
if (oldValue == null) {
vehicleHolidayPriceInfo.setId(null);
vehicleHolidayPriceInfo.setFestivalId(getMaxFestivalId() + 1);
insertSelectiveRe(vehicleHolidayPriceInfo);
} else {
BeanUtil.copyProperties(vehicleHolidayPriceInfo, oldValue, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
......@@ -99,6 +100,7 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
oldValue.setCompanyId(vehicleInfo.getSubordinateBranch());
oldValue.setModelId(vehicleInfo.getModelId());
oldValue.setId(null);
oldValue.setFestivalId(getMaxFestivalId() + 1);
insertSelectiveRe(vehicleHolidayPriceInfo);
} else {
BeanUtil.copyProperties(vehicleHolidayPriceInfo, oldValue, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
......@@ -116,6 +118,10 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
return ObjectRestResponse.succ();
}
public Integer getMaxFestivalId() {
return mapper.selectMaxFestivalId();
}
public VehicleHolidayPriceInfo getByVehicleId(String vehicleId, String date) {
Example example = new Example(VehicleHolidayPriceInfo.class);
example.createCriteria().andEqualTo("vehicleId", vehicleId).andEqualTo("festivalDate", date).andEqualTo("isDel", 0);
......
......@@ -15,4 +15,6 @@ import java.util.List;
*/
public interface VehicleHolidayPriceInfoMapper extends Mapper<VehicleHolidayPriceInfo> {
List<VehicleHolidayPriceInfoVo> getAll(String vehicleId, Integer festivalId);
Integer selectMaxFestivalId();
}
......@@ -13,4 +13,7 @@
</if>
</select>
<select id="selectMaxFestivalId" resultType="java.lang.Integer">
select max(festival_id) from vehicle_holiday_price_info
</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