Commit c45ca815 by zhanghj

V1.6.0--提交生成对账单详情功能

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@25774 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 20b24cc5
package com.glsx.ordercenter.mapper;
import java.util.List;
import com.glsx.ordercenter.pojo.SysOrderSubsidyHistory;
import com.glsx.ordercenter.pojo.SysOrderSubsidyHistoryExample;
public interface SysOrderSubsidyHistoryMapper {
int deleteByPrimaryKey(Integer id);
int insert(SysOrderSubsidyHistory record);
int insertSelective(SysOrderSubsidyHistory record);
List<SysOrderSubsidyHistory> selectByExample(SysOrderSubsidyHistoryExample example);
SysOrderSubsidyHistory selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysOrderSubsidyHistory record);
int updateByPrimaryKey(SysOrderSubsidyHistory record);
}
\ No newline at end of file
package com.glsx.ordercenter.mapper;
import java.math.BigDecimal;
import org.apache.ibatis.annotations.Param;
import com.glsx.ordercenter.pojo.SysOrderSubsidy;
import com.glsx.ordercenter.pojo.SysOrderSubsidyExample;
public interface SysOrderSubsidyMapper {
long countByExample(SysOrderSubsidyExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysOrderSubsidy record);
int insertSelective(SysOrderSubsidy record);
SysOrderSubsidy selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysOrderSubsidy record);
int updateByPrimaryKey(SysOrderSubsidy record);
/**
*
* @author zhanghj
* @Title: getOrderSubsidiesSum
* @Description: TODO
* @param orderId
* @return
* BigDecimal
* @version
*/
BigDecimal getOrderSubsidiesSum(@Param("orderId")Integer orderId);
}
\ No newline at end of file
package com.glsx.ordercenter.pojo;
import java.math.BigDecimal;
import java.util.Date;
/**
* 运营垫付表(sys_operation_advance)
*
* @author dengtt
* @date 2019年12月26日10:56:28
*/
public class SysOperationAdvance extends BaseModel {
public class SysOperationAdvance {
private Integer id;
private Integer id; // id主键
private String reconciliationSn;
private Integer reconciliationMonthlyId; //对账周期id
private String orderSn;
private String reconciliationSn; // 对账单号
private Byte orderType;
private String orderSn; // 订单编号
private String carOwner;
private Integer orderType; // 订单类型 1.安装单、2.拆除单、3.检修单
private String vinNo;
private String carOwner; // 车主姓名
private BigDecimal amount;
private String vinNo; // 车架号
private String remark;
private BigDecimal amount; // 垫付金额
private Integer createBy;
private Date createTime;
private Integer updateBy;
private Date updateTime;
public Integer getId() {
return id;
......@@ -34,20 +36,12 @@ public class SysOperationAdvance extends BaseModel {
this.id = id;
}
public Integer getReconciliationMonthlyId() {
return reconciliationMonthlyId;
}
public void setReconciliationMonthlyId(Integer reconciliationMonthlyId) {
this.reconciliationMonthlyId = reconciliationMonthlyId;
}
public String getReconciliationSn() {
return reconciliationSn;
}
public void setReconciliationSn(String reconciliationSn) {
this.reconciliationSn = reconciliationSn;
this.reconciliationSn = reconciliationSn == null ? null : reconciliationSn.trim();
}
public String getOrderSn() {
......@@ -55,14 +49,14 @@ public class SysOperationAdvance extends BaseModel {
}
public void setOrderSn(String orderSn) {
this.orderSn = orderSn;
this.orderSn = orderSn == null ? null : orderSn.trim();
}
public Integer getOrderType() {
public Byte getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
public void setOrderType(Byte orderType) {
this.orderType = orderType;
}
......@@ -71,7 +65,7 @@ public class SysOperationAdvance extends BaseModel {
}
public void setCarOwner(String carOwner) {
this.carOwner = carOwner;
this.carOwner = carOwner == null ? null : carOwner.trim();
}
public String getVinNo() {
......@@ -79,7 +73,7 @@ public class SysOperationAdvance extends BaseModel {
}
public void setVinNo(String vinNo) {
this.vinNo = vinNo;
this.vinNo = vinNo == null ? null : vinNo.trim();
}
public BigDecimal getAmount() {
......@@ -90,4 +84,43 @@ public class SysOperationAdvance extends BaseModel {
this.amount = amount;
}
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.glsx.ordercenter.pojo;
import java.math.BigDecimal;
import java.util.Date;
public class SysOrderSubsidy {
private Integer id;
private Integer orderId;
private BigDecimal subsidies;
private String subsidyType;
private Date createTime;
private Integer createBy;
private String remark;
private Integer updateBy;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getOrderId() {
return orderId;
}
public void setOrderId(Integer orderId) {
this.orderId = orderId;
}
public BigDecimal getSubsidies() {
return subsidies;
}
public void setSubsidies(BigDecimal subsidies) {
this.subsidies = subsidies;
}
public String getSubsidyType() {
return subsidyType;
}
public void setSubsidyType(String subsidyType) {
this.subsidyType = subsidyType == null ? null : subsidyType.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.glsx.ordercenter.pojo;
import java.math.BigDecimal;
import java.util.Date;
public class SysOrderSubsidyHistory {
private Integer id;
private Integer orderId;
private BigDecimal subsidies;
private String subsidyType;
private Date createTime;
private Integer createBy;
private String remark;
private Integer updateBy;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getOrderId() {
return orderId;
}
public void setOrderId(Integer orderId) {
this.orderId = orderId;
}
public BigDecimal getSubsidies() {
return subsidies;
}
public void setSubsidies(BigDecimal subsidies) {
this.subsidies = subsidies;
}
public String getSubsidyType() {
return subsidyType;
}
public void setSubsidyType(String subsidyType) {
this.subsidyType = subsidyType == null ? null : subsidyType.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
......@@ -14,6 +14,8 @@ public class SysReconciliationDetail extends BaseModel {
private String reconciliationSn; // 对账编号
private Integer orderId;
private String orderSn; // 订单编号
private Integer orderType; // 订单类型 1.安装单、2.拆除单、3.检修单
......@@ -149,4 +151,13 @@ public class SysReconciliationDetail extends BaseModel {
public void setSubsidyAmount(BigDecimal subsidyAmount) {
this.subsidyAmount = subsidyAmount;
}
public Integer getOrderId() {
return orderId;
}
public void setOrderId(Integer orderId) {
this.orderId = orderId;
}
}
package com.glsx.ordercenter.service;
import java.math.BigDecimal;
import com.glsx.ordercenter.pojo.SysOrderSubsidy;
/**
*
* @Title OrderSubsidyService.java
* @Package com.glsx.ordercenter.service
* @Description TODO 订单补贴信息服务类
* @author zhanghj
* @date 2020年1月7日 下午2:43:20
* @version 1.0.0
*/
public interface OrderSubsidyService {
/**
*
* @author zhanghj
* @Title: getOrderSubsidiesSum
* @Description: TODO 获取订单的补贴总金额
* @param orderId
* @return
* BigDecimal
* @version
*/
BigDecimal getOrderSubsidiesSum(Integer orderId);
}
package com.glsx.ordercenter.service.impl;
import java.math.BigDecimal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.glsx.ordercenter.mapper.SysOrderSubsidyMapper;
import com.glsx.ordercenter.pojo.SysOrderSubsidy;
import com.glsx.ordercenter.service.OrderSubsidyService;
@Component
public class OrderSubsidyServiceImpl implements OrderSubsidyService {
@Autowired
private SysOrderSubsidyMapper orderSubsidyDao;
@Override
public BigDecimal getOrderSubsidiesSum(Integer orderId) {
// TODO Auto-generated method stub
return orderSubsidyDao.getOrderSubsidiesSum(orderId);
}
}
package com.glsx.ordercenter.service.impl;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.glsx.common.constants.ResultObject;
......@@ -10,24 +22,18 @@ import com.glsx.ordercenter.dto.ReconciliationDetailVO;
import com.glsx.ordercenter.dto.req.GenerateReconciliationDetailReq;
import com.glsx.ordercenter.mapper.SysReconciliationDetailMapper;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderSubsidy;
import com.glsx.ordercenter.pojo.SysReconciliationDetail;
import com.glsx.ordercenter.pojo.SysServiceItem;
import com.glsx.ordercenter.pojo.user.SysMerchant;
import com.glsx.ordercenter.service.OrderSubsidyService;
import com.glsx.ordercenter.service.ReconciliationBaseService;
import com.glsx.ordercenter.service.ReconciliationDetailService;
import com.glsx.ordercenter.utils.PageInfoUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 对账明细表服务实现类
......@@ -44,6 +50,9 @@ public class ReconciliationDetailServiceImpl implements ReconciliationDetailServ
@Resource
private SysReconciliationDetailMapper reconciliationDetailMapper;
@Autowired
private OrderSubsidyService orderSubsidyService;
/**
* (分页)查询对账明细列表
......@@ -113,9 +122,11 @@ public class ReconciliationDetailServiceImpl implements ReconciliationDetailServ
// TODO Auto-generated method stub
List<SysReconciliationDetail> reconciliationDetailList = reconciliationDetailMapper.getPendingSettlementOrderList(req);
reconciliationDetailList.forEach(reconciliationDetail ->{
/*BigDecimal subsidies =
reconciliationDetail.set*/
Integer orderId = reconciliationDetail.getOrderId();
BigDecimal subsidies = orderSubsidyService.getOrderSubsidiesSum(orderId);
reconciliationDetail.setSubsidyAmount(subsidies);
//BigDecimal advanceAmount =
//reconciliationDetail.set
});
return null;
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glsx.ordercenter.mapper.SysOperationAdvanceMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysOperationAdvance">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="reconciliation_monthly_id" jdbcType="INTEGER" property="reconciliationMonthlyId"/>
<result column="reconciliation_sn" jdbcType="VARCHAR" property="reconciliationSn"/>
<result column="order_sn" jdbcType="VARCHAR" property="orderSn"/>
<result column="order_type" jdbcType="INTEGER" property="orderType"/>
<result column="car_owner" jdbcType="VARCHAR" property="carOwner"/>
<result column="vin_no" jdbcType="VARCHAR" property="vinNo"/>
<result column="amount" jdbcType="DECIMAL" property="amount"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="create_by" jdbcType="INTEGER" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_by" jdbcType="INTEGER" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, reconciliation_monthly_id, reconciliation_sn, order_sn, order_type, car_owner, vin_no, amount, remark, create_by, create_time, update_by, update_time
</sql>
<select id="selectList" parameterType="com.glsx.ordercenter.dto.OperationAdvanceQuery" resultMap="BaseResultMap">
<if test="keyWord != null and keyWord != ''">
<bind name="keyWord" value="'%'+keyWord+'%'"/>
</if>
select
<include refid="Base_Column_List"/>
from
sys_operation_advance
<where>
<if test="reconciliationMonthlyId != null">
and reconciliation_monthly_id = #{reconciliationMonthlyId}
</if>
<if test="reconciliationSn != null and reconciliationSn !=''">
and reconciliation_sn = #{reconciliationSn}
</if>
<if test="orderType != null">
and order_type = #{orderType}
</if>
<if test="keyWord != null and keyWord != ''">
and (
order_sn like #{keyWord} or
car_owner like #{keyWord} or
vin_no like #{keyWord}
)
</if>
</where>
order by
create_time desc
</select>
<select id="selectByOrderSn" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
sys_operation_advance
<where>
<if test="orderSn != null">
and order_sn = #{orderSn}
</if>
</where>
order by
create_time desc
</select>
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysOperationAdvance">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="reconciliation_sn" jdbcType="VARCHAR" property="reconciliationSn" />
<result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
<result column="order_type" jdbcType="TINYINT" property="orderType" />
<result column="car_owner" jdbcType="VARCHAR" property="carOwner" />
<result column="vin_no" jdbcType="VARCHAR" property="vinNo" />
<result column="amount" jdbcType="DECIMAL" property="amount" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, reconciliation_sn, order_sn, order_type, car_owner, vin_no, amount, remark, create_by,
create_time, update_by, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_operation_advance
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_operation_advance
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysOperationAdvance">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_operation_advance (reconciliation_sn, order_sn, order_type,
car_owner, vin_no, amount,
remark, create_by, create_time,
update_by, update_time)
values (#{reconciliationSn,jdbcType=VARCHAR}, #{orderSn,jdbcType=VARCHAR}, #{orderType,jdbcType=TINYINT},
#{carOwner,jdbcType=VARCHAR}, #{vinNo,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL},
#{remark,jdbcType=VARCHAR}, #{createBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysOperationAdvance">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_operation_advance
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reconciliationSn != null">
reconciliation_sn,
</if>
<if test="orderSn != null">
order_sn,
</if>
<if test="orderType != null">
order_type,
</if>
<if test="carOwner != null">
car_owner,
</if>
<if test="vinNo != null">
vin_no,
</if>
<if test="amount != null">
amount,
</if>
<if test="remark != null">
remark,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reconciliationSn != null">
#{reconciliationSn,jdbcType=VARCHAR},
</if>
<if test="orderSn != null">
#{orderSn,jdbcType=VARCHAR},
</if>
<if test="orderType != null">
#{orderType,jdbcType=TINYINT},
</if>
<if test="carOwner != null">
#{carOwner,jdbcType=VARCHAR},
</if>
<if test="vinNo != null">
#{vinNo,jdbcType=VARCHAR},
</if>
<if test="amount != null">
#{amount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.SysOperationAdvance">
update sys_operation_advance
<set>
<if test="reconciliationSn != null">
reconciliation_sn = #{reconciliationSn,jdbcType=VARCHAR},
</if>
<if test="orderSn != null">
order_sn = #{orderSn,jdbcType=VARCHAR},
</if>
<if test="orderType != null">
order_type = #{orderType,jdbcType=TINYINT},
</if>
<if test="carOwner != null">
car_owner = #{carOwner,jdbcType=VARCHAR},
</if>
<if test="vinNo != null">
vin_no = #{vinNo,jdbcType=VARCHAR},
</if>
<if test="amount != null">
amount = #{amount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysOperationAdvance">
update sys_operation_advance
set reconciliation_sn = #{reconciliationSn,jdbcType=VARCHAR},
order_sn = #{orderSn,jdbcType=VARCHAR},
order_type = #{orderType,jdbcType=TINYINT},
car_owner = #{carOwner,jdbcType=VARCHAR},
vin_no = #{vinNo,jdbcType=VARCHAR},
amount = #{amount,jdbcType=DECIMAL},
remark = #{remark,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glsx.ordercenter.mapper.SysOrderSubsidyHistoryMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysOrderSubsidyHistory">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_id" jdbcType="INTEGER" property="orderId" />
<result column="subsidies" jdbcType="DECIMAL" property="subsidies" />
<result column="subsidy_type" jdbcType="VARCHAR" property="subsidyType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, order_id, subsidies, subsidy_type, create_time, create_by, remark, update_by,
update_time
</sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidyHistoryExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List" />
from sys_order_subsidy_history
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_order_subsidy_history
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_order_subsidy_history
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidyHistory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_order_subsidy_history (order_id, subsidies, subsidy_type,
create_time, create_by, remark,
update_by, update_time)
values (#{orderId,jdbcType=INTEGER}, #{subsidies,jdbcType=DECIMAL}, #{subsidyType,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
#{updateBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidyHistory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_order_subsidy_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">
order_id,
</if>
<if test="subsidies != null">
subsidies,
</if>
<if test="subsidyType != null">
subsidy_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="remark != null">
remark,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">
#{orderId,jdbcType=INTEGER},
</if>
<if test="subsidies != null">
#{subsidies,jdbcType=DECIMAL},
</if>
<if test="subsidyType != null">
#{subsidyType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidyHistory">
update sys_order_subsidy_history
<set>
<if test="orderId != null">
order_id = #{orderId,jdbcType=INTEGER},
</if>
<if test="subsidies != null">
subsidies = #{subsidies,jdbcType=DECIMAL},
</if>
<if test="subsidyType != null">
subsidy_type = #{subsidyType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidyHistory">
update sys_order_subsidy_history
set order_id = #{orderId,jdbcType=INTEGER},
subsidies = #{subsidies,jdbcType=DECIMAL},
subsidy_type = #{subsidyType,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glsx.ordercenter.mapper.SysOrderSubsidyMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysOrderSubsidy">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_id" jdbcType="INTEGER" property="orderId" />
<result column="subsidies" jdbcType="DECIMAL" property="subsidies" />
<result column="subsidy_type" jdbcType="VARCHAR" property="subsidyType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, order_id, subsidies, subsidy_type, create_time, create_by, remark, update_by,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_order_subsidy
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_order_subsidy
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidy">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_order_subsidy (order_id, subsidies, subsidy_type,
create_time, create_by, remark,
update_by, update_time)
values (#{orderId,jdbcType=INTEGER}, #{subsidies,jdbcType=DECIMAL}, #{subsidyType,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
#{updateBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidy">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_order_subsidy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">
order_id,
</if>
<if test="subsidies != null">
subsidies,
</if>
<if test="subsidyType != null">
subsidy_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="remark != null">
remark,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">
#{orderId,jdbcType=INTEGER},
</if>
<if test="subsidies != null">
#{subsidies,jdbcType=DECIMAL},
</if>
<if test="subsidyType != null">
#{subsidyType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidyExample" resultType="java.lang.Long">
select count(*) from sys_order_subsidy
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidy">
update sys_order_subsidy
<set>
<if test="orderId != null">
order_id = #{orderId,jdbcType=INTEGER},
</if>
<if test="subsidies != null">
subsidies = #{subsidies,jdbcType=DECIMAL},
</if>
<if test="subsidyType != null">
subsidy_type = #{subsidyType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysOrderSubsidy">
update sys_order_subsidy
set order_id = #{orderId,jdbcType=INTEGER},
subsidies = #{subsidies,jdbcType=DECIMAL},
subsidy_type = #{subsidyType,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getOrderSubsidiesSum" parameterType="java.lang.Integer">
select IFNULL(SUM(subsidies),0)
FROM sys_order_subsidy
WHERE order_id = #{orderId}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!