dev-discount
parent
3ac8d40ed9
commit
b124eb007e
@ -0,0 +1,198 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighOrderRefund; |
||||
import com.hai.entity.HighOrderRefundExample; |
||||
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 HighOrderRefundMapper extends HighOrderRefundMapperExt { |
||||
@SelectProvider(type=HighOrderRefundSqlProvider.class, method="countByExample") |
||||
long countByExample(HighOrderRefundExample example); |
||||
|
||||
@DeleteProvider(type=HighOrderRefundSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(HighOrderRefundExample example); |
||||
|
||||
@Delete({ |
||||
"delete from high_order_refund", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into high_order_refund (order_id, order_no, ", |
||||
"order_child_id, order_child_no, ", |
||||
"mem_id, mem_name, mem_phone, ", |
||||
"goods_type, goods_id, ", |
||||
"goods_name, goods_desc, ", |
||||
"goods_img, goods_spec_name, ", |
||||
"goods_count, refund_order, ", |
||||
"return_total_price, refund_price, ", |
||||
"refund_gold, refund_remark, ", |
||||
"refund_status, refund_fail_reason, ", |
||||
"create_time, update_time, ", |
||||
"ext_1, ext_2, ext_3, ", |
||||
"ext_4, ext_5, ext_6)", |
||||
"values (#{orderId,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, ", |
||||
"#{orderChildId,jdbcType=BIGINT}, #{orderChildNo,jdbcType=VARCHAR}, ", |
||||
"#{memId,jdbcType=BIGINT}, #{memName,jdbcType=VARCHAR}, #{memPhone,jdbcType=VARCHAR}, ", |
||||
"#{goodsType,jdbcType=INTEGER}, #{goodsId,jdbcType=BIGINT}, ", |
||||
"#{goodsName,jdbcType=VARCHAR}, #{goodsDesc,jdbcType=VARCHAR}, ", |
||||
"#{goodsImg,jdbcType=VARCHAR}, #{goodsSpecName,jdbcType=VARCHAR}, ", |
||||
"#{goodsCount,jdbcType=INTEGER}, #{refundOrder,jdbcType=VARCHAR}, ", |
||||
"#{returnTotalPrice,jdbcType=DECIMAL}, #{refundPrice,jdbcType=DECIMAL}, ", |
||||
"#{refundGold,jdbcType=INTEGER}, #{refundRemark,jdbcType=VARCHAR}, ", |
||||
"#{refundStatus,jdbcType=INTEGER}, #{refundFailReason,jdbcType=VARCHAR}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", |
||||
"#{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(HighOrderRefund record); |
||||
|
||||
@InsertProvider(type=HighOrderRefundSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(HighOrderRefund record); |
||||
|
||||
@SelectProvider(type=HighOrderRefundSqlProvider.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="order_child_id", property="orderChildId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mem_id", property="memId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mem_name", property="memName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mem_phone", property="memPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_type", property="goodsType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="goods_name", property="goodsName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_desc", property="goodsDesc", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_img", property="goodsImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_spec_name", property="goodsSpecName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_count", property="goodsCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="refund_order", property="refundOrder", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="return_total_price", property="returnTotalPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="refund_gold", property="refundGold", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="refund_remark", property="refundRemark", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="refund_status", property="refundStatus", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="refund_fail_reason", property="refundFailReason", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", 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), |
||||
@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<HighOrderRefund> selectByExample(HighOrderRefundExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, order_id, order_no, order_child_id, order_child_no, mem_id, mem_name, mem_phone, ", |
||||
"goods_type, goods_id, goods_name, goods_desc, goods_img, goods_spec_name, goods_count, ", |
||||
"refund_order, return_total_price, refund_price, refund_gold, refund_remark, ", |
||||
"refund_status, refund_fail_reason, create_time, update_time, ext_1, ext_2, ext_3, ", |
||||
"ext_4, ext_5, ext_6", |
||||
"from high_order_refund", |
||||
"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="order_child_id", property="orderChildId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mem_id", property="memId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mem_name", property="memName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mem_phone", property="memPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_type", property="goodsType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="goods_name", property="goodsName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_desc", property="goodsDesc", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_img", property="goodsImg", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_spec_name", property="goodsSpecName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="goods_count", property="goodsCount", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="refund_order", property="refundOrder", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="return_total_price", property="returnTotalPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="refund_gold", property="refundGold", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="refund_remark", property="refundRemark", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="refund_status", property="refundStatus", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="refund_fail_reason", property="refundFailReason", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", 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), |
||||
@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) |
||||
}) |
||||
HighOrderRefund selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=HighOrderRefundSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") HighOrderRefund record, @Param("example") HighOrderRefundExample example); |
||||
|
||||
@UpdateProvider(type=HighOrderRefundSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") HighOrderRefund record, @Param("example") HighOrderRefundExample example); |
||||
|
||||
@UpdateProvider(type=HighOrderRefundSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(HighOrderRefund record); |
||||
|
||||
@Update({ |
||||
"update high_order_refund", |
||||
"set order_id = #{orderId,jdbcType=BIGINT},", |
||||
"order_no = #{orderNo,jdbcType=VARCHAR},", |
||||
"order_child_id = #{orderChildId,jdbcType=BIGINT},", |
||||
"order_child_no = #{orderChildNo,jdbcType=VARCHAR},", |
||||
"mem_id = #{memId,jdbcType=BIGINT},", |
||||
"mem_name = #{memName,jdbcType=VARCHAR},", |
||||
"mem_phone = #{memPhone,jdbcType=VARCHAR},", |
||||
"goods_type = #{goodsType,jdbcType=INTEGER},", |
||||
"goods_id = #{goodsId,jdbcType=BIGINT},", |
||||
"goods_name = #{goodsName,jdbcType=VARCHAR},", |
||||
"goods_desc = #{goodsDesc,jdbcType=VARCHAR},", |
||||
"goods_img = #{goodsImg,jdbcType=VARCHAR},", |
||||
"goods_spec_name = #{goodsSpecName,jdbcType=VARCHAR},", |
||||
"goods_count = #{goodsCount,jdbcType=INTEGER},", |
||||
"refund_order = #{refundOrder,jdbcType=VARCHAR},", |
||||
"return_total_price = #{returnTotalPrice,jdbcType=DECIMAL},", |
||||
"refund_price = #{refundPrice,jdbcType=DECIMAL},", |
||||
"refund_gold = #{refundGold,jdbcType=INTEGER},", |
||||
"refund_remark = #{refundRemark,jdbcType=VARCHAR},", |
||||
"refund_status = #{refundStatus,jdbcType=INTEGER},", |
||||
"refund_fail_reason = #{refundFailReason,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"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(HighOrderRefund record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hai.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface HighOrderRefundMapperExt { |
||||
} |
@ -0,0 +1,584 @@ |
||||
package com.hai.dao; |
||||
|
||||
import com.hai.entity.HighOrderRefund; |
||||
import com.hai.entity.HighOrderRefundExample.Criteria; |
||||
import com.hai.entity.HighOrderRefundExample.Criterion; |
||||
import com.hai.entity.HighOrderRefundExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class HighOrderRefundSqlProvider { |
||||
|
||||
public String countByExample(HighOrderRefundExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("high_order_refund"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(HighOrderRefundExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("high_order_refund"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(HighOrderRefund record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("high_order_refund"); |
||||
|
||||
if (record.getOrderId() != null) { |
||||
sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderChildId() != null) { |
||||
sql.VALUES("order_child_id", "#{orderChildId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderChildNo() != null) { |
||||
sql.VALUES("order_child_no", "#{orderChildNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMemId() != null) { |
||||
sql.VALUES("mem_id", "#{memId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMemName() != null) { |
||||
sql.VALUES("mem_name", "#{memName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMemPhone() != null) { |
||||
sql.VALUES("mem_phone", "#{memPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsType() != null) { |
||||
sql.VALUES("goods_type", "#{goodsType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getGoodsId() != null) { |
||||
sql.VALUES("goods_id", "#{goodsId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGoodsName() != null) { |
||||
sql.VALUES("goods_name", "#{goodsName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsDesc() != null) { |
||||
sql.VALUES("goods_desc", "#{goodsDesc,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsImg() != null) { |
||||
sql.VALUES("goods_img", "#{goodsImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsSpecName() != null) { |
||||
sql.VALUES("goods_spec_name", "#{goodsSpecName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsCount() != null) { |
||||
sql.VALUES("goods_count", "#{goodsCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRefundOrder() != null) { |
||||
sql.VALUES("refund_order", "#{refundOrder,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReturnTotalPrice() != null) { |
||||
sql.VALUES("return_total_price", "#{returnTotalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRefundPrice() != null) { |
||||
sql.VALUES("refund_price", "#{refundPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRefundGold() != null) { |
||||
sql.VALUES("refund_gold", "#{refundGold,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRefundRemark() != null) { |
||||
sql.VALUES("refund_remark", "#{refundRemark,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRefundStatus() != null) { |
||||
sql.VALUES("refund_status", "#{refundStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRefundFailReason() != null) { |
||||
sql.VALUES("refund_fail_reason", "#{refundFailReason,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.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(HighOrderRefundExample 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("order_child_id"); |
||||
sql.SELECT("order_child_no"); |
||||
sql.SELECT("mem_id"); |
||||
sql.SELECT("mem_name"); |
||||
sql.SELECT("mem_phone"); |
||||
sql.SELECT("goods_type"); |
||||
sql.SELECT("goods_id"); |
||||
sql.SELECT("goods_name"); |
||||
sql.SELECT("goods_desc"); |
||||
sql.SELECT("goods_img"); |
||||
sql.SELECT("goods_spec_name"); |
||||
sql.SELECT("goods_count"); |
||||
sql.SELECT("refund_order"); |
||||
sql.SELECT("return_total_price"); |
||||
sql.SELECT("refund_price"); |
||||
sql.SELECT("refund_gold"); |
||||
sql.SELECT("refund_remark"); |
||||
sql.SELECT("refund_status"); |
||||
sql.SELECT("refund_fail_reason"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
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("high_order_refund"); |
||||
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) { |
||||
HighOrderRefund record = (HighOrderRefund) parameter.get("record"); |
||||
HighOrderRefundExample example = (HighOrderRefundExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_order_refund"); |
||||
|
||||
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.getOrderChildId() != null) { |
||||
sql.SET("order_child_id = #{record.orderChildId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderChildNo() != null) { |
||||
sql.SET("order_child_no = #{record.orderChildNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMemId() != null) { |
||||
sql.SET("mem_id = #{record.memId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMemName() != null) { |
||||
sql.SET("mem_name = #{record.memName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMemPhone() != null) { |
||||
sql.SET("mem_phone = #{record.memPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsType() != null) { |
||||
sql.SET("goods_type = #{record.goodsType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getGoodsId() != null) { |
||||
sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGoodsName() != null) { |
||||
sql.SET("goods_name = #{record.goodsName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsDesc() != null) { |
||||
sql.SET("goods_desc = #{record.goodsDesc,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsImg() != null) { |
||||
sql.SET("goods_img = #{record.goodsImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsSpecName() != null) { |
||||
sql.SET("goods_spec_name = #{record.goodsSpecName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsCount() != null) { |
||||
sql.SET("goods_count = #{record.goodsCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRefundOrder() != null) { |
||||
sql.SET("refund_order = #{record.refundOrder,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReturnTotalPrice() != null) { |
||||
sql.SET("return_total_price = #{record.returnTotalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRefundPrice() != null) { |
||||
sql.SET("refund_price = #{record.refundPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRefundGold() != null) { |
||||
sql.SET("refund_gold = #{record.refundGold,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRefundRemark() != null) { |
||||
sql.SET("refund_remark = #{record.refundRemark,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRefundStatus() != null) { |
||||
sql.SET("refund_status = #{record.refundStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRefundFailReason() != null) { |
||||
sql.SET("refund_fail_reason = #{record.refundFailReason,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.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("high_order_refund"); |
||||
|
||||
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("order_child_id = #{record.orderChildId,jdbcType=BIGINT}"); |
||||
sql.SET("order_child_no = #{record.orderChildNo,jdbcType=VARCHAR}"); |
||||
sql.SET("mem_id = #{record.memId,jdbcType=BIGINT}"); |
||||
sql.SET("mem_name = #{record.memName,jdbcType=VARCHAR}"); |
||||
sql.SET("mem_phone = #{record.memPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("goods_type = #{record.goodsType,jdbcType=INTEGER}"); |
||||
sql.SET("goods_id = #{record.goodsId,jdbcType=BIGINT}"); |
||||
sql.SET("goods_name = #{record.goodsName,jdbcType=VARCHAR}"); |
||||
sql.SET("goods_desc = #{record.goodsDesc,jdbcType=VARCHAR}"); |
||||
sql.SET("goods_img = #{record.goodsImg,jdbcType=VARCHAR}"); |
||||
sql.SET("goods_spec_name = #{record.goodsSpecName,jdbcType=VARCHAR}"); |
||||
sql.SET("goods_count = #{record.goodsCount,jdbcType=INTEGER}"); |
||||
sql.SET("refund_order = #{record.refundOrder,jdbcType=VARCHAR}"); |
||||
sql.SET("return_total_price = #{record.returnTotalPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("refund_price = #{record.refundPrice,jdbcType=DECIMAL}"); |
||||
sql.SET("refund_gold = #{record.refundGold,jdbcType=INTEGER}"); |
||||
sql.SET("refund_remark = #{record.refundRemark,jdbcType=VARCHAR}"); |
||||
sql.SET("refund_status = #{record.refundStatus,jdbcType=INTEGER}"); |
||||
sql.SET("refund_fail_reason = #{record.refundFailReason,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,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}"); |
||||
sql.SET("ext_4 = #{record.ext4,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_5 = #{record.ext5,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_6 = #{record.ext6,jdbcType=VARCHAR}"); |
||||
|
||||
HighOrderRefundExample example = (HighOrderRefundExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(HighOrderRefund record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("high_order_refund"); |
||||
|
||||
if (record.getOrderId() != null) { |
||||
sql.SET("order_id = #{orderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderChildId() != null) { |
||||
sql.SET("order_child_id = #{orderChildId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderChildNo() != null) { |
||||
sql.SET("order_child_no = #{orderChildNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMemId() != null) { |
||||
sql.SET("mem_id = #{memId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMemName() != null) { |
||||
sql.SET("mem_name = #{memName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMemPhone() != null) { |
||||
sql.SET("mem_phone = #{memPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsType() != null) { |
||||
sql.SET("goods_type = #{goodsType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getGoodsId() != null) { |
||||
sql.SET("goods_id = #{goodsId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getGoodsName() != null) { |
||||
sql.SET("goods_name = #{goodsName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsDesc() != null) { |
||||
sql.SET("goods_desc = #{goodsDesc,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsImg() != null) { |
||||
sql.SET("goods_img = #{goodsImg,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsSpecName() != null) { |
||||
sql.SET("goods_spec_name = #{goodsSpecName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getGoodsCount() != null) { |
||||
sql.SET("goods_count = #{goodsCount,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRefundOrder() != null) { |
||||
sql.SET("refund_order = #{refundOrder,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReturnTotalPrice() != null) { |
||||
sql.SET("return_total_price = #{returnTotalPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRefundPrice() != null) { |
||||
sql.SET("refund_price = #{refundPrice,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRefundGold() != null) { |
||||
sql.SET("refund_gold = #{refundGold,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRefundRemark() != null) { |
||||
sql.SET("refund_remark = #{refundRemark,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRefundStatus() != null) { |
||||
sql.SET("refund_status = #{refundStatus,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRefundFailReason() != null) { |
||||
sql.SET("refund_fail_reason = #{refundFailReason,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.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, HighOrderRefundExample 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,525 @@ |
||||
package com.hai.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* high_order_refund |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class HighOrderRefund implements Serializable { |
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 交易订单id |
||||
*/ |
||||
private Long orderId; |
||||
|
||||
/** |
||||
* 交易订单号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 子订单id |
||||
*/ |
||||
private Long orderChildId; |
||||
|
||||
/** |
||||
* 子订单号 |
||||
*/ |
||||
private String orderChildNo; |
||||
|
||||
/** |
||||
* 用户表ID |
||||
*/ |
||||
private Long memId; |
||||
|
||||
/** |
||||
* 用户名称 |
||||
*/ |
||||
private String memName; |
||||
|
||||
/** |
||||
* 用户电话 |
||||
*/ |
||||
private String memPhone; |
||||
|
||||
/** |
||||
* 商品类型 |
||||
1. 卡卷 |
||||
2. 积分充值 |
||||
3. 加油订单 |
||||
4. KFC |
||||
5. 电影票 |
||||
6. 话费充值 |
||||
7. 优惠卷包 |
||||
8. 汇联通充值 |
||||
9. 星巴克 |
||||
10. 第三方充值 |
||||
*/ |
||||
private Integer goodsType; |
||||
|
||||
/** |
||||
* 商品id |
||||
*/ |
||||
private Long goodsId; |
||||
|
||||
/** |
||||
* 商品的名称 |
||||
*/ |
||||
private String goodsName; |
||||
|
||||
/** |
||||
* 商品描述 |
||||
*/ |
||||
private String goodsDesc; |
||||
|
||||
/** |
||||
* 商品图片 |
||||
*/ |
||||
private String goodsImg; |
||||
|
||||
/** |
||||
* 商品规格名称 |
||||
*/ |
||||
private String goodsSpecName; |
||||
|
||||
/** |
||||
* 商品数量 |
||||
*/ |
||||
private Integer goodsCount; |
||||
|
||||
/** |
||||
* 退款订单号 |
||||
*/ |
||||
private String refundOrder; |
||||
|
||||
/** |
||||
* 退款总金额 |
||||
*/ |
||||
private BigDecimal returnTotalPrice; |
||||
|
||||
/** |
||||
* 退款金额 |
||||
*/ |
||||
private BigDecimal refundPrice; |
||||
|
||||
/** |
||||
* 退款积分 |
||||
*/ |
||||
private Integer refundGold; |
||||
|
||||
/** |
||||
* 退款备注 |
||||
*/ |
||||
private String refundRemark; |
||||
|
||||
/** |
||||
* 退款状态 |
||||
1. 退款中 |
||||
2. 退款成功 |
||||
3. 退款失败 |
||||
*/ |
||||
private Integer refundStatus; |
||||
|
||||
/** |
||||
* 退款失败原因 |
||||
*/ |
||||
private String refundFailReason; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
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 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 Long getOrderChildId() { |
||||
return orderChildId; |
||||
} |
||||
|
||||
public void setOrderChildId(Long orderChildId) { |
||||
this.orderChildId = orderChildId; |
||||
} |
||||
|
||||
public String getOrderChildNo() { |
||||
return orderChildNo; |
||||
} |
||||
|
||||
public void setOrderChildNo(String orderChildNo) { |
||||
this.orderChildNo = orderChildNo; |
||||
} |
||||
|
||||
public Long getMemId() { |
||||
return memId; |
||||
} |
||||
|
||||
public void setMemId(Long memId) { |
||||
this.memId = memId; |
||||
} |
||||
|
||||
public String getMemName() { |
||||
return memName; |
||||
} |
||||
|
||||
public void setMemName(String memName) { |
||||
this.memName = memName; |
||||
} |
||||
|
||||
public String getMemPhone() { |
||||
return memPhone; |
||||
} |
||||
|
||||
public void setMemPhone(String memPhone) { |
||||
this.memPhone = memPhone; |
||||
} |
||||
|
||||
public Integer getGoodsType() { |
||||
return goodsType; |
||||
} |
||||
|
||||
public void setGoodsType(Integer goodsType) { |
||||
this.goodsType = goodsType; |
||||
} |
||||
|
||||
public Long getGoodsId() { |
||||
return goodsId; |
||||
} |
||||
|
||||
public void setGoodsId(Long goodsId) { |
||||
this.goodsId = goodsId; |
||||
} |
||||
|
||||
public String getGoodsName() { |
||||
return goodsName; |
||||
} |
||||
|
||||
public void setGoodsName(String goodsName) { |
||||
this.goodsName = goodsName; |
||||
} |
||||
|
||||
public String getGoodsDesc() { |
||||
return goodsDesc; |
||||
} |
||||
|
||||
public void setGoodsDesc(String goodsDesc) { |
||||
this.goodsDesc = goodsDesc; |
||||
} |
||||
|
||||
public String getGoodsImg() { |
||||
return goodsImg; |
||||
} |
||||
|
||||
public void setGoodsImg(String goodsImg) { |
||||
this.goodsImg = goodsImg; |
||||
} |
||||
|
||||
public String getGoodsSpecName() { |
||||
return goodsSpecName; |
||||
} |
||||
|
||||
public void setGoodsSpecName(String goodsSpecName) { |
||||
this.goodsSpecName = goodsSpecName; |
||||
} |
||||
|
||||
public Integer getGoodsCount() { |
||||
return goodsCount; |
||||
} |
||||
|
||||
public void setGoodsCount(Integer goodsCount) { |
||||
this.goodsCount = goodsCount; |
||||
} |
||||
|
||||
public String getRefundOrder() { |
||||
return refundOrder; |
||||
} |
||||
|
||||
public void setRefundOrder(String refundOrder) { |
||||
this.refundOrder = refundOrder; |
||||
} |
||||
|
||||
public BigDecimal getReturnTotalPrice() { |
||||
return returnTotalPrice; |
||||
} |
||||
|
||||
public void setReturnTotalPrice(BigDecimal returnTotalPrice) { |
||||
this.returnTotalPrice = returnTotalPrice; |
||||
} |
||||
|
||||
public BigDecimal getRefundPrice() { |
||||
return refundPrice; |
||||
} |
||||
|
||||
public void setRefundPrice(BigDecimal refundPrice) { |
||||
this.refundPrice = refundPrice; |
||||
} |
||||
|
||||
public Integer getRefundGold() { |
||||
return refundGold; |
||||
} |
||||
|
||||
public void setRefundGold(Integer refundGold) { |
||||
this.refundGold = refundGold; |
||||
} |
||||
|
||||
public String getRefundRemark() { |
||||
return refundRemark; |
||||
} |
||||
|
||||
public void setRefundRemark(String refundRemark) { |
||||
this.refundRemark = refundRemark; |
||||
} |
||||
|
||||
public Integer getRefundStatus() { |
||||
return refundStatus; |
||||
} |
||||
|
||||
public void setRefundStatus(Integer refundStatus) { |
||||
this.refundStatus = refundStatus; |
||||
} |
||||
|
||||
public String getRefundFailReason() { |
||||
return refundFailReason; |
||||
} |
||||
|
||||
public void setRefundFailReason(String refundFailReason) { |
||||
this.refundFailReason = refundFailReason; |
||||
} |
||||
|
||||
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 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; |
||||
} |
||||
HighOrderRefund other = (HighOrderRefund) 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.getOrderChildId() == null ? other.getOrderChildId() == null : this.getOrderChildId().equals(other.getOrderChildId())) |
||||
&& (this.getOrderChildNo() == null ? other.getOrderChildNo() == null : this.getOrderChildNo().equals(other.getOrderChildNo())) |
||||
&& (this.getMemId() == null ? other.getMemId() == null : this.getMemId().equals(other.getMemId())) |
||||
&& (this.getMemName() == null ? other.getMemName() == null : this.getMemName().equals(other.getMemName())) |
||||
&& (this.getMemPhone() == null ? other.getMemPhone() == null : this.getMemPhone().equals(other.getMemPhone())) |
||||
&& (this.getGoodsType() == null ? other.getGoodsType() == null : this.getGoodsType().equals(other.getGoodsType())) |
||||
&& (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId())) |
||||
&& (this.getGoodsName() == null ? other.getGoodsName() == null : this.getGoodsName().equals(other.getGoodsName())) |
||||
&& (this.getGoodsDesc() == null ? other.getGoodsDesc() == null : this.getGoodsDesc().equals(other.getGoodsDesc())) |
||||
&& (this.getGoodsImg() == null ? other.getGoodsImg() == null : this.getGoodsImg().equals(other.getGoodsImg())) |
||||
&& (this.getGoodsSpecName() == null ? other.getGoodsSpecName() == null : this.getGoodsSpecName().equals(other.getGoodsSpecName())) |
||||
&& (this.getGoodsCount() == null ? other.getGoodsCount() == null : this.getGoodsCount().equals(other.getGoodsCount())) |
||||
&& (this.getRefundOrder() == null ? other.getRefundOrder() == null : this.getRefundOrder().equals(other.getRefundOrder())) |
||||
&& (this.getReturnTotalPrice() == null ? other.getReturnTotalPrice() == null : this.getReturnTotalPrice().equals(other.getReturnTotalPrice())) |
||||
&& (this.getRefundPrice() == null ? other.getRefundPrice() == null : this.getRefundPrice().equals(other.getRefundPrice())) |
||||
&& (this.getRefundGold() == null ? other.getRefundGold() == null : this.getRefundGold().equals(other.getRefundGold())) |
||||
&& (this.getRefundRemark() == null ? other.getRefundRemark() == null : this.getRefundRemark().equals(other.getRefundRemark())) |
||||
&& (this.getRefundStatus() == null ? other.getRefundStatus() == null : this.getRefundStatus().equals(other.getRefundStatus())) |
||||
&& (this.getRefundFailReason() == null ? other.getRefundFailReason() == null : this.getRefundFailReason().equals(other.getRefundFailReason())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (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 + ((getOrderId() == null) ? 0 : getOrderId().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getOrderChildId() == null) ? 0 : getOrderChildId().hashCode()); |
||||
result = prime * result + ((getOrderChildNo() == null) ? 0 : getOrderChildNo().hashCode()); |
||||
result = prime * result + ((getMemId() == null) ? 0 : getMemId().hashCode()); |
||||
result = prime * result + ((getMemName() == null) ? 0 : getMemName().hashCode()); |
||||
result = prime * result + ((getMemPhone() == null) ? 0 : getMemPhone().hashCode()); |
||||
result = prime * result + ((getGoodsType() == null) ? 0 : getGoodsType().hashCode()); |
||||
result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode()); |
||||
result = prime * result + ((getGoodsName() == null) ? 0 : getGoodsName().hashCode()); |
||||
result = prime * result + ((getGoodsDesc() == null) ? 0 : getGoodsDesc().hashCode()); |
||||
result = prime * result + ((getGoodsImg() == null) ? 0 : getGoodsImg().hashCode()); |
||||
result = prime * result + ((getGoodsSpecName() == null) ? 0 : getGoodsSpecName().hashCode()); |
||||
result = prime * result + ((getGoodsCount() == null) ? 0 : getGoodsCount().hashCode()); |
||||
result = prime * result + ((getRefundOrder() == null) ? 0 : getRefundOrder().hashCode()); |
||||
result = prime * result + ((getReturnTotalPrice() == null) ? 0 : getReturnTotalPrice().hashCode()); |
||||
result = prime * result + ((getRefundPrice() == null) ? 0 : getRefundPrice().hashCode()); |
||||
result = prime * result + ((getRefundGold() == null) ? 0 : getRefundGold().hashCode()); |
||||
result = prime * result + ((getRefundRemark() == null) ? 0 : getRefundRemark().hashCode()); |
||||
result = prime * result + ((getRefundStatus() == null) ? 0 : getRefundStatus().hashCode()); |
||||
result = prime * result + ((getRefundFailReason() == null) ? 0 : getRefundFailReason().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().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(", orderId=").append(orderId); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", orderChildId=").append(orderChildId); |
||||
sb.append(", orderChildNo=").append(orderChildNo); |
||||
sb.append(", memId=").append(memId); |
||||
sb.append(", memName=").append(memName); |
||||
sb.append(", memPhone=").append(memPhone); |
||||
sb.append(", goodsType=").append(goodsType); |
||||
sb.append(", goodsId=").append(goodsId); |
||||
sb.append(", goodsName=").append(goodsName); |
||||
sb.append(", goodsDesc=").append(goodsDesc); |
||||
sb.append(", goodsImg=").append(goodsImg); |
||||
sb.append(", goodsSpecName=").append(goodsSpecName); |
||||
sb.append(", goodsCount=").append(goodsCount); |
||||
sb.append(", refundOrder=").append(refundOrder); |
||||
sb.append(", returnTotalPrice=").append(returnTotalPrice); |
||||
sb.append(", refundPrice=").append(refundPrice); |
||||
sb.append(", refundGold=").append(refundGold); |
||||
sb.append(", refundRemark=").append(refundRemark); |
||||
sb.append(", refundStatus=").append(refundStatus); |
||||
sb.append(", refundFailReason=").append(refundFailReason); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
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,29 @@ |
||||
package com.hai.order.service; |
||||
|
||||
import com.hai.entity.HighChildOrder; |
||||
import com.hai.entity.HighOrder; |
||||
|
||||
/** |
||||
* 订单退款业务 |
||||
* @className: OrderRefundService |
||||
* @author: HuRui |
||||
* @date: 2022/9/1 |
||||
**/ |
||||
public interface OrderRefundService { |
||||
|
||||
/** |
||||
* 交易订单退款 |
||||
* @param order 交易订单 |
||||
* @param remarks 退款备注 |
||||
*/ |
||||
HighOrder createOrderRefund(HighOrder order, String remarks); |
||||
|
||||
/** |
||||
* 子订单退款 |
||||
* @param orderChild 子订单 |
||||
* @param refundCount 退款数量 |
||||
* @param remarks 退款备注 |
||||
*/ |
||||
HighChildOrder createOrderChildRefund(HighChildOrder orderChild,Integer refundCount, String remarks); |
||||
|
||||
} |
@ -0,0 +1,125 @@ |
||||
package com.hai.order.service.impl; |
||||
|
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.dao.HighOrderRefundMapper; |
||||
import com.hai.entity.HighChildOrder; |
||||
import com.hai.entity.HighOrder; |
||||
import com.hai.entity.HighOrderRefund; |
||||
import com.hai.order.service.OrderRefundService; |
||||
import com.hai.order.service.OrderService; |
||||
import com.hai.order.type.OrderChildStatus; |
||||
import com.hai.order.type.OrderPayType; |
||||
import com.hai.order.type.OrderRefundStatus; |
||||
import com.hai.order.type.OrderStatus; |
||||
import com.hai.service.HighUserService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @className: OrderRefundServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2022/9/1 |
||||
**/ |
||||
@Service("orderRefundService") |
||||
public class OrderRefundServiceImpl implements OrderRefundService { |
||||
|
||||
@Resource |
||||
private HighOrderRefundMapper orderRefundMapper; |
||||
|
||||
@Resource |
||||
private HighUserService userService; |
||||
|
||||
@Resource |
||||
private OrderService orderService; |
||||
|
||||
@Override |
||||
public HighOrder createOrderRefund(HighOrder order, String remarks) { |
||||
// 使用了积分抵扣
|
||||
if (order.getPayGold() != null && order.getPayGold().intValue() > 0) { |
||||
// 积分返回
|
||||
String remark = "订单" + order.getOrderNo() + "退款,退还积分:" + order.getPayGold(); |
||||
userService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId() , remark); |
||||
} |
||||
order.setOrderStatus(OrderStatus.STATUS4.getNumber()); |
||||
order.setRefundTime(new Date()); |
||||
|
||||
|
||||
for (HighChildOrder childOrder : order.getHighChildOrderList()) { |
||||
childOrder.setRefundTime(new Date()); |
||||
|
||||
|
||||
} |
||||
|
||||
if (order.getPayType() != null) { |
||||
// 原路退款
|
||||
if (order.getPayType().equals(OrderPayType.PAY_TYPE1.getNumber())) { |
||||
|
||||
} else if (order.getPayType().equals(OrderPayType.PAY_TYPE2.getNumber())) { |
||||
|
||||
} else if (order.getPayType().equals(OrderPayType.PAY_TYPE4.getNumber())) { |
||||
|
||||
} else if (order.getPayType().equals(OrderPayType.PAY_TYPE5.getNumber())) { |
||||
|
||||
} else if (order.getPayType().equals(OrderPayType.PAY_TYPE6.getNumber())) { |
||||
|
||||
} else if (order.getPayType().equals(OrderPayType.PAY_TYPE7.getNumber())) { |
||||
|
||||
} |
||||
} |
||||
|
||||
return orderService.updateOrderData(order); |
||||
} |
||||
|
||||
@Override |
||||
public HighChildOrder createOrderChildRefund(HighChildOrder orderChild,Integer refundCount, String remarks) { |
||||
if (orderChild.getChildOrderStatus().equals(OrderChildStatus.STATUS2.getNumber()) |
||||
|| orderChild.getChildOrderStatus().equals(OrderChildStatus.STATUS3.getNumber())){ |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "子订单状态错误"); |
||||
} |
||||
if (orderChild.getSurplusRefundIntegral() <= 0 |
||||
&& orderChild.getSurplusRefundPrice().compareTo(new BigDecimal("0")) <= 0) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "子订单余额不足"); |
||||
} |
||||
|
||||
// 判断剩余可退商品数量
|
||||
if (orderChild.getSurplusRefundNum() < refundCount) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款商品数量过多"); |
||||
} |
||||
|
||||
|
||||
|
||||
HighOrderRefund orderRefund = new HighOrderRefund(); |
||||
orderRefund.setOrderId(orderChild.getOrderId()); |
||||
orderRefund.setOrderNo(orderChild.getOrderNo()); |
||||
orderRefund.setOrderChildId(orderChild.getId()); |
||||
orderRefund.setOrderChildNo(orderChild.getChildOrderNo()); |
||||
orderRefund.setMemId(orderChild.getMemId()); |
||||
orderRefund.setMemName(orderChild.getMemPhone()); |
||||
orderRefund.setMemPhone(orderChild.getMemPhone()); |
||||
orderRefund.setGoodsType(orderChild.getGoodsType()); |
||||
orderRefund.setGoodsId(orderChild.getGoodsId()); |
||||
orderRefund.setGoodsName(orderChild.getGoodsName()); |
||||
orderRefund.setGoodsDesc(orderChild.getGoodsDesc()); |
||||
orderRefund.setGoodsImg(orderChild.getGoodsImg()); |
||||
orderRefund.setGoodsSpecName(orderChild.getGoodsSpecName()); |
||||
orderRefund.setGoodsCount(orderChild.getSaleCount()); |
||||
|
||||
orderRefund.setRefundOrder(orderChild.getOrderNo()); |
||||
orderRefund.setReturnTotalPrice(orderChild.getTotalActualPrice()); |
||||
orderRefund.setRefundPrice(orderChild.getSurplusRefundPrice()); |
||||
orderRefund.setRefundGold(orderChild.getSurplusRefundIntegral()); |
||||
orderRefund.setRefundRemark(remarks); |
||||
orderRefund.setRefundStatus(OrderRefundStatus.STATUS1.getNumber()); |
||||
|
||||
orderRefund.setCreateTime(new Date()); |
||||
orderRefund.setUpdateTime(new Date()); |
||||
orderRefundMapper.insert(orderRefund); |
||||
|
||||
return orderChild; |
||||
} |
||||
} |
@ -0,0 +1,53 @@ |
||||
package com.hai.order.type; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 订单退款状态 |
||||
* @className: OrderRefundStatus |
||||
* @author: HuRui |
||||
* @date: 2022/9/1 |
||||
**/ |
||||
public enum OrderRefundStatus { |
||||
STATUS1(1, "退款中"), |
||||
STATUS2(2, "退款成功"), |
||||
STATUS3(3, "退款失败"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
OrderRefundStatus(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
/** |
||||
* 根据类型查询数据 |
||||
* @param type |
||||
* @return |
||||
*/ |
||||
public static OrderRefundStatus getDataByType(Integer type) { |
||||
for (OrderRefundStatus ele : values()) { |
||||
if(Objects.equals(type,ele.getNumber())) return ele; |
||||
} |
||||
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; |
||||
} |
||||
} |
Loading…
Reference in new issue