parent
44a8924439
commit
04a8004074
@ -0,0 +1,94 @@ |
||||
package com.cweb.controller; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.security.UserCenter; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.BsOrder; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.model.order.OrderModel; |
||||
import com.hfkj.service.gas.BsGasService; |
||||
import com.hfkj.service.order.BsOrderService; |
||||
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
|
||||
@Controller |
||||
@RequestMapping(value = "/order") |
||||
@Api(value = "订单业务") |
||||
public class BsOrderController { |
||||
private static Logger log = LoggerFactory.getLogger(BsOrderController.class); |
||||
@Resource |
||||
private UserCenter userCenter; |
||||
@Resource |
||||
private BsOrderService orderService; |
||||
|
||||
@RequestMapping(value="/create",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "创建订单") |
||||
public ResponseData create(@RequestBody OrderModel body) { |
||||
try { |
||||
/* // 用户session
|
||||
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); |
||||
if (userSession == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
||||
} |
||||
if (!userSession.getUser().getStatus().equals(UserStatusEnum.status1.getCode())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "该账户已被禁用,无法进行交易"); |
||||
}*/ |
||||
if (body == null || body.getOrderChildList().isEmpty()) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
// 子订单必填项校验
|
||||
for (OrderChildModel orderChild : body.getOrderChildList()) { |
||||
if (orderChild.getProductType() == null || orderChild.getProductId() == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { |
||||
if (orderChild.getProductPrice() == null |
||||
|| StringUtils.isBlank(orderChild.getGasOilNo()) |
||||
|| StringUtils.isBlank(orderChild.getGasGunNo()) |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return ResponseMsgUtil.success(orderService.create(body)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/cancel",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "取消订单") |
||||
public ResponseData cancel(@RequestBody JSONObject body) { |
||||
try { |
||||
if (body == null || StringUtils.isBlank(body.getString("orderNo"))) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单"); |
||||
} |
||||
return ResponseMsgUtil.success(orderService.cancel(body.getString("orderNo"))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
package com.hfkj.consumer; |
||||
|
||||
import com.hfkj.model.order.OrderModel; |
||||
import com.hfkj.service.order.BsOrderService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
||||
import org.apache.rocketmq.spring.core.RocketMQListener; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
@Component |
||||
@Slf4j |
||||
@RocketMQMessageListener(consumerGroup = "order-cancel-group", topic = "order-topic",selectorExpression = "cancel") |
||||
public class OrderCancelConsumer implements RocketMQListener<OrderModel> { |
||||
|
||||
@Resource |
||||
private BsOrderService orderService; |
||||
|
||||
@Override |
||||
public void onMessage(OrderModel order) { |
||||
// 取消订单
|
||||
orderService.cancel(order.getOrderNo()); |
||||
} |
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.hfkj.consumer; |
||||
|
||||
import com.hfkj.model.order.OrderModel; |
||||
import com.hfkj.service.order.BsOrderService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
||||
import org.apache.rocketmq.spring.core.RocketMQListener; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
@Component |
||||
@Slf4j |
||||
@RocketMQMessageListener(consumerGroup = "order-profit-sharing-group", topic = "order-topic",selectorExpression = "profit-sharing") |
||||
public class OrderProfitSharingConsumer implements RocketMQListener<OrderModel> { |
||||
|
||||
@Resource |
||||
private BsOrderService orderService; |
||||
|
||||
@Override |
||||
public void onMessage(OrderModel order) { |
||||
|
||||
} |
||||
} |
@ -0,0 +1,31 @@ |
||||
package com.hfkj.common.utils; |
||||
|
||||
import java.util.Random; |
||||
|
||||
/** |
||||
* |
||||
* @className: RandomUtils |
||||
* @author: HuRui |
||||
* @date: 2024/4/24 |
||||
**/ |
||||
public class RandomUtils { |
||||
|
||||
/** |
||||
* 生成随机数 |
||||
* @param length 长度 |
||||
* @param zero 是否包含零 |
||||
* @return |
||||
*/ |
||||
public static String number(int length, boolean zero) { |
||||
String sl = "123456789"; |
||||
if (zero) { |
||||
sl += "0"; |
||||
} |
||||
StringBuilder sb = new StringBuilder(); |
||||
for(int i = 0 ; i < length ; i ++){ |
||||
sb.append(sl.charAt(new Random().nextInt(sl.length()))); |
||||
} |
||||
return sb.toString(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,279 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsGasOrder; |
||||
import com.hfkj.entity.BsGasOrderExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsGasOrderMapper extends BsGasOrderMapperExt { |
||||
@SelectProvider(type=BsGasOrderSqlProvider.class, method="countByExample") |
||||
long countByExample(BsGasOrderExample example); |
||||
|
||||
@DeleteProvider(type=BsGasOrderSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsGasOrderExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_gas_order", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_gas_order (order_no, order_child_no, ", |
||||
"channel_type, channel_order_no, ", |
||||
"user_id, user_phone, ", |
||||
"agent_id, agent_name, ", |
||||
"mer_id, mer_name, mer_address, ", |
||||
"total_deduction_price, deduction_coupon_price, ", |
||||
"deduction_oil_price, pay_integral, ", |
||||
"payable_price, actual_pay_price, ", |
||||
"gas_refuel_price, gas_oil_no, ", |
||||
"gas_gun_no, gas_oil_type, ", |
||||
"gas_price_official, gas_price_gun, ", |
||||
"gas_price_vip, gas_price_platform, ", |
||||
"gas_oil_liters, gas_discount, ", |
||||
"gas_oil_subsidy, gas_liters_preferences, ", |
||||
"gas_price_preferences, gas_class_group_id, ", |
||||
"gas_class_group_name, gas_class_group_task_id, ", |
||||
"gas_staff_id, gas_staff_name, ", |
||||
"pay_type, `status`, ", |
||||
"create_time, cancel_time, ", |
||||
"pay_time, refund_time, ", |
||||
"refund_remarks, ext_1, ", |
||||
"ext_2, ext_3, ext_4, ", |
||||
"ext_5, ext_6)", |
||||
"values (#{orderNo,jdbcType=VARCHAR}, #{orderChildNo,jdbcType=VARCHAR}, ", |
||||
"#{channelType,jdbcType=INTEGER}, #{channelOrderNo,jdbcType=VARCHAR}, ", |
||||
"#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ", |
||||
"#{agentId,jdbcType=INTEGER}, #{agentName,jdbcType=VARCHAR}, ", |
||||
"#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{merAddress,jdbcType=VARCHAR}, ", |
||||
"#{totalDeductionPrice,jdbcType=DECIMAL}, #{deductionCouponPrice,jdbcType=DECIMAL}, ", |
||||
"#{deductionOilPrice,jdbcType=DECIMAL}, #{payIntegral,jdbcType=INTEGER}, ", |
||||
"#{payablePrice,jdbcType=DECIMAL}, #{actualPayPrice,jdbcType=DECIMAL}, ", |
||||
"#{gasRefuelPrice,jdbcType=DECIMAL}, #{gasOilNo,jdbcType=VARCHAR}, ", |
||||
"#{gasGunNo,jdbcType=VARCHAR}, #{gasOilType,jdbcType=INTEGER}, ", |
||||
"#{gasPriceOfficial,jdbcType=DECIMAL}, #{gasPriceGun,jdbcType=DECIMAL}, ", |
||||
"#{gasPriceVip,jdbcType=DECIMAL}, #{gasPricePlatform,jdbcType=DECIMAL}, ", |
||||
"#{gasOilLiters,jdbcType=DECIMAL}, #{gasDiscount,jdbcType=DECIMAL}, ", |
||||
"#{gasOilSubsidy,jdbcType=DECIMAL}, #{gasLitersPreferences,jdbcType=DECIMAL}, ", |
||||
"#{gasPricePreferences,jdbcType=DECIMAL}, #{gasClassGroupId,jdbcType=BIGINT}, ", |
||||
"#{gasClassGroupName,jdbcType=VARCHAR}, #{gasClassGroupTaskId,jdbcType=BIGINT}, ", |
||||
"#{gasStaffId,jdbcType=BIGINT}, #{gasStaffName,jdbcType=VARCHAR}, ", |
||||
"#{payType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ", |
||||
"#{payTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ", |
||||
"#{refundRemarks,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR}, ", |
||||
"#{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsGasOrder record); |
||||
|
||||
@InsertProvider(type=BsGasOrderSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsGasOrder record); |
||||
|
||||
@SelectProvider(type=BsGasOrderSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="channel_type", property="channelType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_address", property="merAddress", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="deduction_coupon_price", property="deductionCouponPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="deduction_oil_price", property="deductionOilPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="pay_integral", property="payIntegral", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="actual_pay_price", property="actualPayPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_refuel_price", property="gasRefuelPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="gas_oil_type", property="gasOilType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="gas_price_official", property="gasPriceOfficial", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_price_platform", property="gasPricePlatform", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_oil_liters", property="gasOilLiters", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_discount", property="gasDiscount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_liters_preferences", property="gasLitersPreferences", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_price_preferences", property="gasPricePreferences", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_class_group_id", property="gasClassGroupId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="gas_class_group_name", property="gasClassGroupName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="gas_class_group_task_id", property="gasClassGroupTaskId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="refund_remarks", property="refundRemarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_4", property="ext4", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_5", property="ext5", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_6", property="ext6", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsGasOrder> selectByExample(BsGasOrderExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, order_no, order_child_no, channel_type, channel_order_no, user_id, user_phone, ", |
||||
"agent_id, agent_name, mer_id, mer_name, mer_address, total_deduction_price, ", |
||||
"deduction_coupon_price, deduction_oil_price, pay_integral, payable_price, actual_pay_price, ", |
||||
"gas_refuel_price, gas_oil_no, gas_gun_no, gas_oil_type, gas_price_official, ", |
||||
"gas_price_gun, gas_price_vip, gas_price_platform, gas_oil_liters, gas_discount, ", |
||||
"gas_oil_subsidy, gas_liters_preferences, gas_price_preferences, gas_class_group_id, ", |
||||
"gas_class_group_name, gas_class_group_task_id, gas_staff_id, gas_staff_name, ", |
||||
"pay_type, `status`, create_time, cancel_time, pay_time, refund_time, refund_remarks, ", |
||||
"ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", |
||||
"from bs_gas_order", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="channel_type", property="channelType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_address", property="merAddress", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="deduction_coupon_price", property="deductionCouponPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="deduction_oil_price", property="deductionOilPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="pay_integral", property="payIntegral", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="payable_price", property="payablePrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="actual_pay_price", property="actualPayPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_refuel_price", property="gasRefuelPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="gas_oil_type", property="gasOilType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="gas_price_official", property="gasPriceOfficial", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_price_platform", property="gasPricePlatform", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_oil_liters", property="gasOilLiters", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_discount", property="gasDiscount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_liters_preferences", property="gasLitersPreferences", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_price_preferences", property="gasPricePreferences", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="gas_class_group_id", property="gasClassGroupId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="gas_class_group_name", property="gasClassGroupName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="gas_class_group_task_id", property="gasClassGroupTaskId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="refund_remarks", property="refundRemarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_4", property="ext4", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_5", property="ext5", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_6", property="ext6", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsGasOrder selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsGasOrderSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsGasOrder record, @Param("example") BsGasOrderExample example); |
||||
|
||||
@UpdateProvider(type=BsGasOrderSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsGasOrder record, @Param("example") BsGasOrderExample example); |
||||
|
||||
@UpdateProvider(type=BsGasOrderSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsGasOrder record); |
||||
|
||||
@Update({ |
||||
"update bs_gas_order", |
||||
"set order_no = #{orderNo,jdbcType=VARCHAR},", |
||||
"order_child_no = #{orderChildNo,jdbcType=VARCHAR},", |
||||
"channel_type = #{channelType,jdbcType=INTEGER},", |
||||
"channel_order_no = #{channelOrderNo,jdbcType=VARCHAR},", |
||||
"user_id = #{userId,jdbcType=BIGINT},", |
||||
"user_phone = #{userPhone,jdbcType=VARCHAR},", |
||||
"agent_id = #{agentId,jdbcType=INTEGER},", |
||||
"agent_name = #{agentName,jdbcType=VARCHAR},", |
||||
"mer_id = #{merId,jdbcType=BIGINT},", |
||||
"mer_name = #{merName,jdbcType=VARCHAR},", |
||||
"mer_address = #{merAddress,jdbcType=VARCHAR},", |
||||
"total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL},", |
||||
"deduction_coupon_price = #{deductionCouponPrice,jdbcType=DECIMAL},", |
||||
"deduction_oil_price = #{deductionOilPrice,jdbcType=DECIMAL},", |
||||
"pay_integral = #{payIntegral,jdbcType=INTEGER},", |
||||
"payable_price = #{payablePrice,jdbcType=DECIMAL},", |
||||
"actual_pay_price = #{actualPayPrice,jdbcType=DECIMAL},", |
||||
"gas_refuel_price = #{gasRefuelPrice,jdbcType=DECIMAL},", |
||||
"gas_oil_no = #{gasOilNo,jdbcType=VARCHAR},", |
||||
"gas_gun_no = #{gasGunNo,jdbcType=VARCHAR},", |
||||
"gas_oil_type = #{gasOilType,jdbcType=INTEGER},", |
||||
"gas_price_official = #{gasPriceOfficial,jdbcType=DECIMAL},", |
||||
"gas_price_gun = #{gasPriceGun,jdbcType=DECIMAL},", |
||||
"gas_price_vip = #{gasPriceVip,jdbcType=DECIMAL},", |
||||
"gas_price_platform = #{gasPricePlatform,jdbcType=DECIMAL},", |
||||
"gas_oil_liters = #{gasOilLiters,jdbcType=DECIMAL},", |
||||
"gas_discount = #{gasDiscount,jdbcType=DECIMAL},", |
||||
"gas_oil_subsidy = #{gasOilSubsidy,jdbcType=DECIMAL},", |
||||
"gas_liters_preferences = #{gasLitersPreferences,jdbcType=DECIMAL},", |
||||
"gas_price_preferences = #{gasPricePreferences,jdbcType=DECIMAL},", |
||||
"gas_class_group_id = #{gasClassGroupId,jdbcType=BIGINT},", |
||||
"gas_class_group_name = #{gasClassGroupName,jdbcType=VARCHAR},", |
||||
"gas_class_group_task_id = #{gasClassGroupTaskId,jdbcType=BIGINT},", |
||||
"gas_staff_id = #{gasStaffId,jdbcType=BIGINT},", |
||||
"gas_staff_name = #{gasStaffName,jdbcType=VARCHAR},", |
||||
"pay_type = #{payType,jdbcType=INTEGER},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"cancel_time = #{cancelTime,jdbcType=TIMESTAMP},", |
||||
"pay_time = #{payTime,jdbcType=TIMESTAMP},", |
||||
"refund_time = #{refundTime,jdbcType=TIMESTAMP},", |
||||
"refund_remarks = #{refundRemarks,jdbcType=VARCHAR},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR},", |
||||
"ext_4 = #{ext4,jdbcType=VARCHAR},", |
||||
"ext_5 = #{ext5,jdbcType=VARCHAR},", |
||||
"ext_6 = #{ext6,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsGasOrder record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsGasOrderMapperExt { |
||||
} |
@ -0,0 +1,850 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsGasOrder; |
||||
import com.hfkj.entity.BsGasOrderExample.Criteria; |
||||
import com.hfkj.entity.BsGasOrderExample.Criterion; |
||||
import com.hfkj.entity.BsGasOrderExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsGasOrderSqlProvider { |
||||
|
||||
public String countByExample(BsGasOrderExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_gas_order"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsGasOrderExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_gas_order"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsGasOrder record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_gas_order"); |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderChildNo() != null) { |
||||
sql.VALUES("order_child_no", "#{orderChildNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getChannelType() != null) { |
||||
sql.VALUES("channel_type", "#{channelType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getChannelOrderNo() != null) { |
||||
sql.VALUES("channel_order_no", "#{channelOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAgentId() != null) { |
||||
sql.VALUES("agent_id", "#{agentId,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getAgentName() != null) { |
||||
sql.VALUES("agent_name", "#{agentName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerAddress() != null) { |
||||
sql.VALUES("mer_address", "#{merAddress,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTotalDeductionPrice() != null) { |
||||
sql.VALUES("total_deduction_price", "#{totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDeductionCouponPrice() != null) { |
||||
sql.VALUES("deduction_coupon_price", "#{deductionCouponPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDeductionOilPrice() != null) { |
||||
sql.VALUES("deduction_oil_price", "#{deductionOilPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getPayIntegral() != null) { |
||||
sql.VALUES("pay_integral", "#{payIntegral,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPayablePrice() != null) { |
||||
sql.VALUES("payable_price", "#{payablePrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getActualPayPrice() != null) { |
||||
sql.VALUES("actual_pay_price", "#{actualPayPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasRefuelPrice() != null) { |
||||
sql.VALUES("gas_refuel_price", "#{gasRefuelPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasOilNo() != null) { |
||||
sql.VALUES("gas_oil_no", "#{gasOilNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGasGunNo() != null) { |
||||
sql.VALUES("gas_gun_no", "#{gasGunNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGasOilType() != null) { |
||||
sql.VALUES("gas_oil_type", "#{gasOilType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getGasPriceOfficial() != null) { |
||||
sql.VALUES("gas_price_official", "#{gasPriceOfficial,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPriceGun() != null) { |
||||
sql.VALUES("gas_price_gun", "#{gasPriceGun,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPriceVip() != null) { |
||||
sql.VALUES("gas_price_vip", "#{gasPriceVip,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPricePlatform() != null) { |
||||
sql.VALUES("gas_price_platform", "#{gasPricePlatform,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasOilLiters() != null) { |
||||
sql.VALUES("gas_oil_liters", "#{gasOilLiters,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasDiscount() != null) { |
||||
sql.VALUES("gas_discount", "#{gasDiscount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasOilSubsidy() != null) { |
||||
sql.VALUES("gas_oil_subsidy", "#{gasOilSubsidy,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasLitersPreferences() != null) { |
||||
sql.VALUES("gas_liters_preferences", "#{gasLitersPreferences,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPricePreferences() != null) { |
||||
sql.VALUES("gas_price_preferences", "#{gasPricePreferences,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasClassGroupId() != null) { |
||||
sql.VALUES("gas_class_group_id", "#{gasClassGroupId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGasClassGroupName() != null) { |
||||
sql.VALUES("gas_class_group_name", "#{gasClassGroupName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGasClassGroupTaskId() != null) { |
||||
sql.VALUES("gas_class_group_task_id", "#{gasClassGroupTaskId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGasStaffId() != null) { |
||||
sql.VALUES("gas_staff_id", "#{gasStaffId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGasStaffName() != null) { |
||||
sql.VALUES("gas_staff_name", "#{gasStaffName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPayType() != null) { |
||||
sql.VALUES("pay_type", "#{payType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCancelTime() != null) { |
||||
sql.VALUES("cancel_time", "#{cancelTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getPayTime() != null) { |
||||
sql.VALUES("pay_time", "#{payTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getRefundTime() != null) { |
||||
sql.VALUES("refund_time", "#{refundTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getRefundRemarks() != null) { |
||||
sql.VALUES("refund_remarks", "#{refundRemarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt4() != null) { |
||||
sql.VALUES("ext_4", "#{ext4,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt5() != null) { |
||||
sql.VALUES("ext_5", "#{ext5,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt6() != null) { |
||||
sql.VALUES("ext_6", "#{ext6,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsGasOrderExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("order_no"); |
||||
sql.SELECT("order_child_no"); |
||||
sql.SELECT("channel_type"); |
||||
sql.SELECT("channel_order_no"); |
||||
sql.SELECT("user_id"); |
||||
sql.SELECT("user_phone"); |
||||
sql.SELECT("agent_id"); |
||||
sql.SELECT("agent_name"); |
||||
sql.SELECT("mer_id"); |
||||
sql.SELECT("mer_name"); |
||||
sql.SELECT("mer_address"); |
||||
sql.SELECT("total_deduction_price"); |
||||
sql.SELECT("deduction_coupon_price"); |
||||
sql.SELECT("deduction_oil_price"); |
||||
sql.SELECT("pay_integral"); |
||||
sql.SELECT("payable_price"); |
||||
sql.SELECT("actual_pay_price"); |
||||
sql.SELECT("gas_refuel_price"); |
||||
sql.SELECT("gas_oil_no"); |
||||
sql.SELECT("gas_gun_no"); |
||||
sql.SELECT("gas_oil_type"); |
||||
sql.SELECT("gas_price_official"); |
||||
sql.SELECT("gas_price_gun"); |
||||
sql.SELECT("gas_price_vip"); |
||||
sql.SELECT("gas_price_platform"); |
||||
sql.SELECT("gas_oil_liters"); |
||||
sql.SELECT("gas_discount"); |
||||
sql.SELECT("gas_oil_subsidy"); |
||||
sql.SELECT("gas_liters_preferences"); |
||||
sql.SELECT("gas_price_preferences"); |
||||
sql.SELECT("gas_class_group_id"); |
||||
sql.SELECT("gas_class_group_name"); |
||||
sql.SELECT("gas_class_group_task_id"); |
||||
sql.SELECT("gas_staff_id"); |
||||
sql.SELECT("gas_staff_name"); |
||||
sql.SELECT("pay_type"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("cancel_time"); |
||||
sql.SELECT("pay_time"); |
||||
sql.SELECT("refund_time"); |
||||
sql.SELECT("refund_remarks"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.SELECT("ext_4"); |
||||
sql.SELECT("ext_5"); |
||||
sql.SELECT("ext_6"); |
||||
sql.FROM("bs_gas_order"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsGasOrder record = (BsGasOrder) parameter.get("record"); |
||||
BsGasOrderExample example = (BsGasOrderExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_gas_order"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderChildNo() != null) { |
||||
sql.SET("order_child_no = #{record.orderChildNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getChannelType() != null) { |
||||
sql.SET("channel_type = #{record.channelType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getChannelOrderNo() != null) { |
||||
sql.SET("channel_order_no = #{record.channelOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAgentId() != null) { |
||||
sql.SET("agent_id = #{record.agentId,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getAgentName() != null) { |
||||
sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerAddress() != null) { |
||||
sql.SET("mer_address = #{record.merAddress,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTotalDeductionPrice() != null) { |
||||
sql.SET("total_deduction_price = #{record.totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDeductionCouponPrice() != null) { |
||||
sql.SET("deduction_coupon_price = #{record.deductionCouponPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDeductionOilPrice() != null) { |
||||
sql.SET("deduction_oil_price = #{record.deductionOilPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getPayIntegral() != null) { |
||||
sql.SET("pay_integral = #{record.payIntegral,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPayablePrice() != null) { |
||||
sql.SET("payable_price = #{record.payablePrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getActualPayPrice() != null) { |
||||
sql.SET("actual_pay_price = #{record.actualPayPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasRefuelPrice() != null) { |
||||
sql.SET("gas_refuel_price = #{record.gasRefuelPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasOilNo() != null) { |
||||
sql.SET("gas_oil_no = #{record.gasOilNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGasGunNo() != null) { |
||||
sql.SET("gas_gun_no = #{record.gasGunNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGasOilType() != null) { |
||||
sql.SET("gas_oil_type = #{record.gasOilType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getGasPriceOfficial() != null) { |
||||
sql.SET("gas_price_official = #{record.gasPriceOfficial,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPriceGun() != null) { |
||||
sql.SET("gas_price_gun = #{record.gasPriceGun,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPriceVip() != null) { |
||||
sql.SET("gas_price_vip = #{record.gasPriceVip,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPricePlatform() != null) { |
||||
sql.SET("gas_price_platform = #{record.gasPricePlatform,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasOilLiters() != null) { |
||||
sql.SET("gas_oil_liters = #{record.gasOilLiters,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasDiscount() != null) { |
||||
sql.SET("gas_discount = #{record.gasDiscount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasOilSubsidy() != null) { |
||||
sql.SET("gas_oil_subsidy = #{record.gasOilSubsidy,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasLitersPreferences() != null) { |
||||
sql.SET("gas_liters_preferences = #{record.gasLitersPreferences,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPricePreferences() != null) { |
||||
sql.SET("gas_price_preferences = #{record.gasPricePreferences,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasClassGroupId() != null) { |
||||
sql.SET("gas_class_group_id = #{record.gasClassGroupId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGasClassGroupName() != null) { |
||||
sql.SET("gas_class_group_name = #{record.gasClassGroupName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGasClassGroupTaskId() != null) { |
||||
sql.SET("gas_class_group_task_id = #{record.gasClassGroupTaskId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGasStaffId() != null) { |
||||
sql.SET("gas_staff_id = #{record.gasStaffId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGasStaffName() != null) { |
||||
sql.SET("gas_staff_name = #{record.gasStaffName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPayType() != null) { |
||||
sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCancelTime() != null) { |
||||
sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getPayTime() != null) { |
||||
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getRefundTime() != null) { |
||||
sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getRefundRemarks() != null) { |
||||
sql.SET("refund_remarks = #{record.refundRemarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt4() != null) { |
||||
sql.SET("ext_4 = #{record.ext4,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt5() != null) { |
||||
sql.SET("ext_5 = #{record.ext5,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt6() != null) { |
||||
sql.SET("ext_6 = #{record.ext6,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_gas_order"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("order_child_no = #{record.orderChildNo,jdbcType=VARCHAR}"); |
||||
sql.SET("channel_type = #{record.channelType,jdbcType=INTEGER}"); |
||||
sql.SET("channel_order_no = #{record.channelOrderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("agent_id = #{record.agentId,jdbcType=INTEGER}"); |
||||
sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); |
||||
sql.SET("mer_address = #{record.merAddress,jdbcType=VARCHAR}"); |
||||
sql.SET("total_deduction_price = #{record.totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("deduction_coupon_price = #{record.deductionCouponPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("deduction_oil_price = #{record.deductionOilPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("pay_integral = #{record.payIntegral,jdbcType=INTEGER}"); |
||||
sql.SET("payable_price = #{record.payablePrice,jdbcType=DECIMAL}"); |
||||
sql.SET("actual_pay_price = #{record.actualPayPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_refuel_price = #{record.gasRefuelPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_oil_no = #{record.gasOilNo,jdbcType=VARCHAR}"); |
||||
sql.SET("gas_gun_no = #{record.gasGunNo,jdbcType=VARCHAR}"); |
||||
sql.SET("gas_oil_type = #{record.gasOilType,jdbcType=INTEGER}"); |
||||
sql.SET("gas_price_official = #{record.gasPriceOfficial,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_price_gun = #{record.gasPriceGun,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_price_vip = #{record.gasPriceVip,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_price_platform = #{record.gasPricePlatform,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_oil_liters = #{record.gasOilLiters,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_discount = #{record.gasDiscount,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_oil_subsidy = #{record.gasOilSubsidy,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_liters_preferences = #{record.gasLitersPreferences,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_price_preferences = #{record.gasPricePreferences,jdbcType=DECIMAL}"); |
||||
sql.SET("gas_class_group_id = #{record.gasClassGroupId,jdbcType=BIGINT}"); |
||||
sql.SET("gas_class_group_name = #{record.gasClassGroupName,jdbcType=VARCHAR}"); |
||||
sql.SET("gas_class_group_task_id = #{record.gasClassGroupTaskId,jdbcType=BIGINT}"); |
||||
sql.SET("gas_staff_id = #{record.gasStaffId,jdbcType=BIGINT}"); |
||||
sql.SET("gas_staff_name = #{record.gasStaffName,jdbcType=VARCHAR}"); |
||||
sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("refund_remarks = #{record.refundRemarks,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_4 = #{record.ext4,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_5 = #{record.ext5,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_6 = #{record.ext6,jdbcType=VARCHAR}"); |
||||
|
||||
BsGasOrderExample example = (BsGasOrderExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsGasOrder record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_gas_order"); |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderChildNo() != null) { |
||||
sql.SET("order_child_no = #{orderChildNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getChannelType() != null) { |
||||
sql.SET("channel_type = #{channelType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getChannelOrderNo() != null) { |
||||
sql.SET("channel_order_no = #{channelOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAgentId() != null) { |
||||
sql.SET("agent_id = #{agentId,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getAgentName() != null) { |
||||
sql.SET("agent_name = #{agentName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerAddress() != null) { |
||||
sql.SET("mer_address = #{merAddress,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTotalDeductionPrice() != null) { |
||||
sql.SET("total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDeductionCouponPrice() != null) { |
||||
sql.SET("deduction_coupon_price = #{deductionCouponPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getDeductionOilPrice() != null) { |
||||
sql.SET("deduction_oil_price = #{deductionOilPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getPayIntegral() != null) { |
||||
sql.SET("pay_integral = #{payIntegral,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPayablePrice() != null) { |
||||
sql.SET("payable_price = #{payablePrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getActualPayPrice() != null) { |
||||
sql.SET("actual_pay_price = #{actualPayPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasRefuelPrice() != null) { |
||||
sql.SET("gas_refuel_price = #{gasRefuelPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasOilNo() != null) { |
||||
sql.SET("gas_oil_no = #{gasOilNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGasGunNo() != null) { |
||||
sql.SET("gas_gun_no = #{gasGunNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGasOilType() != null) { |
||||
sql.SET("gas_oil_type = #{gasOilType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getGasPriceOfficial() != null) { |
||||
sql.SET("gas_price_official = #{gasPriceOfficial,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPriceGun() != null) { |
||||
sql.SET("gas_price_gun = #{gasPriceGun,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPriceVip() != null) { |
||||
sql.SET("gas_price_vip = #{gasPriceVip,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPricePlatform() != null) { |
||||
sql.SET("gas_price_platform = #{gasPricePlatform,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasOilLiters() != null) { |
||||
sql.SET("gas_oil_liters = #{gasOilLiters,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasDiscount() != null) { |
||||
sql.SET("gas_discount = #{gasDiscount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasOilSubsidy() != null) { |
||||
sql.SET("gas_oil_subsidy = #{gasOilSubsidy,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasLitersPreferences() != null) { |
||||
sql.SET("gas_liters_preferences = #{gasLitersPreferences,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasPricePreferences() != null) { |
||||
sql.SET("gas_price_preferences = #{gasPricePreferences,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getGasClassGroupId() != null) { |
||||
sql.SET("gas_class_group_id = #{gasClassGroupId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGasClassGroupName() != null) { |
||||
sql.SET("gas_class_group_name = #{gasClassGroupName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGasClassGroupTaskId() != null) { |
||||
sql.SET("gas_class_group_task_id = #{gasClassGroupTaskId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGasStaffId() != null) { |
||||
sql.SET("gas_staff_id = #{gasStaffId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGasStaffName() != null) { |
||||
sql.SET("gas_staff_name = #{gasStaffName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPayType() != null) { |
||||
sql.SET("pay_type = #{payType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCancelTime() != null) { |
||||
sql.SET("cancel_time = #{cancelTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getPayTime() != null) { |
||||
sql.SET("pay_time = #{payTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getRefundTime() != null) { |
||||
sql.SET("refund_time = #{refundTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getRefundRemarks() != null) { |
||||
sql.SET("refund_remarks = #{refundRemarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt4() != null) { |
||||
sql.SET("ext_4 = #{ext4,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt5() != null) { |
||||
sql.SET("ext_5 = #{ext5,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt6() != null) { |
||||
sql.SET("ext_6 = #{ext6,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsGasOrderExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,193 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrderChild; |
||||
import com.hfkj.entity.BsOrderChildExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsOrderChildMapper extends BsOrderChildMapperExt { |
||||
@SelectProvider(type=BsOrderChildSqlProvider.class, method="countByExample") |
||||
long countByExample(BsOrderChildExample example); |
||||
|
||||
@DeleteProvider(type=BsOrderChildSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsOrderChildExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_order_child", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_order_child (order_no, child_order_no, ", |
||||
"product_type, product_id, ", |
||||
"product_name, product_img, ", |
||||
"product_spec_id, product_spec_name, ", |
||||
"product_price, product_actual_price, ", |
||||
"product_count, product_total_price, ", |
||||
"total_deduction_price, coupon_discount_price, ", |
||||
"integral_discount_price, surplus_refund_count, ", |
||||
"surplus_refund_price, surplus_refund_integral, ", |
||||
"`status`, settle_account, ", |
||||
"settle_account_key, create_time, ", |
||||
"update_time, finish_time, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{orderNo,jdbcType=VARCHAR}, #{childOrderNo,jdbcType=VARCHAR}, ", |
||||
"#{productType,jdbcType=INTEGER}, #{productId,jdbcType=BIGINT}, ", |
||||
"#{productName,jdbcType=VARCHAR}, #{productImg,jdbcType=VARCHAR}, ", |
||||
"#{productSpecId,jdbcType=BIGINT}, #{productSpecName,jdbcType=VARCHAR}, ", |
||||
"#{productPrice,jdbcType=DECIMAL}, #{productActualPrice,jdbcType=DECIMAL}, ", |
||||
"#{productCount,jdbcType=INTEGER}, #{productTotalPrice,jdbcType=DECIMAL}, ", |
||||
"#{totalDeductionPrice,jdbcType=DECIMAL}, #{couponDiscountPrice,jdbcType=DECIMAL}, ", |
||||
"#{integralDiscountPrice,jdbcType=DECIMAL}, #{surplusRefundCount,jdbcType=INTEGER}, ", |
||||
"#{surplusRefundPrice,jdbcType=DECIMAL}, #{surplusRefundIntegral,jdbcType=BIGINT}, ", |
||||
"#{status,jdbcType=INTEGER}, #{settleAccount,jdbcType=VARCHAR}, ", |
||||
"#{settleAccountKey,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsOrderChild record); |
||||
|
||||
@InsertProvider(type=BsOrderChildSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsOrderChild record); |
||||
|
||||
@SelectProvider(type=BsOrderChildSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_type", property="productType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_spec_id", property="productSpecId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="product_spec_name", property="productSpecName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_price", property="productPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="product_actual_price", property="productActualPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="product_count", property="productCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="product_total_price", property="productTotalPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="coupon_discount_price", property="couponDiscountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="integral_discount_price", property="integralDiscountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="surplus_refund_count", property="surplusRefundCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="surplus_refund_price", property="surplusRefundPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="surplus_refund_integral", property="surplusRefundIntegral", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="settle_account", property="settleAccount", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="settle_account_key", property="settleAccountKey", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsOrderChild> selectByExample(BsOrderChildExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, order_no, child_order_no, product_type, product_id, product_name, product_img, ", |
||||
"product_spec_id, product_spec_name, product_price, product_actual_price, product_count, ", |
||||
"product_total_price, total_deduction_price, coupon_discount_price, integral_discount_price, ", |
||||
"surplus_refund_count, surplus_refund_price, surplus_refund_integral, `status`, ", |
||||
"settle_account, settle_account_key, create_time, update_time, finish_time, ext_1, ", |
||||
"ext_2, ext_3", |
||||
"from bs_order_child", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_type", property="productType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_spec_id", property="productSpecId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="product_spec_name", property="productSpecName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="product_price", property="productPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="product_actual_price", property="productActualPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="product_count", property="productCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="product_total_price", property="productTotalPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="coupon_discount_price", property="couponDiscountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="integral_discount_price", property="integralDiscountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="surplus_refund_count", property="surplusRefundCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="surplus_refund_price", property="surplusRefundPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="surplus_refund_integral", property="surplusRefundIntegral", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="settle_account", property="settleAccount", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="settle_account_key", property="settleAccountKey", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsOrderChild selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsOrderChildSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsOrderChild record, @Param("example") BsOrderChildExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderChildSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsOrderChild record, @Param("example") BsOrderChildExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderChildSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsOrderChild record); |
||||
|
||||
@Update({ |
||||
"update bs_order_child", |
||||
"set order_no = #{orderNo,jdbcType=VARCHAR},", |
||||
"child_order_no = #{childOrderNo,jdbcType=VARCHAR},", |
||||
"product_type = #{productType,jdbcType=INTEGER},", |
||||
"product_id = #{productId,jdbcType=BIGINT},", |
||||
"product_name = #{productName,jdbcType=VARCHAR},", |
||||
"product_img = #{productImg,jdbcType=VARCHAR},", |
||||
"product_spec_id = #{productSpecId,jdbcType=BIGINT},", |
||||
"product_spec_name = #{productSpecName,jdbcType=VARCHAR},", |
||||
"product_price = #{productPrice,jdbcType=DECIMAL},", |
||||
"product_actual_price = #{productActualPrice,jdbcType=DECIMAL},", |
||||
"product_count = #{productCount,jdbcType=INTEGER},", |
||||
"product_total_price = #{productTotalPrice,jdbcType=DECIMAL},", |
||||
"total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL},", |
||||
"coupon_discount_price = #{couponDiscountPrice,jdbcType=DECIMAL},", |
||||
"integral_discount_price = #{integralDiscountPrice,jdbcType=DECIMAL},", |
||||
"surplus_refund_count = #{surplusRefundCount,jdbcType=INTEGER},", |
||||
"surplus_refund_price = #{surplusRefundPrice,jdbcType=DECIMAL},", |
||||
"surplus_refund_integral = #{surplusRefundIntegral,jdbcType=BIGINT},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"settle_account = #{settleAccount,jdbcType=VARCHAR},", |
||||
"settle_account_key = #{settleAccountKey,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"finish_time = #{finishTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsOrderChild record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsOrderChildMapperExt { |
||||
} |
@ -0,0 +1,556 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrderChild; |
||||
import com.hfkj.entity.BsOrderChildExample.Criteria; |
||||
import com.hfkj.entity.BsOrderChildExample.Criterion; |
||||
import com.hfkj.entity.BsOrderChildExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsOrderChildSqlProvider { |
||||
|
||||
public String countByExample(BsOrderChildExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_order_child"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsOrderChildExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_order_child"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsOrderChild record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_order_child"); |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getChildOrderNo() != null) { |
||||
sql.VALUES("child_order_no", "#{childOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductType() != null) { |
||||
sql.VALUES("product_type", "#{productType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductId() != null) { |
||||
sql.VALUES("product_id", "#{productId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductName() != null) { |
||||
sql.VALUES("product_name", "#{productName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductImg() != null) { |
||||
sql.VALUES("product_img", "#{productImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductSpecId() != null) { |
||||
sql.VALUES("product_spec_id", "#{productSpecId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductSpecName() != null) { |
||||
sql.VALUES("product_spec_name", "#{productSpecName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductPrice() != null) { |
||||
sql.VALUES("product_price", "#{productPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProductActualPrice() != null) { |
||||
sql.VALUES("product_actual_price", "#{productActualPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProductCount() != null) { |
||||
sql.VALUES("product_count", "#{productCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductTotalPrice() != null) { |
||||
sql.VALUES("product_total_price", "#{productTotalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getTotalDeductionPrice() != null) { |
||||
sql.VALUES("total_deduction_price", "#{totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountPrice() != null) { |
||||
sql.VALUES("coupon_discount_price", "#{couponDiscountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getIntegralDiscountPrice() != null) { |
||||
sql.VALUES("integral_discount_price", "#{integralDiscountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSurplusRefundCount() != null) { |
||||
sql.VALUES("surplus_refund_count", "#{surplusRefundCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSurplusRefundPrice() != null) { |
||||
sql.VALUES("surplus_refund_price", "#{surplusRefundPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSurplusRefundIntegral() != null) { |
||||
sql.VALUES("surplus_refund_integral", "#{surplusRefundIntegral,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSettleAccount() != null) { |
||||
sql.VALUES("settle_account", "#{settleAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSettleAccountKey() != null) { |
||||
sql.VALUES("settle_account_key", "#{settleAccountKey,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.VALUES("finish_time", "#{finishTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsOrderChildExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("order_no"); |
||||
sql.SELECT("child_order_no"); |
||||
sql.SELECT("product_type"); |
||||
sql.SELECT("product_id"); |
||||
sql.SELECT("product_name"); |
||||
sql.SELECT("product_img"); |
||||
sql.SELECT("product_spec_id"); |
||||
sql.SELECT("product_spec_name"); |
||||
sql.SELECT("product_price"); |
||||
sql.SELECT("product_actual_price"); |
||||
sql.SELECT("product_count"); |
||||
sql.SELECT("product_total_price"); |
||||
sql.SELECT("total_deduction_price"); |
||||
sql.SELECT("coupon_discount_price"); |
||||
sql.SELECT("integral_discount_price"); |
||||
sql.SELECT("surplus_refund_count"); |
||||
sql.SELECT("surplus_refund_price"); |
||||
sql.SELECT("surplus_refund_integral"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("settle_account"); |
||||
sql.SELECT("settle_account_key"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("finish_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_order_child"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsOrderChild record = (BsOrderChild) parameter.get("record"); |
||||
BsOrderChildExample example = (BsOrderChildExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_child"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getChildOrderNo() != null) { |
||||
sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductType() != null) { |
||||
sql.SET("product_type = #{record.productType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductId() != null) { |
||||
sql.SET("product_id = #{record.productId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductName() != null) { |
||||
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductImg() != null) { |
||||
sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductSpecId() != null) { |
||||
sql.SET("product_spec_id = #{record.productSpecId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductSpecName() != null) { |
||||
sql.SET("product_spec_name = #{record.productSpecName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductPrice() != null) { |
||||
sql.SET("product_price = #{record.productPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProductActualPrice() != null) { |
||||
sql.SET("product_actual_price = #{record.productActualPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProductCount() != null) { |
||||
sql.SET("product_count = #{record.productCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductTotalPrice() != null) { |
||||
sql.SET("product_total_price = #{record.productTotalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getTotalDeductionPrice() != null) { |
||||
sql.SET("total_deduction_price = #{record.totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountPrice() != null) { |
||||
sql.SET("coupon_discount_price = #{record.couponDiscountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getIntegralDiscountPrice() != null) { |
||||
sql.SET("integral_discount_price = #{record.integralDiscountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSurplusRefundCount() != null) { |
||||
sql.SET("surplus_refund_count = #{record.surplusRefundCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSurplusRefundPrice() != null) { |
||||
sql.SET("surplus_refund_price = #{record.surplusRefundPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSurplusRefundIntegral() != null) { |
||||
sql.SET("surplus_refund_integral = #{record.surplusRefundIntegral,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSettleAccount() != null) { |
||||
sql.SET("settle_account = #{record.settleAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSettleAccountKey() != null) { |
||||
sql.SET("settle_account_key = #{record.settleAccountKey,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_child"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("product_type = #{record.productType,jdbcType=INTEGER}"); |
||||
sql.SET("product_id = #{record.productId,jdbcType=BIGINT}"); |
||||
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); |
||||
sql.SET("product_img = #{record.productImg,jdbcType=VARCHAR}"); |
||||
sql.SET("product_spec_id = #{record.productSpecId,jdbcType=BIGINT}"); |
||||
sql.SET("product_spec_name = #{record.productSpecName,jdbcType=VARCHAR}"); |
||||
sql.SET("product_price = #{record.productPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("product_actual_price = #{record.productActualPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("product_count = #{record.productCount,jdbcType=INTEGER}"); |
||||
sql.SET("product_total_price = #{record.productTotalPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("total_deduction_price = #{record.totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("coupon_discount_price = #{record.couponDiscountPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("integral_discount_price = #{record.integralDiscountPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("surplus_refund_count = #{record.surplusRefundCount,jdbcType=INTEGER}"); |
||||
sql.SET("surplus_refund_price = #{record.surplusRefundPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("surplus_refund_integral = #{record.surplusRefundIntegral,jdbcType=BIGINT}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("settle_account = #{record.settleAccount,jdbcType=VARCHAR}"); |
||||
sql.SET("settle_account_key = #{record.settleAccountKey,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsOrderChildExample example = (BsOrderChildExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsOrderChild record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_child"); |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getChildOrderNo() != null) { |
||||
sql.SET("child_order_no = #{childOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductType() != null) { |
||||
sql.SET("product_type = #{productType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductId() != null) { |
||||
sql.SET("product_id = #{productId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductName() != null) { |
||||
sql.SET("product_name = #{productName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductImg() != null) { |
||||
sql.SET("product_img = #{productImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductSpecId() != null) { |
||||
sql.SET("product_spec_id = #{productSpecId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getProductSpecName() != null) { |
||||
sql.SET("product_spec_name = #{productSpecName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProductPrice() != null) { |
||||
sql.SET("product_price = #{productPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProductActualPrice() != null) { |
||||
sql.SET("product_actual_price = #{productActualPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProductCount() != null) { |
||||
sql.SET("product_count = #{productCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getProductTotalPrice() != null) { |
||||
sql.SET("product_total_price = #{productTotalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getTotalDeductionPrice() != null) { |
||||
sql.SET("total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountPrice() != null) { |
||||
sql.SET("coupon_discount_price = #{couponDiscountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getIntegralDiscountPrice() != null) { |
||||
sql.SET("integral_discount_price = #{integralDiscountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSurplusRefundCount() != null) { |
||||
sql.SET("surplus_refund_count = #{surplusRefundCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSurplusRefundPrice() != null) { |
||||
sql.SET("surplus_refund_price = #{surplusRefundPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSurplusRefundIntegral() != null) { |
||||
sql.SET("surplus_refund_integral = #{surplusRefundIntegral,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSettleAccount() != null) { |
||||
sql.SET("settle_account = #{settleAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSettleAccountKey() != null) { |
||||
sql.SET("settle_account_key = #{settleAccountKey,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{finishTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsOrderChildExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,131 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrderDeduction; |
||||
import com.hfkj.entity.BsOrderDeductionExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsOrderDeductionMapper extends BsOrderDeductionMapperExt { |
||||
@SelectProvider(type=BsOrderDeductionSqlProvider.class, method="countByExample") |
||||
long countByExample(BsOrderDeductionExample example); |
||||
|
||||
@DeleteProvider(type=BsOrderDeductionSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsOrderDeductionExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_order_deduction", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_order_deduction (order_id, order_no, ", |
||||
"total_deduction_price, user_coupon_discount_id, ", |
||||
"coupon_discount_id, coupon_discount_type, ", |
||||
"coupon_discount_price, coupon_discount_actual_price, ", |
||||
"integral_discount_price, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{orderId,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, ", |
||||
"#{totalDeductionPrice,jdbcType=DECIMAL}, #{userCouponDiscountId,jdbcType=BIGINT}, ", |
||||
"#{couponDiscountId,jdbcType=BIGINT}, #{couponDiscountType,jdbcType=INTEGER}, ", |
||||
"#{couponDiscountPrice,jdbcType=DECIMAL}, #{couponDiscountActualPrice,jdbcType=DECIMAL}, ", |
||||
"#{integralDiscountPrice,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsOrderDeduction record); |
||||
|
||||
@InsertProvider(type=BsOrderDeductionSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsOrderDeduction record); |
||||
|
||||
@SelectProvider(type=BsOrderDeductionSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="user_coupon_discount_id", property="userCouponDiscountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_discount_id", property="couponDiscountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_discount_type", property="couponDiscountType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="coupon_discount_price", property="couponDiscountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="coupon_discount_actual_price", property="couponDiscountActualPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="integral_discount_price", property="integralDiscountPrice", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsOrderDeduction> selectByExample(BsOrderDeductionExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, order_id, order_no, total_deduction_price, user_coupon_discount_id, coupon_discount_id, ", |
||||
"coupon_discount_type, coupon_discount_price, coupon_discount_actual_price, integral_discount_price, ", |
||||
"ext_1, ext_2, ext_3", |
||||
"from bs_order_deduction", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="user_coupon_discount_id", property="userCouponDiscountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_discount_id", property="couponDiscountId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="coupon_discount_type", property="couponDiscountType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="coupon_discount_price", property="couponDiscountPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="coupon_discount_actual_price", property="couponDiscountActualPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="integral_discount_price", property="integralDiscountPrice", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsOrderDeduction selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsOrderDeductionSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsOrderDeduction record, @Param("example") BsOrderDeductionExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderDeductionSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsOrderDeduction record, @Param("example") BsOrderDeductionExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderDeductionSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsOrderDeduction record); |
||||
|
||||
@Update({ |
||||
"update bs_order_deduction", |
||||
"set order_id = #{orderId,jdbcType=BIGINT},", |
||||
"order_no = #{orderNo,jdbcType=VARCHAR},", |
||||
"total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL},", |
||||
"user_coupon_discount_id = #{userCouponDiscountId,jdbcType=BIGINT},", |
||||
"coupon_discount_id = #{couponDiscountId,jdbcType=BIGINT},", |
||||
"coupon_discount_type = #{couponDiscountType,jdbcType=INTEGER},", |
||||
"coupon_discount_price = #{couponDiscountPrice,jdbcType=DECIMAL},", |
||||
"coupon_discount_actual_price = #{couponDiscountActualPrice,jdbcType=DECIMAL},", |
||||
"integral_discount_price = #{integralDiscountPrice,jdbcType=BIGINT},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsOrderDeduction record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsOrderDeductionMapperExt { |
||||
} |
@ -0,0 +1,346 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrderDeduction; |
||||
import com.hfkj.entity.BsOrderDeductionExample.Criteria; |
||||
import com.hfkj.entity.BsOrderDeductionExample.Criterion; |
||||
import com.hfkj.entity.BsOrderDeductionExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsOrderDeductionSqlProvider { |
||||
|
||||
public String countByExample(BsOrderDeductionExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_order_deduction"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsOrderDeductionExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_order_deduction"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsOrderDeduction record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_order_deduction"); |
||||
|
||||
if (record.getOrderId() != null) { |
||||
sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTotalDeductionPrice() != null) { |
||||
sql.VALUES("total_deduction_price", "#{totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getUserCouponDiscountId() != null) { |
||||
sql.VALUES("user_coupon_discount_id", "#{userCouponDiscountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountId() != null) { |
||||
sql.VALUES("coupon_discount_id", "#{couponDiscountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountType() != null) { |
||||
sql.VALUES("coupon_discount_type", "#{couponDiscountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountPrice() != null) { |
||||
sql.VALUES("coupon_discount_price", "#{couponDiscountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountActualPrice() != null) { |
||||
sql.VALUES("coupon_discount_actual_price", "#{couponDiscountActualPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getIntegralDiscountPrice() != null) { |
||||
sql.VALUES("integral_discount_price", "#{integralDiscountPrice,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsOrderDeductionExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("order_id"); |
||||
sql.SELECT("order_no"); |
||||
sql.SELECT("total_deduction_price"); |
||||
sql.SELECT("user_coupon_discount_id"); |
||||
sql.SELECT("coupon_discount_id"); |
||||
sql.SELECT("coupon_discount_type"); |
||||
sql.SELECT("coupon_discount_price"); |
||||
sql.SELECT("coupon_discount_actual_price"); |
||||
sql.SELECT("integral_discount_price"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_order_deduction"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsOrderDeduction record = (BsOrderDeduction) parameter.get("record"); |
||||
BsOrderDeductionExample example = (BsOrderDeductionExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_deduction"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderId() != null) { |
||||
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTotalDeductionPrice() != null) { |
||||
sql.SET("total_deduction_price = #{record.totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getUserCouponDiscountId() != null) { |
||||
sql.SET("user_coupon_discount_id = #{record.userCouponDiscountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountId() != null) { |
||||
sql.SET("coupon_discount_id = #{record.couponDiscountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountType() != null) { |
||||
sql.SET("coupon_discount_type = #{record.couponDiscountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountPrice() != null) { |
||||
sql.SET("coupon_discount_price = #{record.couponDiscountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountActualPrice() != null) { |
||||
sql.SET("coupon_discount_actual_price = #{record.couponDiscountActualPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getIntegralDiscountPrice() != null) { |
||||
sql.SET("integral_discount_price = #{record.integralDiscountPrice,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_deduction"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}"); |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("total_deduction_price = #{record.totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("user_coupon_discount_id = #{record.userCouponDiscountId,jdbcType=BIGINT}"); |
||||
sql.SET("coupon_discount_id = #{record.couponDiscountId,jdbcType=BIGINT}"); |
||||
sql.SET("coupon_discount_type = #{record.couponDiscountType,jdbcType=INTEGER}"); |
||||
sql.SET("coupon_discount_price = #{record.couponDiscountPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("coupon_discount_actual_price = #{record.couponDiscountActualPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("integral_discount_price = #{record.integralDiscountPrice,jdbcType=BIGINT}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsOrderDeductionExample example = (BsOrderDeductionExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsOrderDeduction record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order_deduction"); |
||||
|
||||
if (record.getOrderId() != null) { |
||||
sql.SET("order_id = #{orderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getTotalDeductionPrice() != null) { |
||||
sql.SET("total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getUserCouponDiscountId() != null) { |
||||
sql.SET("user_coupon_discount_id = #{userCouponDiscountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountId() != null) { |
||||
sql.SET("coupon_discount_id = #{couponDiscountId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountType() != null) { |
||||
sql.SET("coupon_discount_type = #{couponDiscountType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountPrice() != null) { |
||||
sql.SET("coupon_discount_price = #{couponDiscountPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCouponDiscountActualPrice() != null) { |
||||
sql.SET("coupon_discount_actual_price = #{couponDiscountActualPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getIntegralDiscountPrice() != null) { |
||||
sql.SET("integral_discount_price = #{integralDiscountPrice,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsOrderDeductionExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,172 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrder; |
||||
import com.hfkj.entity.BsOrderExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsOrderMapper extends BsOrderMapperExt { |
||||
@SelectProvider(type=BsOrderSqlProvider.class, method="countByExample") |
||||
long countByExample(BsOrderExample example); |
||||
|
||||
@DeleteProvider(type=BsOrderSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsOrderExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_order", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_order (user_id, user_name, ", |
||||
"user_phone, order_no, ", |
||||
"pay_channel, pay_channel_order_no, ", |
||||
"pay_serial_no, pay_type, ", |
||||
"total_price, pay_real_price, ", |
||||
"product_total_price, create_time, ", |
||||
"update_time, pay_time, ", |
||||
"finish_time, cancel_time, ", |
||||
"refund_time, order_status, ", |
||||
"remarks, ext_1, ext_2, ", |
||||
"ext_3)", |
||||
"values (#{userId,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR}, ", |
||||
"#{userPhone,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ", |
||||
"#{payChannel,jdbcType=INTEGER}, #{payChannelOrderNo,jdbcType=VARCHAR}, ", |
||||
"#{paySerialNo,jdbcType=VARCHAR}, #{payType,jdbcType=INTEGER}, ", |
||||
"#{totalPrice,jdbcType=DECIMAL}, #{payRealPrice,jdbcType=DECIMAL}, ", |
||||
"#{productTotalPrice,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, ", |
||||
"#{finishTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ", |
||||
"#{refundTime,jdbcType=TIMESTAMP}, #{orderStatus,jdbcType=INTEGER}, ", |
||||
"#{remarks,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", |
||||
"#{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsOrder record); |
||||
|
||||
@InsertProvider(type=BsOrderSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsOrder record); |
||||
|
||||
@SelectProvider(type=BsOrderSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="pay_channel_order_no", property="payChannelOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="product_total_price", property="productTotalPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsOrder> selectByExample(BsOrderExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, user_id, user_name, user_phone, order_no, pay_channel, pay_channel_order_no, ", |
||||
"pay_serial_no, pay_type, total_price, pay_real_price, product_total_price, create_time, ", |
||||
"update_time, pay_time, finish_time, cancel_time, refund_time, order_status, ", |
||||
"remarks, ext_1, ext_2, ext_3", |
||||
"from bs_order", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="pay_channel_order_no", property="payChannelOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="product_total_price", property="productTotalPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsOrder selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsOrderSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsOrder record, @Param("example") BsOrderExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsOrder record, @Param("example") BsOrderExample example); |
||||
|
||||
@UpdateProvider(type=BsOrderSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsOrder record); |
||||
|
||||
@Update({ |
||||
"update bs_order", |
||||
"set user_id = #{userId,jdbcType=BIGINT},", |
||||
"user_name = #{userName,jdbcType=VARCHAR},", |
||||
"user_phone = #{userPhone,jdbcType=VARCHAR},", |
||||
"order_no = #{orderNo,jdbcType=VARCHAR},", |
||||
"pay_channel = #{payChannel,jdbcType=INTEGER},", |
||||
"pay_channel_order_no = #{payChannelOrderNo,jdbcType=VARCHAR},", |
||||
"pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},", |
||||
"pay_type = #{payType,jdbcType=INTEGER},", |
||||
"total_price = #{totalPrice,jdbcType=DECIMAL},", |
||||
"pay_real_price = #{payRealPrice,jdbcType=DECIMAL},", |
||||
"product_total_price = #{productTotalPrice,jdbcType=DECIMAL},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"pay_time = #{payTime,jdbcType=TIMESTAMP},", |
||||
"finish_time = #{finishTime,jdbcType=TIMESTAMP},", |
||||
"cancel_time = #{cancelTime,jdbcType=TIMESTAMP},", |
||||
"refund_time = #{refundTime,jdbcType=TIMESTAMP},", |
||||
"order_status = #{orderStatus,jdbcType=INTEGER},", |
||||
"remarks = #{remarks,jdbcType=VARCHAR},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsOrder record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsOrderMapperExt { |
||||
} |
@ -0,0 +1,486 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsOrder; |
||||
import com.hfkj.entity.BsOrderExample.Criteria; |
||||
import com.hfkj.entity.BsOrderExample.Criterion; |
||||
import com.hfkj.entity.BsOrderExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsOrderSqlProvider { |
||||
|
||||
public String countByExample(BsOrderExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_order"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsOrderExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_order"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsOrder record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_order"); |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserName() != null) { |
||||
sql.VALUES("user_name", "#{userName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPayChannel() != null) { |
||||
sql.VALUES("pay_channel", "#{payChannel,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPayChannelOrderNo() != null) { |
||||
sql.VALUES("pay_channel_order_no", "#{payChannelOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPaySerialNo() != null) { |
||||
sql.VALUES("pay_serial_no", "#{paySerialNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPayType() != null) { |
||||
sql.VALUES("pay_type", "#{payType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getTotalPrice() != null) { |
||||
sql.VALUES("total_price", "#{totalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getPayRealPrice() != null) { |
||||
sql.VALUES("pay_real_price", "#{payRealPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProductTotalPrice() != null) { |
||||
sql.VALUES("product_total_price", "#{productTotalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getPayTime() != null) { |
||||
sql.VALUES("pay_time", "#{payTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.VALUES("finish_time", "#{finishTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCancelTime() != null) { |
||||
sql.VALUES("cancel_time", "#{cancelTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getRefundTime() != null) { |
||||
sql.VALUES("refund_time", "#{refundTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOrderStatus() != null) { |
||||
sql.VALUES("order_status", "#{orderStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRemarks() != null) { |
||||
sql.VALUES("remarks", "#{remarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsOrderExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("user_id"); |
||||
sql.SELECT("user_name"); |
||||
sql.SELECT("user_phone"); |
||||
sql.SELECT("order_no"); |
||||
sql.SELECT("pay_channel"); |
||||
sql.SELECT("pay_channel_order_no"); |
||||
sql.SELECT("pay_serial_no"); |
||||
sql.SELECT("pay_type"); |
||||
sql.SELECT("total_price"); |
||||
sql.SELECT("pay_real_price"); |
||||
sql.SELECT("product_total_price"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("pay_time"); |
||||
sql.SELECT("finish_time"); |
||||
sql.SELECT("cancel_time"); |
||||
sql.SELECT("refund_time"); |
||||
sql.SELECT("order_status"); |
||||
sql.SELECT("remarks"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_order"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsOrder record = (BsOrder) parameter.get("record"); |
||||
BsOrderExample example = (BsOrderExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserName() != null) { |
||||
sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPayChannel() != null) { |
||||
sql.SET("pay_channel = #{record.payChannel,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPayChannelOrderNo() != null) { |
||||
sql.SET("pay_channel_order_no = #{record.payChannelOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPaySerialNo() != null) { |
||||
sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPayType() != null) { |
||||
sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getTotalPrice() != null) { |
||||
sql.SET("total_price = #{record.totalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getPayRealPrice() != null) { |
||||
sql.SET("pay_real_price = #{record.payRealPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProductTotalPrice() != null) { |
||||
sql.SET("product_total_price = #{record.productTotalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getPayTime() != null) { |
||||
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCancelTime() != null) { |
||||
sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getRefundTime() != null) { |
||||
sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOrderStatus() != null) { |
||||
sql.SET("order_status = #{record.orderStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRemarks() != null) { |
||||
sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); |
||||
sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}"); |
||||
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("pay_channel = #{record.payChannel,jdbcType=INTEGER}"); |
||||
sql.SET("pay_channel_order_no = #{record.payChannelOrderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}"); |
||||
sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}"); |
||||
sql.SET("total_price = #{record.totalPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("pay_real_price = #{record.payRealPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("product_total_price = #{record.productTotalPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("order_status = #{record.orderStatus,jdbcType=INTEGER}"); |
||||
sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsOrderExample example = (BsOrderExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsOrder record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_order"); |
||||
|
||||
if (record.getUserId() != null) { |
||||
sql.SET("user_id = #{userId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getUserName() != null) { |
||||
sql.SET("user_name = #{userName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getUserPhone() != null) { |
||||
sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPayChannel() != null) { |
||||
sql.SET("pay_channel = #{payChannel,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPayChannelOrderNo() != null) { |
||||
sql.SET("pay_channel_order_no = #{payChannelOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPaySerialNo() != null) { |
||||
sql.SET("pay_serial_no = #{paySerialNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPayType() != null) { |
||||
sql.SET("pay_type = #{payType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getTotalPrice() != null) { |
||||
sql.SET("total_price = #{totalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getPayRealPrice() != null) { |
||||
sql.SET("pay_real_price = #{payRealPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProductTotalPrice() != null) { |
||||
sql.SET("product_total_price = #{productTotalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getPayTime() != null) { |
||||
sql.SET("pay_time = #{payTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{finishTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getCancelTime() != null) { |
||||
sql.SET("cancel_time = #{cancelTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getRefundTime() != null) { |
||||
sql.SET("refund_time = #{refundTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getOrderStatus() != null) { |
||||
sql.SET("order_status = #{orderStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRemarks() != null) { |
||||
sql.SET("remarks = #{remarks,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsOrderExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,822 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_gas_order |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsGasOrder implements Serializable { |
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 交易订单号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 商品订单号 |
||||
*/ |
||||
private String orderChildNo; |
||||
|
||||
/** |
||||
* 渠道类型 |
||||
*/ |
||||
private Integer channelType; |
||||
|
||||
/** |
||||
* 渠道订单号 |
||||
*/ |
||||
private String channelOrderNo; |
||||
|
||||
/** |
||||
* 用户id |
||||
*/ |
||||
private Long userId; |
||||
|
||||
/** |
||||
* 用户手机号 |
||||
*/ |
||||
private String userPhone; |
||||
|
||||
/** |
||||
* 代理商id |
||||
*/ |
||||
private Integer agentId; |
||||
|
||||
/** |
||||
* 代理商名称 |
||||
*/ |
||||
private String agentName; |
||||
|
||||
/** |
||||
* 商户id |
||||
*/ |
||||
private Long merId; |
||||
|
||||
/** |
||||
* 商户名称 |
||||
*/ |
||||
private String merName; |
||||
|
||||
/** |
||||
* 商户地址 |
||||
*/ |
||||
private String merAddress; |
||||
|
||||
/** |
||||
* 交易总优惠金额(优惠券优惠金额+加油优惠金额+积分抵扣) |
||||
*/ |
||||
private BigDecimal totalDeductionPrice; |
||||
|
||||
/** |
||||
* 优惠券优惠金额 |
||||
*/ |
||||
private BigDecimal deductionCouponPrice; |
||||
|
||||
/** |
||||
* 加油优惠金额 |
||||
*/ |
||||
private BigDecimal deductionOilPrice; |
||||
|
||||
/** |
||||
* 积分抵扣 |
||||
*/ |
||||
private Integer payIntegral; |
||||
|
||||
/** |
||||
* 应付金额 |
||||
*/ |
||||
private BigDecimal payablePrice; |
||||
|
||||
/** |
||||
* 实付金额 |
||||
*/ |
||||
private BigDecimal actualPayPrice; |
||||
|
||||
/** |
||||
* 【加油站】加油金额 |
||||
*/ |
||||
private BigDecimal gasRefuelPrice; |
||||
|
||||
/** |
||||
* 【加油站】油号 |
||||
*/ |
||||
private String gasOilNo; |
||||
|
||||
/** |
||||
* 【加油站】油抢号 |
||||
*/ |
||||
private String gasGunNo; |
||||
|
||||
/** |
||||
* 【加油站】油品类型 1:汽油:2:柴油;3:天然气 |
||||
*/ |
||||
private Integer gasOilType; |
||||
|
||||
/** |
||||
* 【加油站】国标价 |
||||
*/ |
||||
private BigDecimal gasPriceOfficial; |
||||
|
||||
/** |
||||
* 【加油站】油枪价 |
||||
*/ |
||||
private BigDecimal gasPriceGun; |
||||
|
||||
/** |
||||
* 【加油站】优惠价 |
||||
*/ |
||||
private BigDecimal gasPriceVip; |
||||
|
||||
/** |
||||
* 【加油站】平台价 |
||||
*/ |
||||
private BigDecimal gasPricePlatform; |
||||
|
||||
/** |
||||
* 【加油站】加油升数 |
||||
*/ |
||||
private BigDecimal gasOilLiters; |
||||
|
||||
/** |
||||
* 【加油站】加油折扣 |
||||
*/ |
||||
private BigDecimal gasDiscount; |
||||
|
||||
/** |
||||
* 【加油站】加油补贴 |
||||
*/ |
||||
private BigDecimal gasOilSubsidy; |
||||
|
||||
/** |
||||
* 【加油站】每升优惠 |
||||
*/ |
||||
private BigDecimal gasLitersPreferences; |
||||
|
||||
/** |
||||
* 【加油站】优惠价格 |
||||
*/ |
||||
private BigDecimal gasPricePreferences; |
||||
|
||||
/** |
||||
* 【加油站】班组id |
||||
*/ |
||||
private Long gasClassGroupId; |
||||
|
||||
/** |
||||
* 【加油站】班组名称 |
||||
*/ |
||||
private String gasClassGroupName; |
||||
|
||||
/** |
||||
* 【加油站】班组任务id |
||||
*/ |
||||
private Long gasClassGroupTaskId; |
||||
|
||||
/** |
||||
* 【加油站】加油员id |
||||
*/ |
||||
private Long gasStaffId; |
||||
|
||||
/** |
||||
* 【加油站】加油员名称 |
||||
*/ |
||||
private String gasStaffName; |
||||
|
||||
/** |
||||
* 支付方式: 1:支付宝 2:微信 3:云闪付 |
||||
*/ |
||||
private Integer payType; |
||||
|
||||
/** |
||||
* 订单状态: |
||||
1. 待支付 |
||||
2. 已支付 |
||||
3. 已取消 |
||||
4. 已退款 |
||||
5. 退款中 |
||||
6. 退款失败 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 取消时间 |
||||
*/ |
||||
private Date cancelTime; |
||||
|
||||
/** |
||||
* 支付时间 |
||||
*/ |
||||
private Date payTime; |
||||
|
||||
/** |
||||
* 退款时间 |
||||
*/ |
||||
private Date refundTime; |
||||
|
||||
/** |
||||
* 退款备注 |
||||
*/ |
||||
private String refundRemarks; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private String ext4; |
||||
|
||||
private String ext5; |
||||
|
||||
private String ext6; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getOrderNo() { |
||||
return orderNo; |
||||
} |
||||
|
||||
public void setOrderNo(String orderNo) { |
||||
this.orderNo = orderNo; |
||||
} |
||||
|
||||
public String getOrderChildNo() { |
||||
return orderChildNo; |
||||
} |
||||
|
||||
public void setOrderChildNo(String orderChildNo) { |
||||
this.orderChildNo = orderChildNo; |
||||
} |
||||
|
||||
public Integer getChannelType() { |
||||
return channelType; |
||||
} |
||||
|
||||
public void setChannelType(Integer channelType) { |
||||
this.channelType = channelType; |
||||
} |
||||
|
||||
public String getChannelOrderNo() { |
||||
return channelOrderNo; |
||||
} |
||||
|
||||
public void setChannelOrderNo(String channelOrderNo) { |
||||
this.channelOrderNo = channelOrderNo; |
||||
} |
||||
|
||||
public Long getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(Long userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public String getUserPhone() { |
||||
return userPhone; |
||||
} |
||||
|
||||
public void setUserPhone(String userPhone) { |
||||
this.userPhone = userPhone; |
||||
} |
||||
|
||||
public Integer getAgentId() { |
||||
return agentId; |
||||
} |
||||
|
||||
public void setAgentId(Integer agentId) { |
||||
this.agentId = agentId; |
||||
} |
||||
|
||||
public String getAgentName() { |
||||
return agentName; |
||||
} |
||||
|
||||
public void setAgentName(String agentName) { |
||||
this.agentName = agentName; |
||||
} |
||||
|
||||
public Long getMerId() { |
||||
return merId; |
||||
} |
||||
|
||||
public void setMerId(Long merId) { |
||||
this.merId = merId; |
||||
} |
||||
|
||||
public String getMerName() { |
||||
return merName; |
||||
} |
||||
|
||||
public void setMerName(String merName) { |
||||
this.merName = merName; |
||||
} |
||||
|
||||
public String getMerAddress() { |
||||
return merAddress; |
||||
} |
||||
|
||||
public void setMerAddress(String merAddress) { |
||||
this.merAddress = merAddress; |
||||
} |
||||
|
||||
public BigDecimal getTotalDeductionPrice() { |
||||
return totalDeductionPrice; |
||||
} |
||||
|
||||
public void setTotalDeductionPrice(BigDecimal totalDeductionPrice) { |
||||
this.totalDeductionPrice = totalDeductionPrice; |
||||
} |
||||
|
||||
public BigDecimal getDeductionCouponPrice() { |
||||
return deductionCouponPrice; |
||||
} |
||||
|
||||
public void setDeductionCouponPrice(BigDecimal deductionCouponPrice) { |
||||
this.deductionCouponPrice = deductionCouponPrice; |
||||
} |
||||
|
||||
public BigDecimal getDeductionOilPrice() { |
||||
return deductionOilPrice; |
||||
} |
||||
|
||||
public void setDeductionOilPrice(BigDecimal deductionOilPrice) { |
||||
this.deductionOilPrice = deductionOilPrice; |
||||
} |
||||
|
||||
public Integer getPayIntegral() { |
||||
return payIntegral; |
||||
} |
||||
|
||||
public void setPayIntegral(Integer payIntegral) { |
||||
this.payIntegral = payIntegral; |
||||
} |
||||
|
||||
public BigDecimal getPayablePrice() { |
||||
return payablePrice; |
||||
} |
||||
|
||||
public void setPayablePrice(BigDecimal payablePrice) { |
||||
this.payablePrice = payablePrice; |
||||
} |
||||
|
||||
public BigDecimal getActualPayPrice() { |
||||
return actualPayPrice; |
||||
} |
||||
|
||||
public void setActualPayPrice(BigDecimal actualPayPrice) { |
||||
this.actualPayPrice = actualPayPrice; |
||||
} |
||||
|
||||
public BigDecimal getGasRefuelPrice() { |
||||
return gasRefuelPrice; |
||||
} |
||||
|
||||
public void setGasRefuelPrice(BigDecimal gasRefuelPrice) { |
||||
this.gasRefuelPrice = gasRefuelPrice; |
||||
} |
||||
|
||||
public String getGasOilNo() { |
||||
return gasOilNo; |
||||
} |
||||
|
||||
public void setGasOilNo(String gasOilNo) { |
||||
this.gasOilNo = gasOilNo; |
||||
} |
||||
|
||||
public String getGasGunNo() { |
||||
return gasGunNo; |
||||
} |
||||
|
||||
public void setGasGunNo(String gasGunNo) { |
||||
this.gasGunNo = gasGunNo; |
||||
} |
||||
|
||||
public Integer getGasOilType() { |
||||
return gasOilType; |
||||
} |
||||
|
||||
public void setGasOilType(Integer gasOilType) { |
||||
this.gasOilType = gasOilType; |
||||
} |
||||
|
||||
public BigDecimal getGasPriceOfficial() { |
||||
return gasPriceOfficial; |
||||
} |
||||
|
||||
public void setGasPriceOfficial(BigDecimal gasPriceOfficial) { |
||||
this.gasPriceOfficial = gasPriceOfficial; |
||||
} |
||||
|
||||
public BigDecimal getGasPriceGun() { |
||||
return gasPriceGun; |
||||
} |
||||
|
||||
public void setGasPriceGun(BigDecimal gasPriceGun) { |
||||
this.gasPriceGun = gasPriceGun; |
||||
} |
||||
|
||||
public BigDecimal getGasPriceVip() { |
||||
return gasPriceVip; |
||||
} |
||||
|
||||
public void setGasPriceVip(BigDecimal gasPriceVip) { |
||||
this.gasPriceVip = gasPriceVip; |
||||
} |
||||
|
||||
public BigDecimal getGasPricePlatform() { |
||||
return gasPricePlatform; |
||||
} |
||||
|
||||
public void setGasPricePlatform(BigDecimal gasPricePlatform) { |
||||
this.gasPricePlatform = gasPricePlatform; |
||||
} |
||||
|
||||
public BigDecimal getGasOilLiters() { |
||||
return gasOilLiters; |
||||
} |
||||
|
||||
public void setGasOilLiters(BigDecimal gasOilLiters) { |
||||
this.gasOilLiters = gasOilLiters; |
||||
} |
||||
|
||||
public BigDecimal getGasDiscount() { |
||||
return gasDiscount; |
||||
} |
||||
|
||||
public void setGasDiscount(BigDecimal gasDiscount) { |
||||
this.gasDiscount = gasDiscount; |
||||
} |
||||
|
||||
public BigDecimal getGasOilSubsidy() { |
||||
return gasOilSubsidy; |
||||
} |
||||
|
||||
public void setGasOilSubsidy(BigDecimal gasOilSubsidy) { |
||||
this.gasOilSubsidy = gasOilSubsidy; |
||||
} |
||||
|
||||
public BigDecimal getGasLitersPreferences() { |
||||
return gasLitersPreferences; |
||||
} |
||||
|
||||
public void setGasLitersPreferences(BigDecimal gasLitersPreferences) { |
||||
this.gasLitersPreferences = gasLitersPreferences; |
||||
} |
||||
|
||||
public BigDecimal getGasPricePreferences() { |
||||
return gasPricePreferences; |
||||
} |
||||
|
||||
public void setGasPricePreferences(BigDecimal gasPricePreferences) { |
||||
this.gasPricePreferences = gasPricePreferences; |
||||
} |
||||
|
||||
public Long getGasClassGroupId() { |
||||
return gasClassGroupId; |
||||
} |
||||
|
||||
public void setGasClassGroupId(Long gasClassGroupId) { |
||||
this.gasClassGroupId = gasClassGroupId; |
||||
} |
||||
|
||||
public String getGasClassGroupName() { |
||||
return gasClassGroupName; |
||||
} |
||||
|
||||
public void setGasClassGroupName(String gasClassGroupName) { |
||||
this.gasClassGroupName = gasClassGroupName; |
||||
} |
||||
|
||||
public Long getGasClassGroupTaskId() { |
||||
return gasClassGroupTaskId; |
||||
} |
||||
|
||||
public void setGasClassGroupTaskId(Long gasClassGroupTaskId) { |
||||
this.gasClassGroupTaskId = gasClassGroupTaskId; |
||||
} |
||||
|
||||
public Long getGasStaffId() { |
||||
return gasStaffId; |
||||
} |
||||
|
||||
public void setGasStaffId(Long gasStaffId) { |
||||
this.gasStaffId = gasStaffId; |
||||
} |
||||
|
||||
public String getGasStaffName() { |
||||
return gasStaffName; |
||||
} |
||||
|
||||
public void setGasStaffName(String gasStaffName) { |
||||
this.gasStaffName = gasStaffName; |
||||
} |
||||
|
||||
public Integer getPayType() { |
||||
return payType; |
||||
} |
||||
|
||||
public void setPayType(Integer payType) { |
||||
this.payType = payType; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getCancelTime() { |
||||
return cancelTime; |
||||
} |
||||
|
||||
public void setCancelTime(Date cancelTime) { |
||||
this.cancelTime = cancelTime; |
||||
} |
||||
|
||||
public Date getPayTime() { |
||||
return payTime; |
||||
} |
||||
|
||||
public void setPayTime(Date payTime) { |
||||
this.payTime = payTime; |
||||
} |
||||
|
||||
public Date getRefundTime() { |
||||
return refundTime; |
||||
} |
||||
|
||||
public void setRefundTime(Date refundTime) { |
||||
this.refundTime = refundTime; |
||||
} |
||||
|
||||
public String getRefundRemarks() { |
||||
return refundRemarks; |
||||
} |
||||
|
||||
public void setRefundRemarks(String refundRemarks) { |
||||
this.refundRemarks = refundRemarks; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
public String getExt4() { |
||||
return ext4; |
||||
} |
||||
|
||||
public void setExt4(String ext4) { |
||||
this.ext4 = ext4; |
||||
} |
||||
|
||||
public String getExt5() { |
||||
return ext5; |
||||
} |
||||
|
||||
public void setExt5(String ext5) { |
||||
this.ext5 = ext5; |
||||
} |
||||
|
||||
public String getExt6() { |
||||
return ext6; |
||||
} |
||||
|
||||
public void setExt6(String ext6) { |
||||
this.ext6 = ext6; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsGasOrder other = (BsGasOrder) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) |
||||
&& (this.getOrderChildNo() == null ? other.getOrderChildNo() == null : this.getOrderChildNo().equals(other.getOrderChildNo())) |
||||
&& (this.getChannelType() == null ? other.getChannelType() == null : this.getChannelType().equals(other.getChannelType())) |
||||
&& (this.getChannelOrderNo() == null ? other.getChannelOrderNo() == null : this.getChannelOrderNo().equals(other.getChannelOrderNo())) |
||||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) |
||||
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) |
||||
&& (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId())) |
||||
&& (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName())) |
||||
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) |
||||
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) |
||||
&& (this.getMerAddress() == null ? other.getMerAddress() == null : this.getMerAddress().equals(other.getMerAddress())) |
||||
&& (this.getTotalDeductionPrice() == null ? other.getTotalDeductionPrice() == null : this.getTotalDeductionPrice().equals(other.getTotalDeductionPrice())) |
||||
&& (this.getDeductionCouponPrice() == null ? other.getDeductionCouponPrice() == null : this.getDeductionCouponPrice().equals(other.getDeductionCouponPrice())) |
||||
&& (this.getDeductionOilPrice() == null ? other.getDeductionOilPrice() == null : this.getDeductionOilPrice().equals(other.getDeductionOilPrice())) |
||||
&& (this.getPayIntegral() == null ? other.getPayIntegral() == null : this.getPayIntegral().equals(other.getPayIntegral())) |
||||
&& (this.getPayablePrice() == null ? other.getPayablePrice() == null : this.getPayablePrice().equals(other.getPayablePrice())) |
||||
&& (this.getActualPayPrice() == null ? other.getActualPayPrice() == null : this.getActualPayPrice().equals(other.getActualPayPrice())) |
||||
&& (this.getGasRefuelPrice() == null ? other.getGasRefuelPrice() == null : this.getGasRefuelPrice().equals(other.getGasRefuelPrice())) |
||||
&& (this.getGasOilNo() == null ? other.getGasOilNo() == null : this.getGasOilNo().equals(other.getGasOilNo())) |
||||
&& (this.getGasGunNo() == null ? other.getGasGunNo() == null : this.getGasGunNo().equals(other.getGasGunNo())) |
||||
&& (this.getGasOilType() == null ? other.getGasOilType() == null : this.getGasOilType().equals(other.getGasOilType())) |
||||
&& (this.getGasPriceOfficial() == null ? other.getGasPriceOfficial() == null : this.getGasPriceOfficial().equals(other.getGasPriceOfficial())) |
||||
&& (this.getGasPriceGun() == null ? other.getGasPriceGun() == null : this.getGasPriceGun().equals(other.getGasPriceGun())) |
||||
&& (this.getGasPriceVip() == null ? other.getGasPriceVip() == null : this.getGasPriceVip().equals(other.getGasPriceVip())) |
||||
&& (this.getGasPricePlatform() == null ? other.getGasPricePlatform() == null : this.getGasPricePlatform().equals(other.getGasPricePlatform())) |
||||
&& (this.getGasOilLiters() == null ? other.getGasOilLiters() == null : this.getGasOilLiters().equals(other.getGasOilLiters())) |
||||
&& (this.getGasDiscount() == null ? other.getGasDiscount() == null : this.getGasDiscount().equals(other.getGasDiscount())) |
||||
&& (this.getGasOilSubsidy() == null ? other.getGasOilSubsidy() == null : this.getGasOilSubsidy().equals(other.getGasOilSubsidy())) |
||||
&& (this.getGasLitersPreferences() == null ? other.getGasLitersPreferences() == null : this.getGasLitersPreferences().equals(other.getGasLitersPreferences())) |
||||
&& (this.getGasPricePreferences() == null ? other.getGasPricePreferences() == null : this.getGasPricePreferences().equals(other.getGasPricePreferences())) |
||||
&& (this.getGasClassGroupId() == null ? other.getGasClassGroupId() == null : this.getGasClassGroupId().equals(other.getGasClassGroupId())) |
||||
&& (this.getGasClassGroupName() == null ? other.getGasClassGroupName() == null : this.getGasClassGroupName().equals(other.getGasClassGroupName())) |
||||
&& (this.getGasClassGroupTaskId() == null ? other.getGasClassGroupTaskId() == null : this.getGasClassGroupTaskId().equals(other.getGasClassGroupTaskId())) |
||||
&& (this.getGasStaffId() == null ? other.getGasStaffId() == null : this.getGasStaffId().equals(other.getGasStaffId())) |
||||
&& (this.getGasStaffName() == null ? other.getGasStaffName() == null : this.getGasStaffName().equals(other.getGasStaffName())) |
||||
&& (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime())) |
||||
&& (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime())) |
||||
&& (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) |
||||
&& (this.getRefundRemarks() == null ? other.getRefundRemarks() == null : this.getRefundRemarks().equals(other.getRefundRemarks())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())) |
||||
&& (this.getExt4() == null ? other.getExt4() == null : this.getExt4().equals(other.getExt4())) |
||||
&& (this.getExt5() == null ? other.getExt5() == null : this.getExt5().equals(other.getExt5())) |
||||
&& (this.getExt6() == null ? other.getExt6() == null : this.getExt6().equals(other.getExt6())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getOrderChildNo() == null) ? 0 : getOrderChildNo().hashCode()); |
||||
result = prime * result + ((getChannelType() == null) ? 0 : getChannelType().hashCode()); |
||||
result = prime * result + ((getChannelOrderNo() == null) ? 0 : getChannelOrderNo().hashCode()); |
||||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); |
||||
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); |
||||
result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); |
||||
result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode()); |
||||
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); |
||||
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); |
||||
result = prime * result + ((getMerAddress() == null) ? 0 : getMerAddress().hashCode()); |
||||
result = prime * result + ((getTotalDeductionPrice() == null) ? 0 : getTotalDeductionPrice().hashCode()); |
||||
result = prime * result + ((getDeductionCouponPrice() == null) ? 0 : getDeductionCouponPrice().hashCode()); |
||||
result = prime * result + ((getDeductionOilPrice() == null) ? 0 : getDeductionOilPrice().hashCode()); |
||||
result = prime * result + ((getPayIntegral() == null) ? 0 : getPayIntegral().hashCode()); |
||||
result = prime * result + ((getPayablePrice() == null) ? 0 : getPayablePrice().hashCode()); |
||||
result = prime * result + ((getActualPayPrice() == null) ? 0 : getActualPayPrice().hashCode()); |
||||
result = prime * result + ((getGasRefuelPrice() == null) ? 0 : getGasRefuelPrice().hashCode()); |
||||
result = prime * result + ((getGasOilNo() == null) ? 0 : getGasOilNo().hashCode()); |
||||
result = prime * result + ((getGasGunNo() == null) ? 0 : getGasGunNo().hashCode()); |
||||
result = prime * result + ((getGasOilType() == null) ? 0 : getGasOilType().hashCode()); |
||||
result = prime * result + ((getGasPriceOfficial() == null) ? 0 : getGasPriceOfficial().hashCode()); |
||||
result = prime * result + ((getGasPriceGun() == null) ? 0 : getGasPriceGun().hashCode()); |
||||
result = prime * result + ((getGasPriceVip() == null) ? 0 : getGasPriceVip().hashCode()); |
||||
result = prime * result + ((getGasPricePlatform() == null) ? 0 : getGasPricePlatform().hashCode()); |
||||
result = prime * result + ((getGasOilLiters() == null) ? 0 : getGasOilLiters().hashCode()); |
||||
result = prime * result + ((getGasDiscount() == null) ? 0 : getGasDiscount().hashCode()); |
||||
result = prime * result + ((getGasOilSubsidy() == null) ? 0 : getGasOilSubsidy().hashCode()); |
||||
result = prime * result + ((getGasLitersPreferences() == null) ? 0 : getGasLitersPreferences().hashCode()); |
||||
result = prime * result + ((getGasPricePreferences() == null) ? 0 : getGasPricePreferences().hashCode()); |
||||
result = prime * result + ((getGasClassGroupId() == null) ? 0 : getGasClassGroupId().hashCode()); |
||||
result = prime * result + ((getGasClassGroupName() == null) ? 0 : getGasClassGroupName().hashCode()); |
||||
result = prime * result + ((getGasClassGroupTaskId() == null) ? 0 : getGasClassGroupTaskId().hashCode()); |
||||
result = prime * result + ((getGasStaffId() == null) ? 0 : getGasStaffId().hashCode()); |
||||
result = prime * result + ((getGasStaffName() == null) ? 0 : getGasStaffName().hashCode()); |
||||
result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode()); |
||||
result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode()); |
||||
result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode()); |
||||
result = prime * result + ((getRefundRemarks() == null) ? 0 : getRefundRemarks().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
result = prime * result + ((getExt4() == null) ? 0 : getExt4().hashCode()); |
||||
result = prime * result + ((getExt5() == null) ? 0 : getExt5().hashCode()); |
||||
result = prime * result + ((getExt6() == null) ? 0 : getExt6().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", orderChildNo=").append(orderChildNo); |
||||
sb.append(", channelType=").append(channelType); |
||||
sb.append(", channelOrderNo=").append(channelOrderNo); |
||||
sb.append(", userId=").append(userId); |
||||
sb.append(", userPhone=").append(userPhone); |
||||
sb.append(", agentId=").append(agentId); |
||||
sb.append(", agentName=").append(agentName); |
||||
sb.append(", merId=").append(merId); |
||||
sb.append(", merName=").append(merName); |
||||
sb.append(", merAddress=").append(merAddress); |
||||
sb.append(", totalDeductionPrice=").append(totalDeductionPrice); |
||||
sb.append(", deductionCouponPrice=").append(deductionCouponPrice); |
||||
sb.append(", deductionOilPrice=").append(deductionOilPrice); |
||||
sb.append(", payIntegral=").append(payIntegral); |
||||
sb.append(", payablePrice=").append(payablePrice); |
||||
sb.append(", actualPayPrice=").append(actualPayPrice); |
||||
sb.append(", gasRefuelPrice=").append(gasRefuelPrice); |
||||
sb.append(", gasOilNo=").append(gasOilNo); |
||||
sb.append(", gasGunNo=").append(gasGunNo); |
||||
sb.append(", gasOilType=").append(gasOilType); |
||||
sb.append(", gasPriceOfficial=").append(gasPriceOfficial); |
||||
sb.append(", gasPriceGun=").append(gasPriceGun); |
||||
sb.append(", gasPriceVip=").append(gasPriceVip); |
||||
sb.append(", gasPricePlatform=").append(gasPricePlatform); |
||||
sb.append(", gasOilLiters=").append(gasOilLiters); |
||||
sb.append(", gasDiscount=").append(gasDiscount); |
||||
sb.append(", gasOilSubsidy=").append(gasOilSubsidy); |
||||
sb.append(", gasLitersPreferences=").append(gasLitersPreferences); |
||||
sb.append(", gasPricePreferences=").append(gasPricePreferences); |
||||
sb.append(", gasClassGroupId=").append(gasClassGroupId); |
||||
sb.append(", gasClassGroupName=").append(gasClassGroupName); |
||||
sb.append(", gasClassGroupTaskId=").append(gasClassGroupTaskId); |
||||
sb.append(", gasStaffId=").append(gasStaffId); |
||||
sb.append(", gasStaffName=").append(gasStaffName); |
||||
sb.append(", payType=").append(payType); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", cancelTime=").append(cancelTime); |
||||
sb.append(", payTime=").append(payTime); |
||||
sb.append(", refundTime=").append(refundTime); |
||||
sb.append(", refundRemarks=").append(refundRemarks); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", ext4=").append(ext4); |
||||
sb.append(", ext5=").append(ext5); |
||||
sb.append(", ext6=").append(ext6); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,409 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_order |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsOrder implements Serializable { |
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 用户id |
||||
*/ |
||||
private Long userId; |
||||
|
||||
/** |
||||
* 用户名称 |
||||
*/ |
||||
private String userName; |
||||
|
||||
/** |
||||
* 用户手机号 |
||||
*/ |
||||
private String userPhone; |
||||
|
||||
/** |
||||
* 订单号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 支付渠道 1:惠支付 |
||||
*/ |
||||
private Integer payChannel; |
||||
|
||||
/** |
||||
* 支付渠道流水号 |
||||
*/ |
||||
private String payChannelOrderNo; |
||||
|
||||
/** |
||||
* 客户支付流水号 |
||||
*/ |
||||
private String paySerialNo; |
||||
|
||||
/** |
||||
* 支付方式 1:微信 2: 支付宝 3:云闪付 |
||||
*/ |
||||
private Integer payType; |
||||
|
||||
/** |
||||
* 订单总金额 |
||||
*/ |
||||
private BigDecimal totalPrice; |
||||
|
||||
/** |
||||
* 实付金额 |
||||
*/ |
||||
private BigDecimal payRealPrice; |
||||
|
||||
/** |
||||
* 商品总金额 |
||||
*/ |
||||
private BigDecimal productTotalPrice; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 支付时间 |
||||
*/ |
||||
private Date payTime; |
||||
|
||||
/** |
||||
* 完成时间 |
||||
*/ |
||||
private Date finishTime; |
||||
|
||||
/** |
||||
* 取消时间 |
||||
*/ |
||||
private Date cancelTime; |
||||
|
||||
/** |
||||
* 退款时间 |
||||
*/ |
||||
private Date refundTime; |
||||
|
||||
/** |
||||
* 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 |
||||
*/ |
||||
private Integer orderStatus; |
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
private String remarks; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(Long userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public String getUserName() { |
||||
return userName; |
||||
} |
||||
|
||||
public void setUserName(String userName) { |
||||
this.userName = userName; |
||||
} |
||||
|
||||
public String getUserPhone() { |
||||
return userPhone; |
||||
} |
||||
|
||||
public void setUserPhone(String userPhone) { |
||||
this.userPhone = userPhone; |
||||
} |
||||
|
||||
public String getOrderNo() { |
||||
return orderNo; |
||||
} |
||||
|
||||
public void setOrderNo(String orderNo) { |
||||
this.orderNo = orderNo; |
||||
} |
||||
|
||||
public Integer getPayChannel() { |
||||
return payChannel; |
||||
} |
||||
|
||||
public void setPayChannel(Integer payChannel) { |
||||
this.payChannel = payChannel; |
||||
} |
||||
|
||||
public String getPayChannelOrderNo() { |
||||
return payChannelOrderNo; |
||||
} |
||||
|
||||
public void setPayChannelOrderNo(String payChannelOrderNo) { |
||||
this.payChannelOrderNo = payChannelOrderNo; |
||||
} |
||||
|
||||
public String getPaySerialNo() { |
||||
return paySerialNo; |
||||
} |
||||
|
||||
public void setPaySerialNo(String paySerialNo) { |
||||
this.paySerialNo = paySerialNo; |
||||
} |
||||
|
||||
public Integer getPayType() { |
||||
return payType; |
||||
} |
||||
|
||||
public void setPayType(Integer payType) { |
||||
this.payType = payType; |
||||
} |
||||
|
||||
public BigDecimal getTotalPrice() { |
||||
return totalPrice; |
||||
} |
||||
|
||||
public void setTotalPrice(BigDecimal totalPrice) { |
||||
this.totalPrice = totalPrice; |
||||
} |
||||
|
||||
public BigDecimal getPayRealPrice() { |
||||
return payRealPrice; |
||||
} |
||||
|
||||
public void setPayRealPrice(BigDecimal payRealPrice) { |
||||
this.payRealPrice = payRealPrice; |
||||
} |
||||
|
||||
public BigDecimal getProductTotalPrice() { |
||||
return productTotalPrice; |
||||
} |
||||
|
||||
public void setProductTotalPrice(BigDecimal productTotalPrice) { |
||||
this.productTotalPrice = productTotalPrice; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Date getPayTime() { |
||||
return payTime; |
||||
} |
||||
|
||||
public void setPayTime(Date payTime) { |
||||
this.payTime = payTime; |
||||
} |
||||
|
||||
public Date getFinishTime() { |
||||
return finishTime; |
||||
} |
||||
|
||||
public void setFinishTime(Date finishTime) { |
||||
this.finishTime = finishTime; |
||||
} |
||||
|
||||
public Date getCancelTime() { |
||||
return cancelTime; |
||||
} |
||||
|
||||
public void setCancelTime(Date cancelTime) { |
||||
this.cancelTime = cancelTime; |
||||
} |
||||
|
||||
public Date getRefundTime() { |
||||
return refundTime; |
||||
} |
||||
|
||||
public void setRefundTime(Date refundTime) { |
||||
this.refundTime = refundTime; |
||||
} |
||||
|
||||
public Integer getOrderStatus() { |
||||
return orderStatus; |
||||
} |
||||
|
||||
public void setOrderStatus(Integer orderStatus) { |
||||
this.orderStatus = orderStatus; |
||||
} |
||||
|
||||
public String getRemarks() { |
||||
return remarks; |
||||
} |
||||
|
||||
public void setRemarks(String remarks) { |
||||
this.remarks = remarks; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsOrder other = (BsOrder) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) |
||||
&& (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName())) |
||||
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) |
||||
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) |
||||
&& (this.getPayChannel() == null ? other.getPayChannel() == null : this.getPayChannel().equals(other.getPayChannel())) |
||||
&& (this.getPayChannelOrderNo() == null ? other.getPayChannelOrderNo() == null : this.getPayChannelOrderNo().equals(other.getPayChannelOrderNo())) |
||||
&& (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo())) |
||||
&& (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType())) |
||||
&& (this.getTotalPrice() == null ? other.getTotalPrice() == null : this.getTotalPrice().equals(other.getTotalPrice())) |
||||
&& (this.getPayRealPrice() == null ? other.getPayRealPrice() == null : this.getPayRealPrice().equals(other.getPayRealPrice())) |
||||
&& (this.getProductTotalPrice() == null ? other.getProductTotalPrice() == null : this.getProductTotalPrice().equals(other.getProductTotalPrice())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime())) |
||||
&& (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) |
||||
&& (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime())) |
||||
&& (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) |
||||
&& (this.getOrderStatus() == null ? other.getOrderStatus() == null : this.getOrderStatus().equals(other.getOrderStatus())) |
||||
&& (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); |
||||
result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode()); |
||||
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getPayChannel() == null) ? 0 : getPayChannel().hashCode()); |
||||
result = prime * result + ((getPayChannelOrderNo() == null) ? 0 : getPayChannelOrderNo().hashCode()); |
||||
result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode()); |
||||
result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode()); |
||||
result = prime * result + ((getTotalPrice() == null) ? 0 : getTotalPrice().hashCode()); |
||||
result = prime * result + ((getPayRealPrice() == null) ? 0 : getPayRealPrice().hashCode()); |
||||
result = prime * result + ((getProductTotalPrice() == null) ? 0 : getProductTotalPrice().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode()); |
||||
result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode()); |
||||
result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode()); |
||||
result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode()); |
||||
result = prime * result + ((getOrderStatus() == null) ? 0 : getOrderStatus().hashCode()); |
||||
result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", userId=").append(userId); |
||||
sb.append(", userName=").append(userName); |
||||
sb.append(", userPhone=").append(userPhone); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", payChannel=").append(payChannel); |
||||
sb.append(", payChannelOrderNo=").append(payChannelOrderNo); |
||||
sb.append(", paySerialNo=").append(paySerialNo); |
||||
sb.append(", payType=").append(payType); |
||||
sb.append(", totalPrice=").append(totalPrice); |
||||
sb.append(", payRealPrice=").append(payRealPrice); |
||||
sb.append(", productTotalPrice=").append(productTotalPrice); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", payTime=").append(payTime); |
||||
sb.append(", finishTime=").append(finishTime); |
||||
sb.append(", cancelTime=").append(cancelTime); |
||||
sb.append(", refundTime=").append(refundTime); |
||||
sb.append(", orderStatus=").append(orderStatus); |
||||
sb.append(", remarks=").append(remarks); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,495 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_order_child |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsOrderChild implements Serializable { |
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 订单号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 子订单号 |
||||
*/ |
||||
private String childOrderNo; |
||||
|
||||
/** |
||||
* 产品类型 1:加油 2:商城 |
||||
*/ |
||||
private Integer productType; |
||||
|
||||
/** |
||||
* 产品id |
||||
*/ |
||||
private Long productId; |
||||
|
||||
/** |
||||
* 产品名称 |
||||
*/ |
||||
private String productName; |
||||
|
||||
/** |
||||
* 产品图片 |
||||
*/ |
||||
private String productImg; |
||||
|
||||
/** |
||||
* 产品规格id |
||||
*/ |
||||
private Long productSpecId; |
||||
|
||||
/** |
||||
* 产品规格名称 |
||||
*/ |
||||
private String productSpecName; |
||||
|
||||
/** |
||||
* 产品单价 |
||||
*/ |
||||
private BigDecimal productPrice; |
||||
|
||||
/** |
||||
* 产品实际单价 |
||||
*/ |
||||
private BigDecimal productActualPrice; |
||||
|
||||
/** |
||||
* 产品数量 |
||||
*/ |
||||
private Integer productCount; |
||||
|
||||
/** |
||||
* 产品总价(实际单价 * 数量) |
||||
*/ |
||||
private BigDecimal productTotalPrice; |
||||
|
||||
/** |
||||
* 总优惠金额(优惠券优惠金额 + 积分抵扣) |
||||
*/ |
||||
private BigDecimal totalDeductionPrice; |
||||
|
||||
/** |
||||
* 优惠券优惠金额 |
||||
*/ |
||||
private BigDecimal couponDiscountPrice; |
||||
|
||||
/** |
||||
* 积分抵扣优惠金额 |
||||
*/ |
||||
private Long integralDiscountPrice; |
||||
|
||||
/** |
||||
* 可退款数量 |
||||
*/ |
||||
private Integer surplusRefundCount; |
||||
|
||||
/** |
||||
* 可退款金额 |
||||
*/ |
||||
private BigDecimal surplusRefundPrice; |
||||
|
||||
/** |
||||
* 可退款积分金额 |
||||
*/ |
||||
private Long surplusRefundIntegral; |
||||
|
||||
/** |
||||
* 订单状态: |
||||
1. 待支付 |
||||
2. 已支付 |
||||
3. 已完成 |
||||
4. 已退款 |
||||
5. 已取消 |
||||
6. 退款中 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 结算账户key |
||||
*/ |
||||
private String settleAccount; |
||||
|
||||
/** |
||||
* 结算账户 |
||||
*/ |
||||
private String settleAccountKey; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 完成时间 |
||||
*/ |
||||
private Date finishTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getOrderNo() { |
||||
return orderNo; |
||||
} |
||||
|
||||
public void setOrderNo(String orderNo) { |
||||
this.orderNo = orderNo; |
||||
} |
||||
|
||||
public String getChildOrderNo() { |
||||
return childOrderNo; |
||||
} |
||||
|
||||
public void setChildOrderNo(String childOrderNo) { |
||||
this.childOrderNo = childOrderNo; |
||||
} |
||||
|
||||
public Integer getProductType() { |
||||
return productType; |
||||
} |
||||
|
||||
public void setProductType(Integer productType) { |
||||
this.productType = productType; |
||||
} |
||||
|
||||
public Long getProductId() { |
||||
return productId; |
||||
} |
||||
|
||||
public void setProductId(Long productId) { |
||||
this.productId = productId; |
||||
} |
||||
|
||||
public String getProductName() { |
||||
return productName; |
||||
} |
||||
|
||||
public void setProductName(String productName) { |
||||
this.productName = productName; |
||||
} |
||||
|
||||
public String getProductImg() { |
||||
return productImg; |
||||
} |
||||
|
||||
public void setProductImg(String productImg) { |
||||
this.productImg = productImg; |
||||
} |
||||
|
||||
public Long getProductSpecId() { |
||||
return productSpecId; |
||||
} |
||||
|
||||
public void setProductSpecId(Long productSpecId) { |
||||
this.productSpecId = productSpecId; |
||||
} |
||||
|
||||
public String getProductSpecName() { |
||||
return productSpecName; |
||||
} |
||||
|
||||
public void setProductSpecName(String productSpecName) { |
||||
this.productSpecName = productSpecName; |
||||
} |
||||
|
||||
public BigDecimal getProductPrice() { |
||||
return productPrice; |
||||
} |
||||
|
||||
public void setProductPrice(BigDecimal productPrice) { |
||||
this.productPrice = productPrice; |
||||
} |
||||
|
||||
public BigDecimal getProductActualPrice() { |
||||
return productActualPrice; |
||||
} |
||||
|
||||
public void setProductActualPrice(BigDecimal productActualPrice) { |
||||
this.productActualPrice = productActualPrice; |
||||
} |
||||
|
||||
public Integer getProductCount() { |
||||
return productCount; |
||||
} |
||||
|
||||
public void setProductCount(Integer productCount) { |
||||
this.productCount = productCount; |
||||
} |
||||
|
||||
public BigDecimal getProductTotalPrice() { |
||||
return productTotalPrice; |
||||
} |
||||
|
||||
public void setProductTotalPrice(BigDecimal productTotalPrice) { |
||||
this.productTotalPrice = productTotalPrice; |
||||
} |
||||
|
||||
public BigDecimal getTotalDeductionPrice() { |
||||
return totalDeductionPrice; |
||||
} |
||||
|
||||
public void setTotalDeductionPrice(BigDecimal totalDeductionPrice) { |
||||
this.totalDeductionPrice = totalDeductionPrice; |
||||
} |
||||
|
||||
public BigDecimal getCouponDiscountPrice() { |
||||
return couponDiscountPrice; |
||||
} |
||||
|
||||
public void setCouponDiscountPrice(BigDecimal couponDiscountPrice) { |
||||
this.couponDiscountPrice = couponDiscountPrice; |
||||
} |
||||
|
||||
public Long getIntegralDiscountPrice() { |
||||
return integralDiscountPrice; |
||||
} |
||||
|
||||
public void setIntegralDiscountPrice(Long integralDiscountPrice) { |
||||
this.integralDiscountPrice = integralDiscountPrice; |
||||
} |
||||
|
||||
public Integer getSurplusRefundCount() { |
||||
return surplusRefundCount; |
||||
} |
||||
|
||||
public void setSurplusRefundCount(Integer surplusRefundCount) { |
||||
this.surplusRefundCount = surplusRefundCount; |
||||
} |
||||
|
||||
public BigDecimal getSurplusRefundPrice() { |
||||
return surplusRefundPrice; |
||||
} |
||||
|
||||
public void setSurplusRefundPrice(BigDecimal surplusRefundPrice) { |
||||
this.surplusRefundPrice = surplusRefundPrice; |
||||
} |
||||
|
||||
public Long getSurplusRefundIntegral() { |
||||
return surplusRefundIntegral; |
||||
} |
||||
|
||||
public void setSurplusRefundIntegral(Long surplusRefundIntegral) { |
||||
this.surplusRefundIntegral = surplusRefundIntegral; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getSettleAccount() { |
||||
return settleAccount; |
||||
} |
||||
|
||||
public void setSettleAccount(String settleAccount) { |
||||
this.settleAccount = settleAccount; |
||||
} |
||||
|
||||
public String getSettleAccountKey() { |
||||
return settleAccountKey; |
||||
} |
||||
|
||||
public void setSettleAccountKey(String settleAccountKey) { |
||||
this.settleAccountKey = settleAccountKey; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Date getFinishTime() { |
||||
return finishTime; |
||||
} |
||||
|
||||
public void setFinishTime(Date finishTime) { |
||||
this.finishTime = finishTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsOrderChild other = (BsOrderChild) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) |
||||
&& (this.getChildOrderNo() == null ? other.getChildOrderNo() == null : this.getChildOrderNo().equals(other.getChildOrderNo())) |
||||
&& (this.getProductType() == null ? other.getProductType() == null : this.getProductType().equals(other.getProductType())) |
||||
&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId())) |
||||
&& (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName())) |
||||
&& (this.getProductImg() == null ? other.getProductImg() == null : this.getProductImg().equals(other.getProductImg())) |
||||
&& (this.getProductSpecId() == null ? other.getProductSpecId() == null : this.getProductSpecId().equals(other.getProductSpecId())) |
||||
&& (this.getProductSpecName() == null ? other.getProductSpecName() == null : this.getProductSpecName().equals(other.getProductSpecName())) |
||||
&& (this.getProductPrice() == null ? other.getProductPrice() == null : this.getProductPrice().equals(other.getProductPrice())) |
||||
&& (this.getProductActualPrice() == null ? other.getProductActualPrice() == null : this.getProductActualPrice().equals(other.getProductActualPrice())) |
||||
&& (this.getProductCount() == null ? other.getProductCount() == null : this.getProductCount().equals(other.getProductCount())) |
||||
&& (this.getProductTotalPrice() == null ? other.getProductTotalPrice() == null : this.getProductTotalPrice().equals(other.getProductTotalPrice())) |
||||
&& (this.getTotalDeductionPrice() == null ? other.getTotalDeductionPrice() == null : this.getTotalDeductionPrice().equals(other.getTotalDeductionPrice())) |
||||
&& (this.getCouponDiscountPrice() == null ? other.getCouponDiscountPrice() == null : this.getCouponDiscountPrice().equals(other.getCouponDiscountPrice())) |
||||
&& (this.getIntegralDiscountPrice() == null ? other.getIntegralDiscountPrice() == null : this.getIntegralDiscountPrice().equals(other.getIntegralDiscountPrice())) |
||||
&& (this.getSurplusRefundCount() == null ? other.getSurplusRefundCount() == null : this.getSurplusRefundCount().equals(other.getSurplusRefundCount())) |
||||
&& (this.getSurplusRefundPrice() == null ? other.getSurplusRefundPrice() == null : this.getSurplusRefundPrice().equals(other.getSurplusRefundPrice())) |
||||
&& (this.getSurplusRefundIntegral() == null ? other.getSurplusRefundIntegral() == null : this.getSurplusRefundIntegral().equals(other.getSurplusRefundIntegral())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getSettleAccount() == null ? other.getSettleAccount() == null : this.getSettleAccount().equals(other.getSettleAccount())) |
||||
&& (this.getSettleAccountKey() == null ? other.getSettleAccountKey() == null : this.getSettleAccountKey().equals(other.getSettleAccountKey())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getChildOrderNo() == null) ? 0 : getChildOrderNo().hashCode()); |
||||
result = prime * result + ((getProductType() == null) ? 0 : getProductType().hashCode()); |
||||
result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode()); |
||||
result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode()); |
||||
result = prime * result + ((getProductImg() == null) ? 0 : getProductImg().hashCode()); |
||||
result = prime * result + ((getProductSpecId() == null) ? 0 : getProductSpecId().hashCode()); |
||||
result = prime * result + ((getProductSpecName() == null) ? 0 : getProductSpecName().hashCode()); |
||||
result = prime * result + ((getProductPrice() == null) ? 0 : getProductPrice().hashCode()); |
||||
result = prime * result + ((getProductActualPrice() == null) ? 0 : getProductActualPrice().hashCode()); |
||||
result = prime * result + ((getProductCount() == null) ? 0 : getProductCount().hashCode()); |
||||
result = prime * result + ((getProductTotalPrice() == null) ? 0 : getProductTotalPrice().hashCode()); |
||||
result = prime * result + ((getTotalDeductionPrice() == null) ? 0 : getTotalDeductionPrice().hashCode()); |
||||
result = prime * result + ((getCouponDiscountPrice() == null) ? 0 : getCouponDiscountPrice().hashCode()); |
||||
result = prime * result + ((getIntegralDiscountPrice() == null) ? 0 : getIntegralDiscountPrice().hashCode()); |
||||
result = prime * result + ((getSurplusRefundCount() == null) ? 0 : getSurplusRefundCount().hashCode()); |
||||
result = prime * result + ((getSurplusRefundPrice() == null) ? 0 : getSurplusRefundPrice().hashCode()); |
||||
result = prime * result + ((getSurplusRefundIntegral() == null) ? 0 : getSurplusRefundIntegral().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getSettleAccount() == null) ? 0 : getSettleAccount().hashCode()); |
||||
result = prime * result + ((getSettleAccountKey() == null) ? 0 : getSettleAccountKey().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", childOrderNo=").append(childOrderNo); |
||||
sb.append(", productType=").append(productType); |
||||
sb.append(", productId=").append(productId); |
||||
sb.append(", productName=").append(productName); |
||||
sb.append(", productImg=").append(productImg); |
||||
sb.append(", productSpecId=").append(productSpecId); |
||||
sb.append(", productSpecName=").append(productSpecName); |
||||
sb.append(", productPrice=").append(productPrice); |
||||
sb.append(", productActualPrice=").append(productActualPrice); |
||||
sb.append(", productCount=").append(productCount); |
||||
sb.append(", productTotalPrice=").append(productTotalPrice); |
||||
sb.append(", totalDeductionPrice=").append(totalDeductionPrice); |
||||
sb.append(", couponDiscountPrice=").append(couponDiscountPrice); |
||||
sb.append(", integralDiscountPrice=").append(integralDiscountPrice); |
||||
sb.append(", surplusRefundCount=").append(surplusRefundCount); |
||||
sb.append(", surplusRefundPrice=").append(surplusRefundPrice); |
||||
sb.append(", surplusRefundIntegral=").append(surplusRefundIntegral); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", settleAccount=").append(settleAccount); |
||||
sb.append(", settleAccountKey=").append(settleAccountKey); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", finishTime=").append(finishTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,248 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* bs_order_deduction |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsOrderDeduction implements Serializable { |
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 订单id |
||||
*/ |
||||
private Long orderId; |
||||
|
||||
/** |
||||
* 订单号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 总优惠金额(优惠券实际优惠金额 + 积分抵扣) |
||||
*/ |
||||
private BigDecimal totalDeductionPrice; |
||||
|
||||
/** |
||||
* 用户优惠券id |
||||
*/ |
||||
private Long userCouponDiscountId; |
||||
|
||||
/** |
||||
* 优惠券id |
||||
*/ |
||||
private Long couponDiscountId; |
||||
|
||||
/** |
||||
* 优惠券类型 |
||||
*/ |
||||
private Integer couponDiscountType; |
||||
|
||||
/** |
||||
* 优惠券优惠金额 |
||||
*/ |
||||
private BigDecimal couponDiscountPrice; |
||||
|
||||
/** |
||||
* 优惠券实际优惠金额 |
||||
*/ |
||||
private BigDecimal couponDiscountActualPrice; |
||||
|
||||
/** |
||||
* 积分抵扣数量 |
||||
*/ |
||||
private Long integralDiscountPrice; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getOrderId() { |
||||
return orderId; |
||||
} |
||||
|
||||
public void setOrderId(Long orderId) { |
||||
this.orderId = orderId; |
||||
} |
||||
|
||||
public String getOrderNo() { |
||||
return orderNo; |
||||
} |
||||
|
||||
public void setOrderNo(String orderNo) { |
||||
this.orderNo = orderNo; |
||||
} |
||||
|
||||
public BigDecimal getTotalDeductionPrice() { |
||||
return totalDeductionPrice; |
||||
} |
||||
|
||||
public void setTotalDeductionPrice(BigDecimal totalDeductionPrice) { |
||||
this.totalDeductionPrice = totalDeductionPrice; |
||||
} |
||||
|
||||
public Long getUserCouponDiscountId() { |
||||
return userCouponDiscountId; |
||||
} |
||||
|
||||
public void setUserCouponDiscountId(Long userCouponDiscountId) { |
||||
this.userCouponDiscountId = userCouponDiscountId; |
||||
} |
||||
|
||||
public Long getCouponDiscountId() { |
||||
return couponDiscountId; |
||||
} |
||||
|
||||
public void setCouponDiscountId(Long couponDiscountId) { |
||||
this.couponDiscountId = couponDiscountId; |
||||
} |
||||
|
||||
public Integer getCouponDiscountType() { |
||||
return couponDiscountType; |
||||
} |
||||
|
||||
public void setCouponDiscountType(Integer couponDiscountType) { |
||||
this.couponDiscountType = couponDiscountType; |
||||
} |
||||
|
||||
public BigDecimal getCouponDiscountPrice() { |
||||
return couponDiscountPrice; |
||||
} |
||||
|
||||
public void setCouponDiscountPrice(BigDecimal couponDiscountPrice) { |
||||
this.couponDiscountPrice = couponDiscountPrice; |
||||
} |
||||
|
||||
public BigDecimal getCouponDiscountActualPrice() { |
||||
return couponDiscountActualPrice; |
||||
} |
||||
|
||||
public void setCouponDiscountActualPrice(BigDecimal couponDiscountActualPrice) { |
||||
this.couponDiscountActualPrice = couponDiscountActualPrice; |
||||
} |
||||
|
||||
public Long getIntegralDiscountPrice() { |
||||
return integralDiscountPrice; |
||||
} |
||||
|
||||
public void setIntegralDiscountPrice(Long integralDiscountPrice) { |
||||
this.integralDiscountPrice = integralDiscountPrice; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsOrderDeduction other = (BsOrderDeduction) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId())) |
||||
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) |
||||
&& (this.getTotalDeductionPrice() == null ? other.getTotalDeductionPrice() == null : this.getTotalDeductionPrice().equals(other.getTotalDeductionPrice())) |
||||
&& (this.getUserCouponDiscountId() == null ? other.getUserCouponDiscountId() == null : this.getUserCouponDiscountId().equals(other.getUserCouponDiscountId())) |
||||
&& (this.getCouponDiscountId() == null ? other.getCouponDiscountId() == null : this.getCouponDiscountId().equals(other.getCouponDiscountId())) |
||||
&& (this.getCouponDiscountType() == null ? other.getCouponDiscountType() == null : this.getCouponDiscountType().equals(other.getCouponDiscountType())) |
||||
&& (this.getCouponDiscountPrice() == null ? other.getCouponDiscountPrice() == null : this.getCouponDiscountPrice().equals(other.getCouponDiscountPrice())) |
||||
&& (this.getCouponDiscountActualPrice() == null ? other.getCouponDiscountActualPrice() == null : this.getCouponDiscountActualPrice().equals(other.getCouponDiscountActualPrice())) |
||||
&& (this.getIntegralDiscountPrice() == null ? other.getIntegralDiscountPrice() == null : this.getIntegralDiscountPrice().equals(other.getIntegralDiscountPrice())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getTotalDeductionPrice() == null) ? 0 : getTotalDeductionPrice().hashCode()); |
||||
result = prime * result + ((getUserCouponDiscountId() == null) ? 0 : getUserCouponDiscountId().hashCode()); |
||||
result = prime * result + ((getCouponDiscountId() == null) ? 0 : getCouponDiscountId().hashCode()); |
||||
result = prime * result + ((getCouponDiscountType() == null) ? 0 : getCouponDiscountType().hashCode()); |
||||
result = prime * result + ((getCouponDiscountPrice() == null) ? 0 : getCouponDiscountPrice().hashCode()); |
||||
result = prime * result + ((getCouponDiscountActualPrice() == null) ? 0 : getCouponDiscountActualPrice().hashCode()); |
||||
result = prime * result + ((getIntegralDiscountPrice() == null) ? 0 : getIntegralDiscountPrice().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", orderId=").append(orderId); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", totalDeductionPrice=").append(totalDeductionPrice); |
||||
sb.append(", userCouponDiscountId=").append(userCouponDiscountId); |
||||
sb.append(", couponDiscountId=").append(couponDiscountId); |
||||
sb.append(", couponDiscountType=").append(couponDiscountType); |
||||
sb.append(", couponDiscountPrice=").append(couponDiscountPrice); |
||||
sb.append(", couponDiscountActualPrice=").append(couponDiscountActualPrice); |
||||
sb.append(", integralDiscountPrice=").append(integralDiscountPrice); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,27 @@ |
||||
package com.hfkj.model.order; |
||||
|
||||
import com.hfkj.entity.BsOrderChild; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* 子订单模型 |
||||
* @className: OrderChildModel |
||||
* @author: HuRui |
||||
* @date: 2024/4/29 |
||||
**/ |
||||
@Data |
||||
public class OrderChildModel extends BsOrderChild { |
||||
|
||||
/** |
||||
* 油站加油员 |
||||
*/ |
||||
private String gasStaffCode; |
||||
/** |
||||
* 油站油号 |
||||
*/ |
||||
private String gasOilNo; |
||||
/** |
||||
* 油站抢号 |
||||
*/ |
||||
private String gasGunNo; |
||||
} |
@ -0,0 +1,27 @@ |
||||
package com.hfkj.model.order; |
||||
|
||||
import com.hfkj.entity.BsOrder; |
||||
import com.hfkj.entity.BsOrderDeduction; |
||||
import lombok.Data; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 交易订单模型 |
||||
* @className: OrderModel |
||||
* @author: HuRui |
||||
* @date: 2024/4/29 |
||||
**/ |
||||
@Data |
||||
public class OrderModel extends BsOrder { |
||||
|
||||
/** |
||||
* 优惠 |
||||
*/ |
||||
private BsOrderDeduction deduction; |
||||
|
||||
/** |
||||
* 子订单列表 |
||||
*/ |
||||
private List<OrderChildModel> orderChildList; |
||||
|
||||
} |
@ -0,0 +1,28 @@ |
||||
package com.hfkj.mqtopic; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 订单主题 |
||||
* @author hurui |
||||
*/ |
||||
@Getter |
||||
public enum OrderTopic { |
||||
// 订单主题
|
||||
ORDER_TOPIC("order-topic", "订单主题"), |
||||
// 订单取消
|
||||
ORDER_TOPIC_CANCEL(ORDER_TOPIC.getTopic() + ":cancel", "订单取消"), |
||||
// 订单退款成功业务
|
||||
ORDER_TOPIC_REFUND_SUCCESS(ORDER_TOPIC.getTopic() + ":refund-success", "订单退款成功业务"), |
||||
// 订单分账业务
|
||||
ORDER_TOPIC_PROFIT_SHARING(ORDER_TOPIC.getTopic() + ":profit-sharing", "订单分账业务"), |
||||
; |
||||
|
||||
private String topic; |
||||
private String name; |
||||
|
||||
OrderTopic(String topic, String name) { |
||||
this.topic = topic; |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,50 @@ |
||||
package com.hfkj.service.gas; |
||||
|
||||
import com.hfkj.entity.BsGasOrder; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 加油订单 |
||||
* @className: HighGasOrderService |
||||
* @author: HuRui |
||||
* @date: 2022/9/6 |
||||
**/ |
||||
public interface BsGasOrderService { |
||||
|
||||
/** |
||||
* 增加订单 |
||||
* @param gasOrder |
||||
*/ |
||||
void addGasOrder(BsGasOrder gasOrder); |
||||
|
||||
/** |
||||
* 修改订单 |
||||
* @param gasOrder |
||||
*/ |
||||
void updateGasOrder(BsGasOrder gasOrder); |
||||
|
||||
/** |
||||
* 根据子订单编号获取详情 |
||||
* @param orderChildNo 商品编号 |
||||
* @return |
||||
*/ |
||||
BsGasOrder getDetailByOrderChildNo(String orderChildNo); |
||||
|
||||
/** |
||||
* 查询交易订单号获取详情 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
BsGasOrder getDetailByOrderNo(String orderNo); |
||||
|
||||
/** |
||||
* 查询油站订单列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsGasOrder> getGasOrderList(Map<String, Object> param); |
||||
|
||||
|
||||
} |
@ -0,0 +1,142 @@ |
||||
package com.hfkj.service.gas.impl; |
||||
|
||||
import com.hfkj.dao.BsGasOrderMapper; |
||||
import com.hfkj.entity.BsGasOrder; |
||||
import com.hfkj.entity.BsGasOrderExample; |
||||
import com.hfkj.service.gas.BsGasOrderService; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Arrays; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.util.stream.IntStream; |
||||
|
||||
/** |
||||
* @className: HighGasOrderServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2022/9/6 |
||||
**/ |
||||
@Service("gasOrderService") |
||||
public class BsGasOrderServiceImpl implements BsGasOrderService { |
||||
|
||||
@Resource |
||||
private BsGasOrderMapper gasOrderMapper; |
||||
|
||||
@Override |
||||
public void addGasOrder(BsGasOrder gasOrder) { |
||||
gasOrder.setCreateTime(new Date()); |
||||
gasOrderMapper.insert(gasOrder); |
||||
} |
||||
|
||||
@Override |
||||
public void updateGasOrder(BsGasOrder gasOrder) { |
||||
gasOrderMapper.updateByPrimaryKeySelective(gasOrder); |
||||
} |
||||
|
||||
@Override |
||||
public BsGasOrder getDetailByOrderChildNo(String orderChildNo) { |
||||
BsGasOrderExample example = new BsGasOrderExample(); |
||||
example.createCriteria().andOrderChildNoEqualTo(orderChildNo); |
||||
List<BsGasOrder> list = gasOrderMapper.selectByExample(example); |
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsGasOrder getDetailByOrderNo(String orderNo) { |
||||
BsGasOrderExample example = new BsGasOrderExample(); |
||||
example.createCriteria().andOrderNoEqualTo(orderNo); |
||||
List<BsGasOrder> list = gasOrderMapper.selectByExample(example); |
||||
if (list.size() > 0) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public List<BsGasOrder> getGasOrderList(Map<String, Object> param) { |
||||
BsGasOrderExample example = new BsGasOrderExample(); |
||||
BsGasOrderExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
if (MapUtils.getLong(param, "merId") != null) { |
||||
criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "merName"))) { |
||||
criteria.andMerNameLike("%"+MapUtils.getString(param, "merName")+"%"); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "gasStaffId") != null) { |
||||
criteria.andGasStaffIdEqualTo(MapUtils.getLong(param, "gasStaffId")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "orderNo"))) { |
||||
criteria.andOrderNoLike("%"+MapUtils.getString(param, "orderNo")+"%"); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "orderChildNo"))) { |
||||
criteria.andOrderChildNoLike("%"+MapUtils.getString(param, "orderChildNo")+"%"); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "userPhone"))) { |
||||
criteria.andUserPhoneLike("%"+MapUtils.getString(param, "userPhone")+"%"); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "gasOilType") != null) { |
||||
criteria.andGasOilTypeEqualTo(MapUtils.getInteger(param, "gasOilType")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "gasStaffName"))) { |
||||
criteria.andGasStaffNameLike("%"+MapUtils.getString(param, "gasStaffName")+"%"); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "gasOilNo"))) { |
||||
criteria.andGasOilNoEqualTo(MapUtils.getString(param, "gasOilNo")); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "payType") != null) { |
||||
criteria.andPayTypeEqualTo(MapUtils.getInteger(param, "payType")); |
||||
} |
||||
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "status"))) { |
||||
List<Integer> status = Arrays.stream(MapUtils.getString(param, "status").split(",")) |
||||
.flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed() |
||||
.collect(Collectors.toList()); |
||||
criteria.andStatusIn(status); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "createTimeS") != null) { |
||||
criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeS"))); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "createTimeE") != null) { |
||||
criteria.andCreateTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeE"))); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "payTimeS") != null) { |
||||
criteria.andPayTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "payTimeS"))); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "payTimeE") != null) { |
||||
criteria.andPayTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "payTimeE"))); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "refundTimeS") != null) { |
||||
criteria.andRefundTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "refundTimeS"))); |
||||
} |
||||
|
||||
if (MapUtils.getLong(param, "refundTimeE") != null) { |
||||
criteria.andRefundTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "refundTimeE"))); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return gasOrderMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,42 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.entity.BsOrderChild; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsOrderChildService |
||||
* @author: HuRui |
||||
* @date: 2024/5/6 |
||||
**/ |
||||
public interface BsOrderChildService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param data |
||||
*/ |
||||
void editData(BsOrderChild data); |
||||
|
||||
/** |
||||
* 查询详情 |
||||
* @param childOrderNo 子订单号 |
||||
* @return |
||||
*/ |
||||
OrderChildModel getDetail(String childOrderNo); |
||||
|
||||
/** |
||||
* 查询子订单 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
List<OrderChildModel> getOrderChildListByOrderNo(String orderNo); |
||||
|
||||
/** |
||||
* 获取未完成的子订单数量 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
long getUndoneChildOrder(String orderNo); |
||||
|
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.entity.BsOrderDeduction; |
||||
|
||||
/** |
||||
* @className: BsOrderDeductionService |
||||
* @author: HuRui |
||||
* @date: 2024/4/30 |
||||
**/ |
||||
public interface BsOrderDeductionService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param data |
||||
*/ |
||||
BsOrderDeduction editData(BsOrderDeduction data); |
||||
|
||||
/** |
||||
* 查询交易优惠 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
BsOrderDeduction getOrderDeduction(String orderNo); |
||||
} |
@ -0,0 +1,85 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.entity.BsOrder; |
||||
import com.hfkj.model.order.OrderModel; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsOrderService |
||||
* @author: HuRui |
||||
* @date: 2024/4/29 |
||||
**/ |
||||
public interface BsOrderService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param order |
||||
* @return |
||||
*/ |
||||
BsOrder editData(BsOrder order); |
||||
|
||||
/** |
||||
* 更新缓存 |
||||
* @param order |
||||
* @return |
||||
*/ |
||||
OrderModel cache(OrderModel order); |
||||
|
||||
/** |
||||
* 删除缓存 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
void cacheDelete(String orderNo); |
||||
|
||||
/** |
||||
* 创建订单 |
||||
* @param order 订单 |
||||
* @return |
||||
*/ |
||||
OrderModel create(OrderModel order) throws Exception; |
||||
|
||||
/** |
||||
* 取消订单 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
OrderModel cancel(String orderNo); |
||||
|
||||
/** |
||||
* 子订单完成 |
||||
* @param childOrderNo |
||||
*/ |
||||
void childOrderComplete(String childOrderNo); |
||||
|
||||
/** |
||||
* 支付成功业务 |
||||
* @param order |
||||
*/ |
||||
void orderPaySuccessHandle(OrderModel order); |
||||
|
||||
/** |
||||
* 查询订单 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
BsOrder getOrder(String orderNo); |
||||
|
||||
/** |
||||
* 查询订单详情 |
||||
* @param orderNo 交易单号 |
||||
* @return |
||||
*/ |
||||
OrderModel getDetail(String orderNo); |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsOrder> getOrderList(Map<String,Object> param); |
||||
|
||||
|
||||
} |
@ -0,0 +1,68 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.common.utils.RedisUtil; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.model.order.OrderModel; |
||||
import com.hfkj.service.gas.BsGasOrderService; |
||||
import com.hfkj.sysenum.gas.OrderOilStatus; |
||||
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Component; |
||||
import org.springframework.transaction.annotation.Isolation; |
||||
import org.springframework.transaction.annotation.Propagation; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* 取消订单业务 |
||||
* @className: OrderCancelService |
||||
* @author: HuRui |
||||
* @date: 2024/5/7 |
||||
**/ |
||||
@Component |
||||
public class OrderCancelService { |
||||
Logger log = LoggerFactory.getLogger(OrderCancelService.class); |
||||
@Autowired |
||||
private RedisUtil redisUtil; |
||||
@Resource |
||||
private BsOrderService orderService; |
||||
@Resource |
||||
private BsOrderChildService orderChildService; |
||||
@Resource |
||||
private BsGasOrderService gasOrderService; |
||||
/** |
||||
* 订单业务处理 |
||||
* @param order |
||||
* @throws Exception |
||||
*/ |
||||
@Transactional(propagation = Propagation.NOT_SUPPORTED, isolation = Isolation.READ_UNCOMMITTED) |
||||
public void orderBusHandle(OrderModel order) { |
||||
for (OrderChildModel childOrder : order.getOrderChildList()) { |
||||
if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { |
||||
oilHandle(childOrder.getChildOrderNo()); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 加油业务 |
||||
* @param orderChildNo |
||||
* @return |
||||
*/ |
||||
public void oilHandle(String orderChildNo) { |
||||
// 查询加油订单
|
||||
BsGasOrder gasOrder = gasOrderService.getDetailByOrderChildNo(orderChildNo); |
||||
if (gasOrder != null) { |
||||
gasOrder.setStatus(OrderOilStatus.STATUS3.getNumber()); |
||||
gasOrder.setCancelTime(new Date()); |
||||
gasOrderService.updateGasOrder(gasOrder); |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,133 @@ |
||||
package com.hfkj.service.order; |
||||
|
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.security.AESEncodeUtil; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.model.GasPayPriceModel; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.service.BsMerchantService; |
||||
import com.hfkj.service.gas.BsGasClassGroupTaskService; |
||||
import com.hfkj.service.gas.BsGasOrderService; |
||||
import com.hfkj.service.gas.BsGasService; |
||||
import com.hfkj.service.gas.BsGasStaffService; |
||||
import com.hfkj.service.sec.SecDictionaryService; |
||||
import com.hfkj.sysenum.MerchantStatusEnum; |
||||
import com.hfkj.sysenum.gas.OrderOilStatus; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* 创建订单业务 |
||||
* @className: OrderCreateService |
||||
* @author: HuRui |
||||
* @date: 2024/6/7 |
||||
**/ |
||||
@Component |
||||
public class OrderCreateService { |
||||
Logger log = LoggerFactory.getLogger(OrderCreateService.class); |
||||
|
||||
@Resource |
||||
private BsMerchantService merchantService; |
||||
@Resource |
||||
private SecDictionaryService secDictionaryService; |
||||
@Resource |
||||
private BsGasService gasService; |
||||
@Resource |
||||
private BsGasOrderService gasOrderService; |
||||
@Resource |
||||
private BsGasClassGroupTaskService gasClassGroupTaskService; |
||||
@Resource |
||||
private BsGasStaffService gasStaffService; |
||||
|
||||
public OrderChildModel oilHandle(BsOrder order, BsOrderDeduction orderDeduction, OrderChildModel orderChild) { |
||||
// 查询油品类型
|
||||
SecDictionary gasOilType = secDictionaryService.getDictionary("OIL_NO", orderChild.getGasOilNo()); |
||||
if (gasOilType == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知油品类型"); |
||||
} |
||||
// 查询油站
|
||||
BsMerchant merchant = merchantService.getMerchant(orderChild.getProductId()); |
||||
if (merchant == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站"); |
||||
} |
||||
if (!merchant.getStatus().equals(MerchantStatusEnum.status1.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前油站暂停交易"); |
||||
} |
||||
// 计算价格
|
||||
GasPayPriceModel priceModel = gasService.refuelPriceCompute(orderChild.getProductPrice(), merchant.getMerNo(), orderChild.getGasOilNo(),false); |
||||
|
||||
BsGasOrder gasOrder = new BsGasOrder(); |
||||
gasOrder.setChannelType(merchant.getSourceType()); |
||||
gasOrder.setOrderNo(orderChild.getOrderNo()); |
||||
gasOrder.setOrderChildNo(orderChild.getChildOrderNo()); |
||||
gasOrder.setUserId(order.getUserId()); |
||||
gasOrder.setUserPhone(order.getUserPhone()); |
||||
gasOrder.setMerId(merchant.getId()); |
||||
gasOrder.setMerName(merchant.getMerName()); |
||||
gasOrder.setMerAddress(merchant.getAddress()); |
||||
gasOrder.setStatus(OrderOilStatus.STATUS1.getNumber()); |
||||
|
||||
// 油价信息
|
||||
gasOrder.setGasRefuelPrice(orderChild.getProductPrice()); |
||||
gasOrder.setGasOilNo(orderChild.getGasOilNo()); |
||||
gasOrder.setGasGunNo(orderChild.getGasGunNo()); |
||||
gasOrder.setGasOilType(Integer.parseInt(gasOilType.getExt1())); |
||||
gasOrder.setGasPriceGun(priceModel.getPriceGun()); |
||||
gasOrder.setGasPriceVip(priceModel.getPriceVip()); |
||||
gasOrder.setGasPriceOfficial(priceModel.getPriceOfficial()); |
||||
gasOrder.setGasPricePlatform(priceModel.getPricePlatform()); |
||||
gasOrder.setGasOilLiters(priceModel.getOilLiters()); |
||||
gasOrder.setGasDiscount(priceModel.getDiscount()); |
||||
gasOrder.setGasOilSubsidy(priceModel.getPreferentialMargin()); |
||||
gasOrder.setGasLitersPreferences(priceModel.getLitersPreferences()); |
||||
gasOrder.setGasPricePreferences(priceModel.getPricePreferences()); |
||||
|
||||
// 加油员
|
||||
if (StringUtils.isNotBlank(orderChild.getGasStaffCode())) { |
||||
String staffId; |
||||
try { |
||||
staffId = AESEncodeUtil.aesDecrypt(orderChild.getGasStaffCode()); |
||||
} catch (Exception e) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "收银员code解析失败"); |
||||
} |
||||
if (staffId == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知加油员"); |
||||
} |
||||
// 查询员工
|
||||
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(Long.parseLong(staffId)); |
||||
if (gasStaff == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知加油员"); |
||||
} |
||||
if (gasStaff.getMerId().equals(merchant.getId())) { |
||||
gasOrder.setGasStaffId(gasStaff.getId()); |
||||
gasOrder.setGasStaffName(gasStaff.getName()); |
||||
} |
||||
} |
||||
|
||||
// 油站是否开启班组
|
||||
BsGasClassGroupTask groupTask = gasClassGroupTaskService.getCurrentTaskByMerId(merchant.getId()); |
||||
if (groupTask != null) { |
||||
gasOrder.setGasClassGroupId(groupTask.getGasClassGroupId()); |
||||
gasOrder.setGasClassGroupName(groupTask.getGasClassGroupName()); |
||||
gasOrder.setGasClassGroupTaskId(groupTask.getId()); |
||||
} |
||||
|
||||
gasOrderService.addGasOrder(gasOrder); |
||||
|
||||
orderChild.setProductName(merchant.getMerName()); |
||||
orderChild.setProductImg(merchant.getMerLogo()); |
||||
orderChild.setProductSpecName("默认"); |
||||
orderChild.setProductCount(1); |
||||
orderChild.setProductActualPrice(gasOrder.getPayablePrice()); |
||||
orderChild.setProductTotalPrice(new BigDecimal(orderChild.getProductPrice().toString()).multiply(orderChild.getProductPrice())); |
||||
return orderChild; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,74 @@ |
||||
package com.hfkj.service.order.impl; |
||||
|
||||
import com.hfkj.dao.BsOrderChildMapper; |
||||
import com.hfkj.entity.BsOrderChild; |
||||
import com.hfkj.entity.BsOrderChildExample; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.service.order.BsOrderChildService; |
||||
import com.hfkj.sysenum.order.OrderChildStatusEnum; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsOrderChildServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/5/6 |
||||
**/ |
||||
@Service("orderChildService") |
||||
public class BsOrderChildServiceImpl implements BsOrderChildService { |
||||
@Resource |
||||
private BsOrderChildMapper orderChildMapper; |
||||
|
||||
@Override |
||||
public void editData(BsOrderChild data) { |
||||
data.setUpdateTime(new Date()); |
||||
if (data.getId() == null) { |
||||
data.setCreateTime(new Date()); |
||||
orderChildMapper.insert(data); |
||||
} else { |
||||
orderChildMapper.updateByPrimaryKey(data); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public OrderChildModel getDetail(String childOrderNo) { |
||||
BsOrderChildExample example = new BsOrderChildExample(); |
||||
example.createCriteria().andChildOrderNoEqualTo(childOrderNo); |
||||
List<BsOrderChild> list = orderChildMapper.selectByExample(example); |
||||
if (!list.isEmpty()) { |
||||
OrderChildModel childModel = new OrderChildModel(); |
||||
BeanUtils.copyProperties(list.get(0), childModel); |
||||
return childModel; |
||||
} |
||||
return null; |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public List<OrderChildModel> getOrderChildListByOrderNo(String orderNo) { |
||||
BsOrderChildExample example = new BsOrderChildExample(); |
||||
example.createCriteria().andOrderNoEqualTo(orderNo); |
||||
example.setOrderByClause("id"); |
||||
List<BsOrderChild> list = orderChildMapper.selectByExample(example); |
||||
List<OrderChildModel> orderChildModelList = new ArrayList<>(); |
||||
for (BsOrderChild orderChild : list) { |
||||
OrderChildModel childModel = new OrderChildModel(); |
||||
BeanUtils.copyProperties(orderChild, childModel); |
||||
orderChildModelList.add(childModel); |
||||
} |
||||
return orderChildModelList; |
||||
} |
||||
|
||||
@Override |
||||
public long getUndoneChildOrder(String orderNo) { |
||||
BsOrderChildExample example = new BsOrderChildExample(); |
||||
example.createCriteria().andOrderNoEqualTo(orderNo).andStatusNotEqualTo(OrderChildStatusEnum.status3.getCode()); |
||||
return orderChildMapper.countByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,43 @@ |
||||
package com.hfkj.service.order.impl; |
||||
|
||||
import com.hfkj.dao.BsOrderDeductionMapper; |
||||
import com.hfkj.entity.BsOrderDeduction; |
||||
import com.hfkj.entity.BsOrderDeductionExample; |
||||
import com.hfkj.service.order.BsOrderDeductionService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsOrderDeductionServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/4/30 |
||||
**/ |
||||
@Service("orderDeductionService") |
||||
public class BsOrderDeductionServiceImpl implements BsOrderDeductionService { |
||||
|
||||
@Resource |
||||
private BsOrderDeductionMapper orderDeductionMapper; |
||||
|
||||
@Override |
||||
public BsOrderDeduction editData(BsOrderDeduction data) { |
||||
if (data.getId() == null) { |
||||
orderDeductionMapper.insert(data); |
||||
} else { |
||||
orderDeductionMapper.updateByPrimaryKey(data); |
||||
} |
||||
return data; |
||||
} |
||||
|
||||
@Override |
||||
public BsOrderDeduction getOrderDeduction(String orderNo) { |
||||
BsOrderDeductionExample example = new BsOrderDeductionExample(); |
||||
example.createCriteria().andOrderNoEqualTo(orderNo); |
||||
List<BsOrderDeduction> list = orderDeductionMapper.selectByExample(example); |
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,449 @@ |
||||
package com.hfkj.service.order.impl; |
||||
|
||||
import com.hfkj.common.exception.BaseException; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.DateUtil; |
||||
import com.hfkj.common.utils.RandomUtils; |
||||
import com.hfkj.common.utils.RedisUtil; |
||||
import com.hfkj.dao.BsOrderMapper; |
||||
import com.hfkj.entity.BsOrder; |
||||
import com.hfkj.entity.BsOrderChild; |
||||
import com.hfkj.entity.BsOrderDeduction; |
||||
import com.hfkj.entity.BsOrderExample; |
||||
import com.hfkj.model.order.OrderChildModel; |
||||
import com.hfkj.model.order.OrderModel; |
||||
import com.hfkj.mqtopic.OrderTopic; |
||||
import com.hfkj.service.order.*; |
||||
import com.hfkj.sysenum.order.OrderChildProductTypeEnum; |
||||
import com.hfkj.sysenum.order.OrderChildStatusEnum; |
||||
import com.hfkj.sysenum.order.OrderStatusEnum; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.messaging.Message; |
||||
import org.springframework.messaging.support.MessageBuilder; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Isolation; |
||||
import org.springframework.transaction.annotation.Propagation; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @className: BsOrderServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2024/4/29 |
||||
**/ |
||||
@Service("orderService") |
||||
public class BsOrderServiceImpl implements BsOrderService { |
||||
// 缓存前缀KEY
|
||||
public final static String CACHE_KEY = "ORDER:"; |
||||
// 订单缓存时间 7天
|
||||
public final static Integer CACHE_TIME = 60*60*24*7; |
||||
|
||||
@Autowired |
||||
private RedisUtil redisUtil; |
||||
@Resource |
||||
private RocketMQTemplate rocketMQTemplate; |
||||
@Autowired |
||||
private RedisTemplate redisTemplate; |
||||
@Resource |
||||
private BsOrderMapper orderMapper; |
||||
@Resource |
||||
private BsOrderChildService orderChildService; |
||||
@Resource |
||||
private BsOrderDeductionService orderDeductionService; |
||||
@Resource |
||||
private OrderCreateService orderCreateService; |
||||
@Resource |
||||
private OrderCancelService orderCancelService; |
||||
public BsOrder editData(BsOrder order) { |
||||
order.setUpdateTime(new Date()); |
||||
if (order.getId() == null) { |
||||
order.setCreateTime(new Date()); |
||||
orderMapper.insert(order); |
||||
} else { |
||||
orderMapper.updateByPrimaryKey(order); |
||||
} |
||||
return order; |
||||
} |
||||
|
||||
@Override |
||||
public OrderModel cache(OrderModel order) { |
||||
// 缓存
|
||||
redisUtil.set(CACHE_KEY + order.getOrderNo(), order, CACHE_TIME); |
||||
return order; |
||||
} |
||||
|
||||
@Override |
||||
public void cacheDelete(String orderNo) { |
||||
// 缓存
|
||||
redisUtil.del(CACHE_KEY + orderNo); |
||||
} |
||||
|
||||
@Override |
||||
@Transactional( |
||||
propagation= Propagation.REQUIRES_NEW, |
||||
isolation = Isolation.READ_COMMITTED, |
||||
timeout = 20, |
||||
rollbackFor = Exception.class) |
||||
public OrderModel create(OrderModel order) throws Exception { |
||||
// 生成交易单号,共18位,时间 + 6位随机数
|
||||
order.setOrderNo(DateUtil.date2String(new Date(), "yyMMddHHmmss") + RandomUtils.number(6, false)); |
||||
editData(order); |
||||
|
||||
// 订单总金额
|
||||
BigDecimal totalPrice = new BigDecimal("0"); |
||||
// 商品总金额
|
||||
BigDecimal productTotalPrice = new BigDecimal("0"); |
||||
|
||||
/************** 处理业务 ***************/ |
||||
for (OrderChildModel child : order.getOrderChildList()) { |
||||
child.setOrderNo(order.getOrderNo()); |
||||
// 子订单号 交易id + 4位随机数
|
||||
child.setChildOrderNo(order.getId()+RandomUtils.number(4, false)); |
||||
// 提交订单前业务处理
|
||||
if (child.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { |
||||
child = orderCreateService.oilHandle(order, null, child); |
||||
} |
||||
child.setProductTotalPrice(child.getProductPrice().multiply(new BigDecimal(child.getProductCount().toString()))); |
||||
child.setStatus(OrderChildStatusEnum.status1.getCode()); |
||||
|
||||
productTotalPrice = productTotalPrice.add(child.getProductTotalPrice()); |
||||
} |
||||
|
||||
totalPrice = productTotalPrice; |
||||
order.setTotalPrice(totalPrice); |
||||
order.setProductTotalPrice(productTotalPrice); |
||||
|
||||
/************ 交易优惠 **************/ |
||||
BsOrderDeduction deduction = new BsOrderDeduction(); |
||||
deduction.setOrderId(order.getId()); |
||||
deduction.setOrderNo(order.getOrderNo()); |
||||
deduction.setTotalDeductionPrice(new BigDecimal("0")); |
||||
deduction.setCouponDiscountPrice(new BigDecimal("0")); |
||||
deduction.setCouponDiscountActualPrice(new BigDecimal("0")); |
||||
deduction.setIntegralDiscountPrice(0L); |
||||
order.setDeduction(deduction); |
||||
/* BsOrderDeduction deduction = order.getDeduction()==null?new BsOrderDeduction():order.getDeduction(); |
||||
deduction.setOrderId(order.getId()); |
||||
deduction.setOrderNo(order.getOrderNo()); |
||||
deduction.setIntegralDiscountPrice(deduction.getIntegralDiscountPrice()==null?0L: deduction.getIntegralDiscountPrice()); |
||||
if (deduction.getUserCouponDiscountId() != null) { |
||||
// 使用优惠券
|
||||
useDeduction(order, deduction, order.getDeduction().getUserCouponDiscountId()); |
||||
// 使用优惠券限制
|
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("discountId", deduction.getCouponDiscountId()); |
||||
List<CouponDiscountGoodsRel> couponDiscountGoodsRelList = couponDiscountService.getListGoodsRel(param); |
||||
for(OrderChildModel orderChild : order.getOrderChildList()) { |
||||
List<CouponDiscountGoodsRel> collect = couponDiscountGoodsRelList.stream() |
||||
.filter(o -> o.getSpecsId() != null && o.getSpecsId().equals(o.getSpecsId())).collect(Collectors.toList()); |
||||
if (collect.isEmpty()) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, orderChild.getProductName()+"【"+orderChild.getProductSpecName()+"】"+"无法使用此优惠券"); |
||||
} |
||||
} |
||||
|
||||
} else { |
||||
deduction.setCouponDiscountPrice(new BigDecimal("0")); |
||||
deduction.setCouponDiscountActualPrice(new BigDecimal("0")); |
||||
} |
||||
// 优惠券优惠金额 + 积分抵扣实际金额
|
||||
deduction.setTotalDeductionPrice(deduction.getCouponDiscountActualPrice() |
||||
.add(new BigDecimal(deduction.getIntegralDiscountPrice().toString()).divide(new BigDecimal("100")))); |
||||
orderDeductionService.editData(deduction); |
||||
order.setDeduction(deduction); |
||||
|
||||
// 使用积分抵扣
|
||||
if (order.getDeduction().getIntegralDiscountPrice() > 0) { |
||||
Map<String,Object> opUser = new HashMap<>(); |
||||
opUser.put("opUserType", UserIntegralRecordOpUserTypeEnum.type3.getCode()); |
||||
opUser.put("opUserId", order.getUserId()); |
||||
opUser.put("opUserName", order.getUserName()); |
||||
opUser.put("opUserPhone", order.getUserPhone()); |
||||
|
||||
Map<String,Object> source = new HashMap<>(); |
||||
source.put("sourceType", UserIntegralRecordSourceTypeEnum.type1.getCode()); |
||||
source.put("sourceId", order.getId()); |
||||
source.put("sourceOrderNo", order.getOrderNo()); |
||||
source.put("sourceContent", "交易积分抵扣"); |
||||
|
||||
// 扣除用户积分
|
||||
userIntegralService.consume( |
||||
order.getUserId(), |
||||
order.getDeduction().getIntegralDiscountPrice(), |
||||
opUser, |
||||
source |
||||
); |
||||
}*/ |
||||
/************ 交易优惠 **************/ |
||||
|
||||
BigDecimal payRealPrice = totalPrice.subtract(order.getDeduction().getTotalDeductionPrice()); |
||||
order.setPayRealPrice(payRealPrice.compareTo(new BigDecimal("0")) > 0 ? payRealPrice : new BigDecimal("0")); |
||||
order.setOrderStatus(order.getPayRealPrice().compareTo(new BigDecimal("0")) == 0?OrderStatusEnum.status2.getCode():OrderStatusEnum.status1.getCode()); |
||||
// 订单入库前处理
|
||||
for (OrderChildModel childOrder : order.getOrderChildList()) { |
||||
childOrder.setSurplusRefundCount(childOrder.getProductCount()); |
||||
|
||||
// 计算 子订单 在交易订单金额中的占比
|
||||
BigDecimal ratio = childOrder.getProductTotalPrice().divide(order.getTotalPrice(), 2, BigDecimal.ROUND_DOWN); |
||||
|
||||
// 计算子订单退款积分
|
||||
if (order.getDeduction().getIntegralDiscountPrice() > 0) { |
||||
childOrder.setSurplusRefundIntegral(new BigDecimal(order.getDeduction().getIntegralDiscountPrice().toString()).multiply(ratio).setScale(2).longValue()); |
||||
} else { |
||||
childOrder.setSurplusRefundIntegral(0L); |
||||
} |
||||
|
||||
if (order.getDeduction().getCouponDiscountActualPrice().compareTo(BigDecimal.ZERO) == 1) { |
||||
// 计算子订单退款金额。
|
||||
if (order.getPayRealPrice().compareTo(BigDecimal.ZERO) == 1) { |
||||
// 计算实付金额中的占比
|
||||
childOrder.setSurplusRefundPrice(order.getPayRealPrice().multiply(ratio).setScale(2, BigDecimal.ROUND_DOWN)); |
||||
} else { |
||||
childOrder.setSurplusRefundPrice(new BigDecimal("0")); |
||||
} |
||||
} else { |
||||
childOrder.setSurplusRefundPrice( |
||||
// 商品总金额 - 积分抵扣金额
|
||||
childOrder.getProductTotalPrice().subtract( |
||||
new BigDecimal(childOrder.getSurplusRefundIntegral().toString()).divide(new BigDecimal("100")) |
||||
)); |
||||
} |
||||
|
||||
childOrder.setIntegralDiscountPrice(childOrder.getSurplusRefundIntegral()); |
||||
childOrder.setCouponDiscountPrice( |
||||
// 可退款金额大于0 可退款金额+可退款积分=优惠券优惠
|
||||
childOrder.getSurplusRefundPrice().compareTo(BigDecimal.ZERO) == 1 |
||||
? childOrder.getProductTotalPrice().subtract( |
||||
childOrder.getSurplusRefundPrice().add(new BigDecimal(childOrder.getSurplusRefundIntegral().toString()).divide(new BigDecimal("100")))) |
||||
: childOrder.getSurplusRefundPrice()); |
||||
|
||||
childOrder.setTotalDeductionPrice( |
||||
childOrder.getCouponDiscountPrice() |
||||
.add(new BigDecimal(childOrder.getIntegralDiscountPrice().toString()).divide(new BigDecimal("100"))) |
||||
); |
||||
childOrder.setProductActualPrice(childOrder.getProductTotalPrice().subtract(childOrder.getTotalDeductionPrice())); |
||||
orderChildService.editData(childOrder); |
||||
} |
||||
// 订单入库
|
||||
editData(order); |
||||
|
||||
if (order.getOrderStatus().equals(OrderStatusEnum.status1.getCode())) { |
||||
// 10分钟内未支付,自动取消订单
|
||||
Message<OrderModel> rocketMsg = MessageBuilder.withPayload(order).build(); |
||||
rocketMQTemplate.syncSend(OrderTopic.ORDER_TOPIC_CANCEL.getTopic(), rocketMsg,1000,14); |
||||
|
||||
} else if (order.getOrderStatus().equals(OrderStatusEnum.status2.getCode())) { |
||||
// 支付校验
|
||||
//orderPayBeforeService.payOrderCheck(order);
|
||||
// 处理业务
|
||||
orderPaySuccessHandle(order); |
||||
} |
||||
// 更新缓存
|
||||
cache(order); |
||||
return order; |
||||
} |
||||
|
||||
@Override |
||||
@Transactional(propagation= Propagation.REQUIRES_NEW, rollbackFor= {RuntimeException.class}, timeout = 10) |
||||
public OrderModel cancel(String orderNo) { |
||||
// 查询订单
|
||||
OrderModel order = getDetail(orderNo); |
||||
if (order == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单"); |
||||
} |
||||
if (!order.getOrderStatus().equals(OrderStatusEnum.status1.getCode())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法取消,订单不处于待支付状态"); |
||||
} |
||||
order.setOrderStatus(OrderStatusEnum.status5.getCode()); |
||||
order.setCancelTime(new Date()); |
||||
editData(order); |
||||
|
||||
for (BsOrderChild orderChild : order.getOrderChildList()) { |
||||
orderChild.setStatus(OrderChildStatusEnum.status5.getCode()); |
||||
orderChildService.editData(orderChild); |
||||
} |
||||
|
||||
/* // 退回优惠券
|
||||
if (order.getDeduction().getUserCouponDiscountId() != null) { |
||||
// 查询用户优惠券
|
||||
CouponDiscountUserRel discountUserRel = couponDiscountUserRelService.getRel(order.getDeduction().getUserCouponDiscountId()); |
||||
if (discountUserRel == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知优惠券"); |
||||
} |
||||
discountUserRel.setStatus(1); |
||||
discountUserRel.setUseTime(null); |
||||
couponDiscountUserRelService.update(discountUserRel); |
||||
} |
||||
|
||||
// 退款用户积分
|
||||
if (order.getDeduction().getIntegralDiscountPrice() > 0) { |
||||
Map<String,Object> opUser = new HashMap<>(); |
||||
if (system) { |
||||
opUser.put("opUserType", UserIntegralRecordOpUserTypeEnum.type1.getCode()); |
||||
opUser.put("opUserId", 0); |
||||
opUser.put("opUserName", UserIntegralRecordOpUserTypeEnum.type1.getName()); |
||||
} else { |
||||
opUser.put("opUserType", UserIntegralRecordOpUserTypeEnum.type3.getCode()); |
||||
opUser.put("opUserId", order.getUserId()); |
||||
opUser.put("opUserName", order.getUserName()); |
||||
opUser.put("opUserPhone", order.getUserPhone()); |
||||
} |
||||
Map<String,Object> source = new HashMap<>(); |
||||
source.put("sourceType", UserIntegralRecordSourceTypeEnum.type1.getCode()); |
||||
source.put("sourceId", order.getId()); |
||||
source.put("sourceOrderNo", order.getOrderNo()); |
||||
source.put("sourceContent", "交易取消!退回积分"); |
||||
|
||||
// 扣除用户积分
|
||||
userIntegralService.entry( |
||||
order.getUserId(), |
||||
order.getDeduction().getIntegralDiscountPrice(), |
||||
opUser, |
||||
source |
||||
); |
||||
}*/ |
||||
|
||||
// 取消订单业务
|
||||
orderCancelService.orderBusHandle(order); |
||||
|
||||
// 更新缓存
|
||||
cache(order); |
||||
return order; |
||||
} |
||||
|
||||
@Override |
||||
public void childOrderComplete(String childOrderNo) { |
||||
BsOrderChild orderChild = orderChildService.getDetail(childOrderNo); |
||||
if (orderChild == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
// 删除缓存
|
||||
cacheDelete(orderChild.getOrderNo()); |
||||
|
||||
orderChild.setFinishTime(new Date()); |
||||
orderChild.setStatus(OrderChildStatusEnum.status3.getCode()); |
||||
orderChildService.editData(orderChild); |
||||
|
||||
// 查询未完成的子订单数量
|
||||
long count = orderChildService.getUndoneChildOrder(orderChild.getOrderNo()); |
||||
if (count == 0) { |
||||
BsOrder order = getOrder(orderChild.getOrderNo()); |
||||
if (order != null) { |
||||
order.setOrderStatus(OrderStatusEnum.status3.getCode()); |
||||
order.setFinishTime(new Date()); |
||||
editData(order); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void orderPaySuccessHandle(OrderModel order) { |
||||
order.setPayTime(order.getPayTime()==null?new Date():order.getPayTime()); |
||||
order.setOrderStatus(OrderStatusEnum.status2.getCode()); |
||||
editData(order); |
||||
|
||||
for (BsOrderChild childOrder : order.getOrderChildList()) { |
||||
childOrder.setStatus(OrderChildStatusEnum.status2.getCode()); |
||||
orderChildService.editData(childOrder); |
||||
} |
||||
// 删除缓存
|
||||
cacheDelete(order.getOrderNo()); |
||||
// 处理业务
|
||||
// orderPaySuccessService.orderBusHandle(order);
|
||||
} |
||||
|
||||
@Override |
||||
public BsOrder getOrder(String orderNo) { |
||||
BsOrderExample example = new BsOrderExample(); |
||||
example.createCriteria().andOrderNoEqualTo(orderNo); |
||||
List<BsOrder> list = orderMapper.selectByExample(example); |
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public OrderModel getDetail(String orderNo) { |
||||
// 获取缓存
|
||||
Object cacheObj = redisUtil.get(CACHE_KEY + orderNo); |
||||
if (cacheObj != null) { |
||||
return (OrderModel) cacheObj; |
||||
} |
||||
OrderModel orderModel = new OrderModel(); |
||||
BeanUtils.copyProperties(getOrder(orderNo), orderModel); |
||||
// 优惠
|
||||
orderModel.setDeduction(orderDeductionService.getOrderDeduction(orderNo)); |
||||
// 子订单
|
||||
orderModel.setOrderChildList(orderChildService.getOrderChildListByOrderNo(orderNo)); |
||||
// 更新缓存
|
||||
cache(orderModel); |
||||
return orderModel; |
||||
} |
||||
|
||||
@Override |
||||
public List<BsOrder> getOrderList(Map<String, Object> param) { |
||||
BsOrderExample example = new BsOrderExample(); |
||||
BsOrderExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
if (MapUtils.getLong(param, "userId") != null) { |
||||
criteria.andUserIdEqualTo(MapUtils.getLong(param, "userId")); |
||||
} |
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "orderNo"))) { |
||||
criteria.andOrderNoLike("%"+MapUtils.getString(param, "orderNo")+"%"); |
||||
} |
||||
if (StringUtils.isNotBlank(MapUtils.getString(param, "userPhone"))) { |
||||
criteria.andUserPhoneLike("%"+MapUtils.getString(param, "userPhone")+"%"); |
||||
} |
||||
if (MapUtils.getInteger(param, "payChannel") != null) { |
||||
criteria.andPayChannelEqualTo(MapUtils.getInteger(param, "payChannel")); |
||||
} |
||||
if (MapUtils.getInteger(param, "payType") != null) { |
||||
criteria.andPayTypeEqualTo(MapUtils.getInteger(param, "payType")); |
||||
} |
||||
if (MapUtils.getInteger(param, "orderStatus") != null) { |
||||
criteria.andOrderStatusEqualTo(MapUtils.getInteger(param, "orderStatus")); |
||||
} |
||||
if (MapUtils.getLong(param, "createTimeS") != null) { |
||||
criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeS"))); |
||||
} |
||||
if (MapUtils.getLong(param, "createTimeE") != null) { |
||||
criteria.andCreateTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeE"))); |
||||
} |
||||
if (MapUtils.getLong(param, "payTimeS") != null) { |
||||
criteria.andPayTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "payTimeS"))); |
||||
} |
||||
if (MapUtils.getLong(param, "payTimeE") != null) { |
||||
criteria.andPayTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "payTimeE"))); |
||||
} |
||||
if (MapUtils.getLong(param, "finishTimeS") != null) { |
||||
criteria.andFinishTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "finishTimeS"))); |
||||
} |
||||
if (MapUtils.getLong(param, "finishTimeE") != null) { |
||||
criteria.andFinishTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "finishTimeE"))); |
||||
} |
||||
if (MapUtils.getLong(param, "cancelTimeS") != null) { |
||||
criteria.andCancelTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "cancelTimeS"))); |
||||
} |
||||
if (MapUtils.getLong(param, "cancelTimeE") != null) { |
||||
criteria.andCancelTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "cancelTimeE"))); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return orderMapper.selectByExample(example); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,62 @@ |
||||
package com.hfkj.sysenum.gas; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @className: OrderOilStatus |
||||
* @author: HuRui |
||||
* @date: 2023/6/7 |
||||
**/ |
||||
public enum OrderOilStatus { |
||||
STATUS1(1, "待支付"), |
||||
STATUS2(2, "已支付"), |
||||
STATUS3(3, "已取消"), |
||||
STATUS4(4, "已退款"), |
||||
STATUS6(5, "退款中"), |
||||
STATUS8(6, "退款失败"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
OrderOilStatus(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
/** |
||||
* 根据类型查询数据 |
||||
* @param type |
||||
* @return |
||||
*/ |
||||
public static OrderOilStatus getDataByType(Integer type) { |
||||
for (OrderOilStatus ele : values()) { |
||||
if(Objects.equals(type,ele.getNumber())) return ele; |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public static String getNameByType(Integer type) { |
||||
for (OrderOilStatus ele : values()) { |
||||
if(Objects.equals(type,ele.getNumber())) return ele.getName(); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,45 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
/** |
||||
* @className: OrderChildProductType |
||||
* @author: HuRui |
||||
* @date: 2024/4/30 |
||||
**/ |
||||
public enum OrderChildProductTypeEnum { |
||||
/** |
||||
* 加油 |
||||
*/ |
||||
type1(1, "加油"), |
||||
/** |
||||
* 商城 |
||||
*/ |
||||
type2(2, "商城"), |
||||
; |
||||
|
||||
private int code; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
OrderChildProductTypeEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
|
||||
public int getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public void setCode(int code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,52 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* @className: OrderChildStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2024/5/6 |
||||
**/ |
||||
@Getter |
||||
public enum OrderChildStatusEnum { |
||||
/** |
||||
* 待支付 |
||||
*/ |
||||
status1(1, "待支付"), |
||||
|
||||
/** |
||||
* 已支付 |
||||
*/ |
||||
status2(2, "已支付"), |
||||
|
||||
/** |
||||
* 已完成 |
||||
*/ |
||||
status3(3, "已完成"), |
||||
|
||||
/** |
||||
* 已退款 |
||||
*/ |
||||
status4(4, "已退款"), |
||||
|
||||
/** |
||||
* 已取消 |
||||
*/ |
||||
status5(5, "已取消"), |
||||
|
||||
/** |
||||
* 退款中 |
||||
*/ |
||||
status6(6, "退款中"), |
||||
; |
||||
|
||||
private final int code; |
||||
|
||||
private final String name; |
||||
|
||||
|
||||
OrderChildStatusEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 交易支付渠道 |
||||
* @className: OrderPayModelEnum |
||||
* @author: HuRui |
||||
* @date: 2024/5/7 |
||||
**/ |
||||
@Getter |
||||
public enum OrderPayChannelEnum { |
||||
/** |
||||
* 惠支付 |
||||
*/ |
||||
type1(1, "惠支付"), |
||||
/** |
||||
* 微信合作商 |
||||
*/ |
||||
type2(2, "微信合作商"), |
||||
/** |
||||
* 贵州银行 |
||||
*/ |
||||
type3(3, "贵州银行"), |
||||
/** |
||||
* 汇联通 |
||||
*/ |
||||
type4(4, "汇联通"), |
||||
; |
||||
|
||||
private final int code; |
||||
|
||||
private final String name; |
||||
|
||||
OrderPayChannelEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 交易支付类型 |
||||
* @className: OrderPayModelEnum |
||||
* @author: HuRui |
||||
* @date: 2024/5/7 |
||||
**/ |
||||
@Getter |
||||
public enum OrderPayTypeEnum { |
||||
/** |
||||
* 微信 |
||||
*/ |
||||
type1(1, "微信"), |
||||
/** |
||||
* 支付宝 |
||||
*/ |
||||
type2(2, "支付宝"), |
||||
/** |
||||
* 快捷支付 |
||||
*/ |
||||
type3(3, "快捷支付"), |
||||
/** |
||||
* 工会卡 |
||||
*/ |
||||
type4(4, "工会卡"), |
||||
; |
||||
|
||||
private final int code; |
||||
|
||||
private final String name; |
||||
|
||||
OrderPayTypeEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,34 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* @className: OrderRefundStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2024/5/14 |
||||
**/ |
||||
@Getter |
||||
public enum OrderRefundStatusEnum { |
||||
/** |
||||
* 退款中 |
||||
*/ |
||||
status1(1, "退款中"), |
||||
/** |
||||
* 退款成功 |
||||
*/ |
||||
status2(2, "退款成功"), |
||||
/** |
||||
* 退款失败 |
||||
*/ |
||||
status3(3, "退款失败"), |
||||
; |
||||
|
||||
private final int code; |
||||
|
||||
private final String name; |
||||
|
||||
OrderRefundStatusEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
} |
@ -0,0 +1,48 @@ |
||||
package com.hfkj.sysenum.order; |
||||
|
||||
import lombok.Getter; |
||||
|
||||
/** |
||||
* 交易订单状态 |
||||
* @className: OrderChildProductType |
||||
* @author: HuRui |
||||
* @date: 2024/4/30 |
||||
**/ |
||||
@Getter |
||||
public enum OrderStatusEnum { |
||||
/** |
||||
* 待支付 |
||||
*/ |
||||
status1(1, "待支付"), |
||||
|
||||
/** |
||||
* 已支付 |
||||
*/ |
||||
status2(2, "已支付"), |
||||
|
||||
/** |
||||
* 已完成 |
||||
*/ |
||||
status3(3, "已完成"), |
||||
|
||||
/** |
||||
* 已退款 |
||||
*/ |
||||
status4(4, "已退款"), |
||||
|
||||
/** |
||||
* 已取消 |
||||
*/ |
||||
status5(5, "已取消"), |
||||
; |
||||
|
||||
private final int code; |
||||
|
||||
private final String name; |
||||
|
||||
|
||||
OrderStatusEnum(int code, String name) { |
||||
this.code = code; |
||||
this.name = name; |
||||
} |
||||
} |
Loading…
Reference in new issue