Browse Source

1.付款单插入中间表
2.获取原单编号

heqinwei 7 năm trước cách đây
mục cha
commit
83b25aa266

+ 27 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/SubledgerController.java

@@ -0,0 +1,27 @@
+package com.usoftchina.saas.money.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.money.mapper.SubledgerMapper;
+import com.usoftchina.saas.money.service.SubledgerService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 11:05
+ **/
+@RestController
+@RequestMapping("/subledger")
+public class SubledgerController {
+    @Autowired
+    private SubledgerService subledgerService;
+
+    @GetMapping("/list")
+    public Result getListData(PageRequest page, ListReqDTO condition){
+        return Result.success(subledgerService.seleteList(page, condition));
+    }
+}

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java

@@ -17,7 +17,7 @@ public interface BanksubledgerMapper extends CommonBaseMapper<Banksubledger> {
 
     int deleteByExample(BanksubledgerExample example);
 
-    int deleteByPrimaryKey(Integer bl_id);
+    int deleteByPrimaryKey(@Param("code") String code, @Param("kind") String kind);
 
 //    Long insert(Banksubledger record);
 

+ 28 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/SubledgerMapper.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Recbalance;
+import com.usoftchina.saas.money.po.Subledger;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.List;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 10:33
+ **/
+public interface SubledgerMapper {
+    int deleteByPrimaryKey(@Param("code") String code, @Param("kind") String kind);
+
+    int insert(Subledger record);
+
+    int insertSelective(Subledger record);
+
+    Subledger selectByPrimaryKey(Integer sl_id);
+
+    int updateByPrimaryKeySelective(Subledger record);
+
+    int updateByPrimaryKey(Subledger record);
+
+    List<Subledger> selectSubledgerBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+}

+ 30 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Banksubledger.java

@@ -42,6 +42,36 @@ public class Banksubledger extends CommonBaseEntity implements Serializable {
  
     private String bl_remark;    //备注
 
+    private Double bl_orderamount;
+
+    private Integer bl_assid;
+
+    private String bl_item;
+
+    public Double getBl_orderamount() {
+        return bl_orderamount;
+    }
+
+    public void setBl_orderamount(Double bl_orderamount) {
+        this.bl_orderamount = bl_orderamount;
+    }
+
+    public Integer getBl_assid() {
+        return bl_assid;
+    }
+
+    public void setBl_assid(Integer bl_assid) {
+        this.bl_assid = bl_assid;
+    }
+
+    public String getBl_item() {
+        return bl_item;
+    }
+
+    public void setBl_item(String bl_item) {
+        this.bl_item = bl_item;
+    }
+
     public Integer getBl_id() {
         return bl_id;
     }

+ 141 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Subledger.java

@@ -0,0 +1,141 @@
+package com.usoftchina.saas.money.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+//中间表
+public class Subledger extends CommonBaseEntity implements Serializable {
+
+    private String sl_code;
+
+    private String sl_kind;
+
+    private Integer sl_custid;
+
+    private Integer sl_vendid;
+
+    private Date sl_date;
+
+    private Double sl_amount;
+
+    private Double sl_preamount;
+
+    private Double sl_yamount;
+
+    private Double sl_namount;
+
+    private String sl_remark;
+
+    private Double sl_orderamount;
+
+    private Double sl_discount;
+
+    private Integer sl_ym;
+
+    public String getSl_code() {
+        return sl_code;
+    }
+
+    public void setSl_code(String sl_code) {
+        this.sl_code = sl_code;
+    }
+
+    public String getSl_kind() {
+        return sl_kind;
+    }
+
+    public void setSl_kind(String sl_kind) {
+        this.sl_kind = sl_kind;
+    }
+
+    public Integer getSl_custid() {
+        return sl_custid;
+    }
+
+    public void setSl_custid(Integer sl_custid) {
+        this.sl_custid = sl_custid;
+    }
+
+    public Integer getSl_vendid() {
+        return sl_vendid;
+    }
+
+    public void setSl_vendid(Integer sl_vendid) {
+        this.sl_vendid = sl_vendid;
+    }
+
+    public Date getSl_date() {
+        return sl_date;
+    }
+
+    public void setSl_date(Date sl_date) {
+        this.sl_date = sl_date;
+    }
+
+    public Double getSl_amount() {
+        return sl_amount;
+    }
+
+    public void setSl_amount(Double sl_amount) {
+        this.sl_amount = sl_amount;
+    }
+
+    public Double getSl_preamount() {
+        return sl_preamount;
+    }
+
+    public void setSl_preamount(Double sl_preamount) {
+        this.sl_preamount = sl_preamount;
+    }
+
+    public Double getSl_yamount() {
+        return sl_yamount;
+    }
+
+    public void setSl_yamount(Double sl_yamount) {
+        this.sl_yamount = sl_yamount;
+    }
+
+    public Double getSl_namount() {
+        return sl_namount;
+    }
+
+    public void setSl_namount(Double sl_namount) {
+        this.sl_namount = sl_namount;
+    }
+
+    public String getSl_remark() {
+        return sl_remark;
+    }
+
+    public void setSl_remark(String sl_remark) {
+        this.sl_remark = sl_remark;
+    }
+
+
+    public Double getSl_orderamount() {
+        return sl_orderamount;
+    }
+
+    public void setSl_orderamount(Double sl_orderamount) {
+        this.sl_orderamount = sl_orderamount;
+    }
+
+    public Double getSl_discount() {
+        return sl_discount;
+    }
+
+    public void setSl_discount(Double sl_discount) {
+        this.sl_discount = sl_discount;
+    }
+
+    public Integer getSl_ym() {
+        return sl_ym;
+    }
+
+    public void setSl_ym(Integer sl_ym) {
+        this.sl_ym = sl_ym;
+    }
+}

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/BanksubledgerService.java

@@ -1,5 +1,7 @@
 package com.usoftchina.saas.money.service;
 
+import com.usoftchina.saas.money.po.Banksubledger;
+
 /**
  * @author hx
  * @createtime 2018-10-19 15:59

+ 14 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/SubledgerService.java

@@ -0,0 +1,14 @@
+package com.usoftchina.saas.money.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.money.po.Subledger;
+import com.usoftchina.saas.page.PageRequest;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 11:07
+ **/
+public interface SubledgerService {
+    PageInfo<Subledger> seleteList(PageRequest page, ListReqDTO reqDTO);
+}

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/BanksubledgerServiceImpl.java

@@ -1,10 +1,12 @@
 package com.usoftchina.saas.money.service.impl;
 
 import com.usoftchina.saas.money.service.BanksubledgerService;
+import org.springframework.stereotype.Service;
 
 /**
  * @author hx
  * @createtime 2018-10-19 16:00
  */
+@Service
 public class BanksubledgerServiceImpl implements BanksubledgerService {
 }

+ 90 - 3
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java

@@ -11,12 +11,11 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
-import com.usoftchina.saas.money.mapper.PaybalanceMapper;
-import com.usoftchina.saas.money.mapper.PaybalancedetMapper;
-import com.usoftchina.saas.money.mapper.PaybalancedetailMapper;
+import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.PaybalanceService;
 import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -38,6 +37,10 @@ public class PaybalanceServiceImpl implements PaybalanceService {
     private PaybalancedetailMapper paybalancedetailMapper;
     @Autowired
     private MaxnumberService maxnumberService;
+    @Autowired
+    private SubledgerMapper subledgerMapper;
+    @Autowired
+    private BanksubledgerMapper banksubledgerMapper;
 
     public DocBaseDTO insert(Pay pay) {
         Paybalance paybalance = pay.getMain();
@@ -99,6 +102,11 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         paybalance.setPb_status(Status.AUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.AUDITED.name());
         paybalance.setCompanyId(companyId);
+        Subledger subledger = this.changSubledgerUntil(paybalance);
+        subledgerMapper.insertSelective(subledger);
+        this.changBankUntil(pay);
+        System.out.println("新增");
+        this.changBankUntil(pay);
         if ( paybalance == null || "".equals(paybalance)){
             this.insert(pay);
         }else {
@@ -113,6 +121,11 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.UNAUDITED.name());
         paybalanceMapper.updateByPrimaryKeySelective(paybalance);
+
+        //删除中间表
+        paybalance = paybalanceMapper.selectByPrimaryKey(id);
+        subledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
+        banksubledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
     }
 
 
@@ -219,4 +232,78 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         }
         return paybalanceList;
     }
+
+
+    //插入中间表
+    public Subledger changSubledgerUntil(Paybalance paybalance){
+        Subledger subledger = new Subledger();
+//        BeanUtils.copyProperties(subledger, paybalance);
+        subledger.setCompanyId(BaseContextHolder.getCompanyId());
+        subledger.setSl_code(paybalance.getPb_code());
+        subledger.setSl_kind(paybalance.getPb_kind());
+        subledger.setSl_custid(0);
+//        subledger.setSl_vendid(paybalance.getPb_vendid());
+        subledger.setSl_vendid(1);
+        subledger.setSl_date(paybalance.getPb_date());
+        if (paybalance.getPb_pdamount() == null){
+            subledger.setSl_amount((double) 0);
+        }else {
+            subledger.setSl_amount(paybalance.getPb_pdamount() * -1);
+        }
+        subledger.setSl_orderamount(paybalance.getPb_pdamount());
+
+        Double yamount = paybalance.getPb_preamount();
+        if (yamount == null){
+            yamount = Double.valueOf(0);
+        }
+        if (yamount > 0 || yamount < 0){
+            subledger.setSl_yamount(yamount);
+        }else {
+            subledger.setSl_yamount((double) 0);
+        }
+        if (subledger.getSl_orderamount() == null){
+            subledger.setSl_orderamount((double) 0);
+        }
+
+        if (subledger.getSl_discount() == null){
+            subledger.setSl_discount((double) 0);
+        }
+        subledger.setSl_namount(subledger.getSl_orderamount() + subledger.getSl_discount() - subledger.getSl_yamount());
+        subledger.setSl_remark(subledger.getSl_remark());
+        subledger.setSl_preamount(subledger.getSl_preamount());
+
+        return subledger;
+    }
+
+    //插入bank中间表
+    public void changBankUntil(Pay pay){
+        Banksubledger banksubledger = new Banksubledger();
+        Paybalance paybalance = pay.getMain();
+        List<Paybalancedet> paybalancedetList = pay.getItems1();
+        Iterator isList = paybalancedetList.iterator();
+        while (isList.hasNext()) {
+            Paybalancedet paybalancedet = (Paybalancedet) isList.next();
+            banksubledger.setCompanyId(BaseContextHolder.getCompanyId());
+            banksubledger.setBl_ym(paybalancedet.getPd_ym());
+            banksubledger.setBl_bankid(paybalancedet.getPd_bankid());
+            banksubledger.setBl_bankcode(paybalancedet.getPd_bankcode());
+            banksubledger.setBl_bankname(paybalancedet.getPd_bankname());
+            banksubledger.setBl_code(paybalance.getPb_code());
+            banksubledger.setBl_kind(paybalance.getPb_kind());
+            banksubledger.setBl_date(paybalance.getPb_date());
+
+            if (paybalance.getPb_vendid() == null || paybalance.getPb_vendid() != 0){
+                banksubledger.setBl_asscode("供应商往来");
+            }
+            banksubledger.setBl_assid(paybalance.getPb_vendid());
+            banksubledger.setBl_code(paybalance.getPb_code());
+            banksubledger.setBl_assname(paybalance.getPb_vendname());
+            banksubledger.setBl_spending(paybalancedet.getPd_amount());
+            banksubledger.setBl_manname(paybalance.getPb_manname());
+            banksubledger.setBl_remark(paybalancedet.getPd_remark());
+            banksubledger.setBl_orderamount(paybalancedet.getPd_amount() * -1);
+            banksubledgerMapper.insertSelective(banksubledger);
+
+        }
+    }
 }

+ 55 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/SubledgerServiceImpl.java

@@ -0,0 +1,55 @@
+package com.usoftchina.saas.money.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.money.mapper.SubledgerMapper;
+import com.usoftchina.saas.money.po.Recbalance;
+import com.usoftchina.saas.money.po.Subledger;
+import com.usoftchina.saas.money.service.SubledgerService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.util.List;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 11:09
+ **/
+@Service
+public class SubledgerServiceImpl implements SubledgerService {
+    @Autowired
+    private SubledgerMapper subledgerMapper;
+
+    @Override
+    public PageInfo<Subledger> seleteList(PageRequest page, ListReqDTO reqDTO) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<Subledger> subledgerList = this.getListByMode(reqDTO);
+        //取分页信息
+        PageInfo<Subledger> pageInfo = new PageInfo<Subledger>(subledgerList);
+        return pageInfo;
+    }
+
+    private List<Subledger> getListByMode(ListReqDTO req) {
+        List<Subledger> subledgerList = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(req)) {
+            return  null;
+        }
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        subledgerList = subledgerMapper.selectSubledgerBycondition(con, companyId);
+        return subledgerList;
+    }
+}

+ 41 - 26
applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.usoftchina.saas.money.mapper.BanksubledgerMapper">
     <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Banksubledger">
-        <id column="bl_id" jdbcType="INTEGER" property="bl_id" />
+        <id column="bl_id" jdbcType="INTEGER" property="id" />
         <result column="bl_ym" jdbcType="INTEGER" property="bl_ym" />
         <result column="bl_bankid" jdbcType="INTEGER" property="bl_bankid" />
         <result column="bl_bankcode" jdbcType="VARCHAR" property="bl_bankcode" />
@@ -17,9 +17,12 @@
         <result column="bl_spending" jdbcType="DOUBLE" property="bl_spending" />
         <result column="bl_manname" jdbcType="VARCHAR" property="bl_manname" />
         <result column="bl_remark" jdbcType="VARCHAR" property="bl_remark" />
-        <result column="companyid" jdbcType="INTEGER" property="companyid" />
+        <result column="companyId" jdbcType="INTEGER" property="companyId" />
         <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
         <result column="updatedate" jdbcType="TIMESTAMP" property="updatedate" />
+        <result column="bl_orderamount" property="bl_orderamount" jdbcType="DOUBLE" />
+        <result column="bl_assid" property="bl_assid" jdbcType="INTEGER" />
+        <result column="bl_item" property="bl_item" jdbcType="VARCHAR" />
     </resultMap>
     <sql id="Example_Where_Clause">
         <where>
@@ -81,8 +84,8 @@
     </sql>
     <sql id="Base_Column_List">
     bl_id, bl_ym, bl_bankid, bl_bankcode, bl_bankname, bl_code, bl_kind, bl_date, bl_asstype, 
-    bl_asscode, bl_assname, bl_income, bl_spending, bl_manname, bl_remark, companyid, 
-    updaterId, updatedate
+    bl_asscode, bl_assname, bl_income, bl_spending, bl_manname, bl_remark, companyId, 
+    updaterId, updatedate, bl_orderamount, bl_assid, bl_item
   </sql>
     <select id="selectByExample" parameterType="com.usoftchina.saas.money.po.BanksubledgerExample" resultMap="BaseResultMap">
         select
@@ -106,7 +109,7 @@
     </select>
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from banksubledger
-    where bl_id = #{bl_id,jdbcType=INTEGER}
+    where bl_id = #{code,jdbcType=VARCHAR} and bl_kind = #{kind, jdbcType=VARCHAR}
   </delete>
     <delete id="deleteByExample" parameterType="com.usoftchina.saas.money.po.BanksubledgerExample">
         delete from banksubledger
@@ -120,22 +123,19 @@
       bl_kind, bl_date, bl_asstype, 
       bl_asscode, bl_assname, bl_income, 
       bl_spending, bl_manname, bl_remark, 
-      companyid, updaterId, updatedate
+      companyId, updaterId, updatedate
       )
     values (#{bl_id,jdbcType=INTEGER}, #{bl_ym,jdbcType=INTEGER}, #{bl_bankid,jdbcType=INTEGER}, 
       #{bl_bankcode,jdbcType=VARCHAR}, #{bl_bankname,jdbcType=VARCHAR}, #{bl_code,jdbcType=VARCHAR}, 
       #{bl_kind,jdbcType=VARCHAR}, #{bl_date,jdbcType=TIMESTAMP}, #{bl_asstype,jdbcType=VARCHAR}, 
       #{bl_asscode,jdbcType=VARCHAR}, #{bl_assname,jdbcType=VARCHAR}, #{bl_income,jdbcType=DOUBLE}, 
       #{bl_spending,jdbcType=DOUBLE}, #{bl_manname,jdbcType=VARCHAR}, #{bl_remark,jdbcType=VARCHAR}, 
-      #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}
       )
   </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Banksubledger">
         insert into banksubledger
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="bl_id != null">
-                bl_id,
-            </if>
             <if test="bl_ym != null">
                 bl_ym,
             </if>
@@ -178,20 +178,26 @@
             <if test="bl_remark != null">
                 bl_remark,
             </if>
-            <if test="companyid != null">
-                companyid,
+            <if test="companyId != null">
+                companyId,
             </if>
             <if test="updaterId != null">
                 updaterId,
             </if>
-            <if test="updatedate != null">
+            <if test="updateTime != null">
                 updatedate,
             </if>
+            <if test="bl_orderamount != null" >
+                bl_orderamount,
+            </if>
+            <if test="bl_assid != null" >
+                bl_assid,
+            </if>
+            <if test="bl_item != null" >
+                bl_item,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="bl_id != null">
-                #{bl_id,jdbcType=INTEGER},
-            </if>
             <if test="bl_ym != null">
                 #{bl_ym,jdbcType=INTEGER},
             </if>
@@ -234,14 +240,23 @@
             <if test="bl_remark != null">
                 #{bl_remark,jdbcType=VARCHAR},
             </if>
-            <if test="companyid != null">
-                #{companyid,jdbcType=INTEGER},
+            <if test="companyId != null">
+                #{companyId,jdbcType=INTEGER},
             </if>
             <if test="updaterId != null">
                 #{updaterId,jdbcType=INTEGER},
             </if>
-            <if test="updatedate != null">
-                #{updatedate,jdbcType=TIMESTAMP},
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="bl_orderamount != null" >
+                #{bl_orderamount,jdbcType=DOUBLE},
+            </if>
+            <if test="bl_assid != null" >
+                #{bl_assid,jdbcType=INTEGER},
+            </if>
+            <if test="bl_item != null" >
+                #{bl_item,jdbcType=VARCHAR},
             </if>
         </trim>
     </insert>
@@ -299,8 +314,8 @@
             <if test="record.bl_remark != null">
                 bl_remark = #{record.bl_remark,jdbcType=VARCHAR},
             </if>
-            <if test="record.companyid != null">
-                companyid = #{record.companyid,jdbcType=INTEGER},
+            <if test="record.companyId != null">
+                companyId = #{record.companyId,jdbcType=INTEGER},
             </if>
             <if test="record.updaterId != null">
                 updaterId = #{record.updaterId,jdbcType=INTEGER},
@@ -330,7 +345,7 @@
         bl_spending = #{record.bl_spending,jdbcType=DOUBLE},
         bl_manname = #{record.bl_manname,jdbcType=VARCHAR},
         bl_remark = #{record.bl_remark,jdbcType=VARCHAR},
-        companyid = #{record.companyid,jdbcType=INTEGER},
+        companyId = #{record.companyId,jdbcType=INTEGER},
         updaterId = #{record.updaterId,jdbcType=INTEGER},
         updatedate = #{record.updatedate,jdbcType=TIMESTAMP}
         <if test="_parameter != null">
@@ -382,8 +397,8 @@
             <if test="bl_remark != null">
                 bl_remark = #{bl_remark,jdbcType=VARCHAR},
             </if>
-            <if test="companyid != null">
-                companyid = #{companyid,jdbcType=INTEGER},
+            <if test="companyId != null">
+                companyId = #{companyId,jdbcType=INTEGER},
             </if>
             <if test="updaterId != null">
                 updaterId = #{updaterId,jdbcType=INTEGER},
@@ -410,7 +425,7 @@
       bl_spending = #{bl_spending,jdbcType=DOUBLE},
       bl_manname = #{bl_manname,jdbcType=VARCHAR},
       bl_remark = #{bl_remark,jdbcType=VARCHAR},
-      companyid = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updatedate = #{updatedate,jdbcType=TIMESTAMP}
     where bl_id = #{bl_id,jdbcType=INTEGER}

+ 244 - 0
applications/money/money-server/src/main/resources/mapper/SubledgerMapper.xml

@@ -0,0 +1,244 @@
+<?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.usoftchina.saas.money.mapper.SubledgerMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Subledger" >
+    <id column="sl_id" property="id" jdbcType="INTEGER" />
+    <result column="sl_code" property="sl_code" jdbcType="VARCHAR" />
+    <result column="sl_kind" property="sl_kind" jdbcType="VARCHAR" />
+    <result column="sl_custid" property="sl_custid" jdbcType="INTEGER" />
+    <result column="sl_vendid" property="sl_vendid" jdbcType="INTEGER" />
+    <result column="sl_date" property="sl_date" jdbcType="TIMESTAMP" />
+    <result column="sl_amount" property="sl_amount" jdbcType="DOUBLE" />
+    <result column="sl_preamount" property="sl_preamount" jdbcType="DOUBLE" />
+    <result column="sl_yamount" property="sl_yamount" jdbcType="DOUBLE" />
+    <result column="sl_namount" property="sl_namount" jdbcType="DOUBLE" />
+    <result column="sl_remark" property="sl_remark" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="sl_orderamount" property="sl_orderamount" jdbcType="DOUBLE" />
+    <result column="sl_discount" property="sl_discount" jdbcType="DOUBLE" />
+    <result column="sl_ym" property="sl_ym" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    sl_id, sl_code, sl_kind, sl_custid, sl_vendid, sl_date, sl_amount, sl_preamount, 
+    sl_yamount, sl_namount, sl_remark, companyId, updaterId, updateTime, sl_orderamount, 
+    sl_discount, sl_ym
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from subledger
+    where sl_id = #{sl_id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from subledger
+    where sl_code = #{code,jdbcType=VARCHAR} and sl_kind = #{kind, jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    insert into subledger (sl_id, sl_code, sl_kind, 
+      sl_custid, sl_vendid, sl_date, 
+      sl_amount, sl_preamount, sl_yamount, 
+      sl_namount, sl_remark, companyId, 
+      updaterId, updateTime, sl_orderamount, 
+      sl_discount, sl_ym)
+    values (#{sl_id,jdbcType=INTEGER}, #{sl_code,jdbcType=VARCHAR}, #{sl_kind,jdbcType=VARCHAR}, 
+      #{sl_custid,jdbcType=INTEGER}, #{sl_vendid,jdbcType=INTEGER}, #{sl_date,jdbcType=TIMESTAMP}, 
+      #{sl_amount,jdbcType=DOUBLE}, #{sl_preamount,jdbcType=DOUBLE}, #{sl_yamount,jdbcType=DOUBLE}, 
+      #{sl_namount,jdbcType=DOUBLE}, #{sl_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, 
+      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{sl_orderamount,jdbcType=DOUBLE}, 
+      #{sl_discount,jdbcType=DOUBLE}, #{sl_ym,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    insert into subledger
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="sl_code != null" >
+        sl_code,
+      </if>
+      <if test="sl_kind != null" >
+        sl_kind,
+      </if>
+      <if test="sl_custid != null" >
+        sl_custid,
+      </if>
+      <if test="sl_vendid != null" >
+        sl_vendid,
+      </if>
+      <if test="sl_date != null" >
+        sl_date,
+      </if>
+      <if test="sl_amount != null" >
+        sl_amount,
+      </if>
+      <if test="sl_preamount != null" >
+        sl_preamount,
+      </if>
+      <if test="sl_yamount != null" >
+        sl_yamount,
+      </if>
+      <if test="sl_namount != null" >
+        sl_namount,
+      </if>
+      <if test="sl_remark != null" >
+        sl_remark,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="sl_orderamount != null" >
+        sl_orderamount,
+      </if>
+      <if test="sl_discount != null" >
+        sl_discount,
+      </if>
+      <if test="sl_ym != null" >
+        sl_ym,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="sl_code != null" >
+        #{sl_code,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_kind != null" >
+        #{sl_kind,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_custid != null" >
+        #{sl_custid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_vendid != null" >
+        #{sl_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_date != null" >
+        #{sl_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_amount != null" >
+        #{sl_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_preamount != null" >
+        #{sl_preamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_yamount != null" >
+        #{sl_yamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_namount != null" >
+        #{sl_namount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_remark != null" >
+        #{sl_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_orderamount != null" >
+        #{sl_orderamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_discount != null" >
+        #{sl_discount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_ym != null" >
+        #{sl_ym,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    update subledger
+    <set >
+      <if test="sl_code != null" >
+        sl_code = #{sl_code,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_kind != null" >
+        sl_kind = #{sl_kind,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_custid != null" >
+        sl_custid = #{sl_custid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_vendid != null" >
+        sl_vendid = #{sl_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_date != null" >
+        sl_date = #{sl_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_amount != null" >
+        sl_amount = #{sl_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_preamount != null" >
+        sl_preamount = #{sl_preamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_yamount != null" >
+        sl_yamount = #{sl_yamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_namount != null" >
+        sl_namount = #{sl_namount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_remark != null" >
+        sl_remark = #{sl_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_orderamount != null" >
+        sl_orderamount = #{sl_orderamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_discount != null" >
+        sl_discount = #{sl_discount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_ym != null" >
+        sl_ym = #{sl_ym,jdbcType=INTEGER},
+      </if>
+    </set>
+    where sl_id = #{sl_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    update subledger
+    set sl_code = #{sl_code,jdbcType=VARCHAR},
+      sl_kind = #{sl_kind,jdbcType=VARCHAR},
+      sl_custid = #{sl_custid,jdbcType=INTEGER},
+      sl_vendid = #{sl_vendid,jdbcType=INTEGER},
+      sl_date = #{sl_date,jdbcType=TIMESTAMP},
+      sl_amount = #{sl_amount,jdbcType=DOUBLE},
+      sl_preamount = #{sl_preamount,jdbcType=DOUBLE},
+      sl_yamount = #{sl_yamount,jdbcType=DOUBLE},
+      sl_namount = #{sl_namount,jdbcType=DOUBLE},
+      sl_remark = #{sl_remark,jdbcType=VARCHAR},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      sl_orderamount = #{sl_orderamount,jdbcType=DOUBLE},
+      sl_discount = #{sl_discount,jdbcType=DOUBLE},
+      sl_ym = #{sl_ym,jdbcType=INTEGER}
+    where sl_id = #{sl_id,jdbcType=INTEGER}
+  </update>
+
+  <select id="selectSubledgerBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from subledger
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   subledger.companyId = #{companyId}
+      </if>
+    </where>  order by sl_id
+  </select>
+
+</mapper>