From 498a0da6ce7503d73e31119aa265c793d6532b8f Mon Sep 17 00:00:00 2001
From: liuy <37787198+LiuyCodes@users.noreply.github.com>
Date: Thu, 17 Oct 2024 17:01:29 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3=E5=92=8C?=
 =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=B1=BB=E4=BB=A5=E6=9F=A5=E8=AF=A2=E5=AD=98?=
 =?UTF-8?q?=E8=B4=A7=E7=BB=93=E5=AD=98=E4=BB=B7=E5=92=8C=E6=9C=80=E6=96=B0?=
 =?UTF-8?q?=E9=87=87=E8=B4=AD=E4=BB=B7-=20=E6=B7=BB=E5=8A=A0=20IIaPeriodac?=
 =?UTF-8?q?countDao=E6=8E=A5=E5=8F=A3=EF=BC=8C=E7=94=A8=E4=BA=8E=E6=9F=A5?=
 =?UTF-8?q?=E8=AF=A2=E5=AD=98=E8=B4=A7=E7=BB=93=E5=AD=98=E4=BB=B7=20-=20?=
 =?UTF-8?q?=E5=AE=9E=E7=8E=B0=20IaPeriodaccountDaoImpl=20=E7=B1=BB?=
 =?UTF-8?q?=EF=BC=8C=E5=AE=9E=E7=8E=B0=E4=B8=8A=E8=BF=B0=E6=8E=A5=E5=8F=A3?=
 =?UTF-8?q?=20-=20=E5=9C=A8=20IPoOrderBDao=20=E6=8E=A5=E5=8F=A3=E6=96=B0?=
 =?UTF-8?q?=E5=A2=9E=E6=9F=A5=E8=AF=A2=E6=9C=80=E6=96=B0=E9=87=87=E8=B4=AD?=
 =?UTF-8?q?=E4=BB=B7=E7=9A=84=E6=96=B9=E6=B3=95=20-=20=E5=9C=A8=20PoOrderB?=
 =?UTF-8?q?DaoImpl=20=E7=B1=BB=E4=B8=AD=E5=AE=9E=E7=8E=B0=E6=96=B0?=
 =?UTF-8?q?=E6=96=B9=E6=B3=95=20-=20=E5=88=9B=E5=BB=BA=20IaPeriodaccountEn?=
 =?UTF-8?q?tity=20=E5=AE=9E=E4=BD=93=E7=B1=BB=EF=BC=8C=E7=94=A8=E4=BA=8E?=
 =?UTF-8?q?=E5=A4=84=E7=90=86=E5=AD=98=E8=B4=A7=E4=BC=9A=E8=AE=A1=E6=9C=9F?=
 =?UTF-8?q?=E9=97=B4=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../plugin/lets/dao/IIaPeriodaccountDao.java  |   22 +
 .../frame/plugin/lets/dao/IPoOrderBDao.java   |    9 +-
 .../lets/dao/impl/IaPeriodaccountDaoImpl.java |   22 +
 .../plugin/lets/dao/impl/PoOrderBDaoImpl.java |    7 +-
 .../lets/entity/IaPeriodaccountEntity.java    |   71 ++
 .../lets/entity/IaPeriodaccountEntity.xml     |  676 +++++++++++
 .../plugin/lets/entity/PoOrderBEntity.java    | 1080 +----------------
 .../plugin/lets/entity/PoOrderBEntity.xml     |   26 +
 .../lets/util/BalanceUnitPriceUtil.java       |   85 ++
 .../plugin/lets/spring/spring-lets-dao.xml    |    2 +
 10 files changed, 926 insertions(+), 1074 deletions(-)
 create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIaPeriodaccountDao.java
 create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IaPeriodaccountDaoImpl.java
 create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaPeriodaccountEntity.java
 create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaPeriodaccountEntity.xml
 create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/BalanceUnitPriceUtil.java

diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIaPeriodaccountDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIaPeriodaccountDao.java
new file mode 100644
index 00000000..91485f0f
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IIaPeriodaccountDao.java
@@ -0,0 +1,22 @@
+package com.hzya.frame.plugin.lets.dao;
+
+import com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity;
+import com.hzya.frame.basedao.dao.IBaseDao;
+
+import java.util.List;
+
+/**
+ * (IA_PERIODACCOUNT: table)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-10-17 10:06:10
+ */
+public interface IIaPeriodaccountDao extends IBaseDao<IaPeriodaccountEntity, String> {
+    /**
+     * 查询存货对应的结存单价
+     *
+     * @author liuyang
+     */
+    List<IaPeriodaccountEntity> queryBalancePrice(IaPeriodaccountEntity iaPeriodaccountEntity) throws Exception;
+}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IPoOrderBDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IPoOrderBDao.java
index 4ce55bfb..df894ce3 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IPoOrderBDao.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/IPoOrderBDao.java
@@ -3,6 +3,8 @@ package com.hzya.frame.plugin.lets.dao;
 import com.hzya.frame.basedao.dao.IBaseDao;
 import com.hzya.frame.plugin.lets.entity.PoOrderBEntity;
 
+import java.util.List;
+
 /**
  * (po_order_b: table)表数据库访问层
  *
@@ -10,5 +12,10 @@ import com.hzya.frame.plugin.lets.entity.PoOrderBEntity;
  * @since 2023-08-25 08:53:25
  */
 public interface IPoOrderBDao extends IBaseDao<PoOrderBEntity, String> {
-
+    /**
+     * 查询存货对应的最新采购价
+     *
+     * @author liuyang
+     */
+    List<PoOrderBEntity> queryPurchaseUnitPriceByInvcodes(PoOrderBEntity poOrderBEntity) throws Exception;
 }
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IaPeriodaccountDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IaPeriodaccountDaoImpl.java
new file mode 100644
index 00000000..0487d71f
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/IaPeriodaccountDaoImpl.java
@@ -0,0 +1,22 @@
+package com.hzya.frame.plugin.lets.dao.impl;
+
+import com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity;
+import com.hzya.frame.plugin.lets.dao.IIaPeriodaccountDao;
+import org.springframework.stereotype.Repository;
+import com.hzya.frame.basedao.dao.MybatisGenericDao;
+
+import java.util.List;
+
+/**
+ * (IaPeriodaccount)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-10-17 10:06:10
+ */
+public class IaPeriodaccountDaoImpl extends MybatisGenericDao<IaPeriodaccountEntity, String> implements IIaPeriodaccountDao {
+    @Override
+    public List<IaPeriodaccountEntity> queryBalancePrice(IaPeriodaccountEntity iaPeriodaccountEntity) throws Exception {
+        return query("com.hzya.frame.plugin.lets.dao.impl.IaPeriodaccountDaoImpl.queryBalancePrice", iaPeriodaccountEntity);
+    }
+}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/PoOrderBDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/PoOrderBDaoImpl.java
index 05b1e16c..30b983a9 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/PoOrderBDaoImpl.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/dao/impl/PoOrderBDaoImpl.java
@@ -4,6 +4,8 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
 import com.hzya.frame.plugin.lets.dao.IPoOrderBDao;
 import com.hzya.frame.plugin.lets.entity.PoOrderBEntity;
 
+import java.util.List;
+
 /**
  * (PoOrderB)表数据库访问层
  *
@@ -12,5 +14,8 @@ import com.hzya.frame.plugin.lets.entity.PoOrderBEntity;
  */
 //@Repository("PoOrderBDaoImpl")
 public class PoOrderBDaoImpl extends MybatisGenericDao<PoOrderBEntity, String> implements IPoOrderBDao {
-
+    @Override
+    public List<PoOrderBEntity> queryPurchaseUnitPriceByInvcodes(PoOrderBEntity poOrderBEntity) throws Exception {
+        return query("com.hzya.frame.plugin.lets.dao.impl.PoOrderBDaoImpl.queryPurchaseUnitPriceByInvcodes", poOrderBEntity);
+    }
 }
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaPeriodaccountEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaPeriodaccountEntity.java
new file mode 100644
index 00000000..a68f4258
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaPeriodaccountEntity.java
@@ -0,0 +1,71 @@
+package com.hzya.frame.plugin.lets.entity;
+
+import com.hzya.frame.web.entity.BaseEntity;
+import lombok.Data;
+
+/**
+ * (IaPeriodaccount)实体类
+ *
+ * @author makejava
+ * @since 2024-10-17 10:06:10
+ */
+@Data
+public class IaPeriodaccountEntity extends BaseEntity {
+    private String caccountmonth;
+    private String caccountyear;
+    private String cagentid;
+    private String castunitid;
+    private String ccustomvendorid;
+    private String cdeptid;
+    private String cemployeeid;
+    private String cinventoryid;
+    private String coperatorid;
+    private String cprojectid;
+    private String cprojectphase;
+    private String crdcenterid;
+    private String cstockrdcenterid;
+    private String cvendorid;
+    private String cwarehouseid;
+    private String cwarehousemanagerid;
+    private String cwp;
+    private String dr;
+    private String fpricemodeflag;
+    private String nabassistnum;
+    private String nabmny;
+    private String nabnum;
+    private String nabplanedmny;
+    private String nabvarymny;
+    private String ndrawsummny;
+    private String ninassistnum;
+    private String ninmny;
+    private String ninnum;
+    private String ninplanedmny;
+    private String ninvarymny;
+    private String noutassistnum;
+    private String noutmny;
+    private String noutnum;
+    private String noutplanedmny;
+    private String noutvarymny;
+    private String pkCorp;
+    private String ts;
+    private String vbatch;
+    private String vfree1;
+    private String vfree10;
+    private String vfree2;
+    private String vfree3;
+    private String vfree4;
+    private String vfree5;
+    private String vfree6;
+    private String vfree7;
+    private String vfree8;
+    private String vfree9;
+    private String vproducebatch;
+
+
+    //查询结存价依赖的参数
+    private String pk_invmandoc;
+    private String pk_corp;
+    private String unitname;
+    private String invcode;
+    private String invcodes;
+}
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaPeriodaccountEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaPeriodaccountEntity.xml
new file mode 100644
index 00000000..a9a551d6
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/IaPeriodaccountEntity.xml
@@ -0,0 +1,676 @@
+<?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.hzya.frame.plugin.lets.dao.impl.IaPeriodaccountDaoImpl">
+
+    <resultMap id="get-IaPeriodaccountEntity-result" type="com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity" >
+       <result property="caccountmonth" column="CACCOUNTMONTH" jdbcType="VARCHAR"/>
+           <result property="caccountyear" column="CACCOUNTYEAR" jdbcType="VARCHAR"/>
+           <result property="cagentid" column="CAGENTID" jdbcType="VARCHAR"/>
+           <result property="castunitid" column="CASTUNITID" jdbcType="VARCHAR"/>
+           <result property="ccustomvendorid" column="CCUSTOMVENDORID" jdbcType="VARCHAR"/>
+           <result property="cdeptid" column="CDEPTID" jdbcType="VARCHAR"/>
+           <result property="cemployeeid" column="CEMPLOYEEID" jdbcType="VARCHAR"/>
+           <result property="cinventoryid" column="CINVENTORYID" jdbcType="VARCHAR"/>
+           <result property="coperatorid" column="COPERATORID" jdbcType="VARCHAR"/>
+           <result property="cprojectid" column="CPROJECTID" jdbcType="VARCHAR"/>
+           <result property="cprojectphase" column="CPROJECTPHASE" jdbcType="VARCHAR"/>
+           <result property="crdcenterid" column="CRDCENTERID" jdbcType="VARCHAR"/>
+           <result property="cstockrdcenterid" column="CSTOCKRDCENTERID" jdbcType="VARCHAR"/>
+           <result property="cvendorid" column="CVENDORID" jdbcType="VARCHAR"/>
+           <result property="cwarehouseid" column="CWAREHOUSEID" jdbcType="VARCHAR"/>
+           <result property="cwarehousemanagerid" column="CWAREHOUSEMANAGERID" jdbcType="VARCHAR"/>
+           <result property="cwp" column="CWP" jdbcType="VARCHAR"/>
+           <result property="dr" column="DR" jdbcType="VARCHAR"/>
+           <result property="fpricemodeflag" column="FPRICEMODEFLAG" jdbcType="VARCHAR"/>
+           <result property="nabassistnum" column="NABASSISTNUM" jdbcType="VARCHAR"/>
+           <result property="nabmny" column="NABMNY" jdbcType="VARCHAR"/>
+           <result property="nabnum" column="NABNUM" jdbcType="VARCHAR"/>
+           <result property="nabplanedmny" column="NABPLANEDMNY" jdbcType="VARCHAR"/>
+           <result property="nabvarymny" column="NABVARYMNY" jdbcType="VARCHAR"/>
+           <result property="ndrawsummny" column="NDRAWSUMMNY" jdbcType="VARCHAR"/>
+           <result property="ninassistnum" column="NINASSISTNUM" jdbcType="VARCHAR"/>
+           <result property="ninmny" column="NINMNY" jdbcType="VARCHAR"/>
+           <result property="ninnum" column="NINNUM" jdbcType="VARCHAR"/>
+           <result property="ninplanedmny" column="NINPLANEDMNY" jdbcType="VARCHAR"/>
+           <result property="ninvarymny" column="NINVARYMNY" jdbcType="VARCHAR"/>
+           <result property="noutassistnum" column="NOUTASSISTNUM" jdbcType="VARCHAR"/>
+           <result property="noutmny" column="NOUTMNY" jdbcType="VARCHAR"/>
+           <result property="noutnum" column="NOUTNUM" jdbcType="VARCHAR"/>
+           <result property="noutplanedmny" column="NOUTPLANEDMNY" jdbcType="VARCHAR"/>
+           <result property="noutvarymny" column="NOUTVARYMNY" jdbcType="VARCHAR"/>
+           <result property="pkCorp" column="PK_CORP" jdbcType="VARCHAR"/>
+           <result property="ts" column="TS" jdbcType="VARCHAR"/>
+           <result property="vbatch" column="VBATCH" jdbcType="VARCHAR"/>
+           <result property="vfree1" column="VFREE1" jdbcType="VARCHAR"/>
+           <result property="vfree10" column="VFREE10" jdbcType="VARCHAR"/>
+           <result property="vfree2" column="VFREE2" jdbcType="VARCHAR"/>
+           <result property="vfree3" column="VFREE3" jdbcType="VARCHAR"/>
+           <result property="vfree4" column="VFREE4" jdbcType="VARCHAR"/>
+           <result property="vfree5" column="VFREE5" jdbcType="VARCHAR"/>
+           <result property="vfree6" column="VFREE6" jdbcType="VARCHAR"/>
+           <result property="vfree7" column="VFREE7" jdbcType="VARCHAR"/>
+           <result property="vfree8" column="VFREE8" jdbcType="VARCHAR"/>
+           <result property="vfree9" column="VFREE9" jdbcType="VARCHAR"/>
+           <result property="vproducebatch" column="VPRODUCEBATCH" jdbcType="VARCHAR"/>
+
+            <result property="pk_invmandoc" column="pk_invmandoc" jdbcType="VARCHAR"/>
+            <result property="unitname" column="unitname" jdbcType="VARCHAR"/>
+            <result property="invcode" column="invcode" jdbcType="VARCHAR"/>
+        </resultMap>
+    <!-- 查询的字段-->
+    <sql id = "IaPeriodaccountEntity_Base_Column_List">
+        CACCOUNTMONTH
+       ,CACCOUNTYEAR 
+        ,CAGENTID 
+        ,CASTUNITID 
+        ,CCUSTOMVENDORID 
+        ,CDEPTID 
+        ,CEMPLOYEEID 
+        ,CINVENTORYID 
+        ,COPERATORID 
+        ,CPROJECTID 
+        ,CPROJECTPHASE 
+        ,CRDCENTERID 
+        ,CSTOCKRDCENTERID 
+        ,CVENDORID 
+        ,CWAREHOUSEID 
+        ,CWAREHOUSEMANAGERID 
+        ,CWP 
+        ,DR 
+        ,FPRICEMODEFLAG 
+        ,NABASSISTNUM 
+        ,NABMNY 
+        ,NABNUM 
+        ,NABPLANEDMNY 
+        ,NABVARYMNY 
+        ,NDRAWSUMMNY 
+        ,NINASSISTNUM 
+        ,NINMNY 
+        ,NINNUM 
+        ,NINPLANEDMNY 
+        ,NINVARYMNY 
+        ,NOUTASSISTNUM 
+        ,NOUTMNY 
+        ,NOUTNUM 
+        ,NOUTPLANEDMNY 
+        ,NOUTVARYMNY 
+        ,PK_CORP 
+        ,TS 
+        ,VBATCH 
+        ,VFREE1 
+        ,VFREE10 
+        ,VFREE2 
+        ,VFREE3 
+        ,VFREE4 
+        ,VFREE5 
+        ,VFREE6 
+        ,VFREE7 
+        ,VFREE8 
+        ,VFREE9 
+        ,VPRODUCEBATCH 
+     </sql>
+ <!-- 查询 采用==查询 -->
+ <select id="entity_list_base" resultMap="get-IaPeriodaccountEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity">
+    select
+    <include refid="IaPeriodaccountEntity_Base_Column_List" />
+    from IA_PERIODACCOUNT
+    <trim prefix="where" prefixOverrides="and"> 
+        <if test="caccountmonth != null and caccountmonth != ''"> and CACCOUNTMONTH = #{caccountmonth} </if>
+            <if test="caccountyear != null and caccountyear != ''"> and CACCOUNTYEAR = #{caccountyear} </if>
+            <if test="cagentid != null and cagentid != ''"> and CAGENTID = #{cagentid} </if>
+            <if test="castunitid != null and castunitid != ''"> and CASTUNITID = #{castunitid} </if>
+            <if test="ccustomvendorid != null and ccustomvendorid != ''"> and CCUSTOMVENDORID = #{ccustomvendorid} </if>
+            <if test="cdeptid != null and cdeptid != ''"> and CDEPTID = #{cdeptid} </if>
+            <if test="cemployeeid != null and cemployeeid != ''"> and CEMPLOYEEID = #{cemployeeid} </if>
+            <if test="cinventoryid != null and cinventoryid != ''"> and CINVENTORYID = #{cinventoryid} </if>
+            <if test="coperatorid != null and coperatorid != ''"> and COPERATORID = #{coperatorid} </if>
+            <if test="cprojectid != null and cprojectid != ''"> and CPROJECTID = #{cprojectid} </if>
+            <if test="cprojectphase != null and cprojectphase != ''"> and CPROJECTPHASE = #{cprojectphase} </if>
+            <if test="crdcenterid != null and crdcenterid != ''"> and CRDCENTERID = #{crdcenterid} </if>
+            <if test="cstockrdcenterid != null and cstockrdcenterid != ''"> and CSTOCKRDCENTERID = #{cstockrdcenterid} </if>
+            <if test="cvendorid != null and cvendorid != ''"> and CVENDORID = #{cvendorid} </if>
+            <if test="cwarehouseid != null and cwarehouseid != ''"> and CWAREHOUSEID = #{cwarehouseid} </if>
+            <if test="cwarehousemanagerid != null and cwarehousemanagerid != ''"> and CWAREHOUSEMANAGERID = #{cwarehousemanagerid} </if>
+            <if test="cwp != null and cwp != ''"> and CWP = #{cwp} </if>
+            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
+            <if test="fpricemodeflag != null and fpricemodeflag != ''"> and FPRICEMODEFLAG = #{fpricemodeflag} </if>
+            <if test="nabassistnum != null and nabassistnum != ''"> and NABASSISTNUM = #{nabassistnum} </if>
+            <if test="nabmny != null and nabmny != ''"> and NABMNY = #{nabmny} </if>
+            <if test="nabnum != null and nabnum != ''"> and NABNUM = #{nabnum} </if>
+            <if test="nabplanedmny != null and nabplanedmny != ''"> and NABPLANEDMNY = #{nabplanedmny} </if>
+            <if test="nabvarymny != null and nabvarymny != ''"> and NABVARYMNY = #{nabvarymny} </if>
+            <if test="ndrawsummny != null and ndrawsummny != ''"> and NDRAWSUMMNY = #{ndrawsummny} </if>
+            <if test="ninassistnum != null and ninassistnum != ''"> and NINASSISTNUM = #{ninassistnum} </if>
+            <if test="ninmny != null and ninmny != ''"> and NINMNY = #{ninmny} </if>
+            <if test="ninnum != null and ninnum != ''"> and NINNUM = #{ninnum} </if>
+            <if test="ninplanedmny != null and ninplanedmny != ''"> and NINPLANEDMNY = #{ninplanedmny} </if>
+            <if test="ninvarymny != null and ninvarymny != ''"> and NINVARYMNY = #{ninvarymny} </if>
+            <if test="noutassistnum != null and noutassistnum != ''"> and NOUTASSISTNUM = #{noutassistnum} </if>
+            <if test="noutmny != null and noutmny != ''"> and NOUTMNY = #{noutmny} </if>
+            <if test="noutnum != null and noutnum != ''"> and NOUTNUM = #{noutnum} </if>
+            <if test="noutplanedmny != null and noutplanedmny != ''"> and NOUTPLANEDMNY = #{noutplanedmny} </if>
+            <if test="noutvarymny != null and noutvarymny != ''"> and NOUTVARYMNY = #{noutvarymny} </if>
+            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
+            <if test="ts != null and ts != ''"> and TS = #{ts} </if>
+            <if test="vbatch != null and vbatch != ''"> and VBATCH = #{vbatch} </if>
+            <if test="vfree1 != null and vfree1 != ''"> and VFREE1 = #{vfree1} </if>
+            <if test="vfree10 != null and vfree10 != ''"> and VFREE10 = #{vfree10} </if>
+            <if test="vfree2 != null and vfree2 != ''"> and VFREE2 = #{vfree2} </if>
+            <if test="vfree3 != null and vfree3 != ''"> and VFREE3 = #{vfree3} </if>
+            <if test="vfree4 != null and vfree4 != ''"> and VFREE4 = #{vfree4} </if>
+            <if test="vfree5 != null and vfree5 != ''"> and VFREE5 = #{vfree5} </if>
+            <if test="vfree6 != null and vfree6 != ''"> and VFREE6 = #{vfree6} </if>
+            <if test="vfree7 != null and vfree7 != ''"> and VFREE7 = #{vfree7} </if>
+            <if test="vfree8 != null and vfree8 != ''"> and VFREE8 = #{vfree8} </if>
+            <if test="vfree9 != null and vfree9 != ''"> and VFREE9 = #{vfree9} </if>
+            <if test="vproducebatch != null and vproducebatch != ''"> and VPRODUCEBATCH = #{vproducebatch} </if>
+            and sts='Y'
+    </trim>
+    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
+    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
+</select>
+    
+<!-- 查询符合条件的数量 -->
+<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity">
+        select  count(1)   from IA_PERIODACCOUNT
+    <trim prefix="where" prefixOverrides="and"> 
+        <if test="caccountmonth != null and caccountmonth != ''"> and CACCOUNTMONTH = #{caccountmonth} </if>
+            <if test="caccountyear != null and caccountyear != ''"> and CACCOUNTYEAR = #{caccountyear} </if>
+            <if test="cagentid != null and cagentid != ''"> and CAGENTID = #{cagentid} </if>
+            <if test="castunitid != null and castunitid != ''"> and CASTUNITID = #{castunitid} </if>
+            <if test="ccustomvendorid != null and ccustomvendorid != ''"> and CCUSTOMVENDORID = #{ccustomvendorid} </if>
+            <if test="cdeptid != null and cdeptid != ''"> and CDEPTID = #{cdeptid} </if>
+            <if test="cemployeeid != null and cemployeeid != ''"> and CEMPLOYEEID = #{cemployeeid} </if>
+            <if test="cinventoryid != null and cinventoryid != ''"> and CINVENTORYID = #{cinventoryid} </if>
+            <if test="coperatorid != null and coperatorid != ''"> and COPERATORID = #{coperatorid} </if>
+            <if test="cprojectid != null and cprojectid != ''"> and CPROJECTID = #{cprojectid} </if>
+            <if test="cprojectphase != null and cprojectphase != ''"> and CPROJECTPHASE = #{cprojectphase} </if>
+            <if test="crdcenterid != null and crdcenterid != ''"> and CRDCENTERID = #{crdcenterid} </if>
+            <if test="cstockrdcenterid != null and cstockrdcenterid != ''"> and CSTOCKRDCENTERID = #{cstockrdcenterid} </if>
+            <if test="cvendorid != null and cvendorid != ''"> and CVENDORID = #{cvendorid} </if>
+            <if test="cwarehouseid != null and cwarehouseid != ''"> and CWAREHOUSEID = #{cwarehouseid} </if>
+            <if test="cwarehousemanagerid != null and cwarehousemanagerid != ''"> and CWAREHOUSEMANAGERID = #{cwarehousemanagerid} </if>
+            <if test="cwp != null and cwp != ''"> and CWP = #{cwp} </if>
+            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
+            <if test="fpricemodeflag != null and fpricemodeflag != ''"> and FPRICEMODEFLAG = #{fpricemodeflag} </if>
+            <if test="nabassistnum != null and nabassistnum != ''"> and NABASSISTNUM = #{nabassistnum} </if>
+            <if test="nabmny != null and nabmny != ''"> and NABMNY = #{nabmny} </if>
+            <if test="nabnum != null and nabnum != ''"> and NABNUM = #{nabnum} </if>
+            <if test="nabplanedmny != null and nabplanedmny != ''"> and NABPLANEDMNY = #{nabplanedmny} </if>
+            <if test="nabvarymny != null and nabvarymny != ''"> and NABVARYMNY = #{nabvarymny} </if>
+            <if test="ndrawsummny != null and ndrawsummny != ''"> and NDRAWSUMMNY = #{ndrawsummny} </if>
+            <if test="ninassistnum != null and ninassistnum != ''"> and NINASSISTNUM = #{ninassistnum} </if>
+            <if test="ninmny != null and ninmny != ''"> and NINMNY = #{ninmny} </if>
+            <if test="ninnum != null and ninnum != ''"> and NINNUM = #{ninnum} </if>
+            <if test="ninplanedmny != null and ninplanedmny != ''"> and NINPLANEDMNY = #{ninplanedmny} </if>
+            <if test="ninvarymny != null and ninvarymny != ''"> and NINVARYMNY = #{ninvarymny} </if>
+            <if test="noutassistnum != null and noutassistnum != ''"> and NOUTASSISTNUM = #{noutassistnum} </if>
+            <if test="noutmny != null and noutmny != ''"> and NOUTMNY = #{noutmny} </if>
+            <if test="noutnum != null and noutnum != ''"> and NOUTNUM = #{noutnum} </if>
+            <if test="noutplanedmny != null and noutplanedmny != ''"> and NOUTPLANEDMNY = #{noutplanedmny} </if>
+            <if test="noutvarymny != null and noutvarymny != ''"> and NOUTVARYMNY = #{noutvarymny} </if>
+            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
+            <if test="ts != null and ts != ''"> and TS = #{ts} </if>
+            <if test="vbatch != null and vbatch != ''"> and VBATCH = #{vbatch} </if>
+            <if test="vfree1 != null and vfree1 != ''"> and VFREE1 = #{vfree1} </if>
+            <if test="vfree10 != null and vfree10 != ''"> and VFREE10 = #{vfree10} </if>
+            <if test="vfree2 != null and vfree2 != ''"> and VFREE2 = #{vfree2} </if>
+            <if test="vfree3 != null and vfree3 != ''"> and VFREE3 = #{vfree3} </if>
+            <if test="vfree4 != null and vfree4 != ''"> and VFREE4 = #{vfree4} </if>
+            <if test="vfree5 != null and vfree5 != ''"> and VFREE5 = #{vfree5} </if>
+            <if test="vfree6 != null and vfree6 != ''"> and VFREE6 = #{vfree6} </if>
+            <if test="vfree7 != null and vfree7 != ''"> and VFREE7 = #{vfree7} </if>
+            <if test="vfree8 != null and vfree8 != ''"> and VFREE8 = #{vfree8} </if>
+            <if test="vfree9 != null and vfree9 != ''"> and VFREE9 = #{vfree9} </if>
+            <if test="vproducebatch != null and vproducebatch != ''"> and VPRODUCEBATCH = #{vproducebatch} </if>
+            and sts='Y'
+    </trim>
+    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
+    <if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
+    </select>
+
+    <!-- 分页查询列表 采用like格式 -->
+<select id="entity_list_like" resultMap="get-IaPeriodaccountEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity">
+    select
+    <include refid="IaPeriodaccountEntity_Base_Column_List" />
+    from IA_PERIODACCOUNT
+    <trim prefix="where" prefixOverrides="and"> 
+        <if test="caccountmonth != null and caccountmonth != ''"> and CACCOUNTMONTH like concat('%',#{caccountmonth},'%') </if>
+            <if test="caccountyear != null and caccountyear != ''"> and CACCOUNTYEAR like concat('%',#{caccountyear},'%') </if>
+            <if test="cagentid != null and cagentid != ''"> and CAGENTID like concat('%',#{cagentid},'%') </if>
+            <if test="castunitid != null and castunitid != ''"> and CASTUNITID like concat('%',#{castunitid},'%') </if>
+            <if test="ccustomvendorid != null and ccustomvendorid != ''"> and CCUSTOMVENDORID like concat('%',#{ccustomvendorid},'%') </if>
+            <if test="cdeptid != null and cdeptid != ''"> and CDEPTID like concat('%',#{cdeptid},'%') </if>
+            <if test="cemployeeid != null and cemployeeid != ''"> and CEMPLOYEEID like concat('%',#{cemployeeid},'%') </if>
+            <if test="cinventoryid != null and cinventoryid != ''"> and CINVENTORYID like concat('%',#{cinventoryid},'%') </if>
+            <if test="coperatorid != null and coperatorid != ''"> and COPERATORID like concat('%',#{coperatorid},'%') </if>
+            <if test="cprojectid != null and cprojectid != ''"> and CPROJECTID like concat('%',#{cprojectid},'%') </if>
+            <if test="cprojectphase != null and cprojectphase != ''"> and CPROJECTPHASE like concat('%',#{cprojectphase},'%') </if>
+            <if test="crdcenterid != null and crdcenterid != ''"> and CRDCENTERID like concat('%',#{crdcenterid},'%') </if>
+            <if test="cstockrdcenterid != null and cstockrdcenterid != ''"> and CSTOCKRDCENTERID like concat('%',#{cstockrdcenterid},'%') </if>
+            <if test="cvendorid != null and cvendorid != ''"> and CVENDORID like concat('%',#{cvendorid},'%') </if>
+            <if test="cwarehouseid != null and cwarehouseid != ''"> and CWAREHOUSEID like concat('%',#{cwarehouseid},'%') </if>
+            <if test="cwarehousemanagerid != null and cwarehousemanagerid != ''"> and CWAREHOUSEMANAGERID like concat('%',#{cwarehousemanagerid},'%') </if>
+            <if test="cwp != null and cwp != ''"> and CWP like concat('%',#{cwp},'%') </if>
+            <if test="dr != null and dr != ''"> and DR like concat('%',#{dr},'%') </if>
+            <if test="fpricemodeflag != null and fpricemodeflag != ''"> and FPRICEMODEFLAG like concat('%',#{fpricemodeflag},'%') </if>
+            <if test="nabassistnum != null and nabassistnum != ''"> and NABASSISTNUM like concat('%',#{nabassistnum},'%') </if>
+            <if test="nabmny != null and nabmny != ''"> and NABMNY like concat('%',#{nabmny},'%') </if>
+            <if test="nabnum != null and nabnum != ''"> and NABNUM like concat('%',#{nabnum},'%') </if>
+            <if test="nabplanedmny != null and nabplanedmny != ''"> and NABPLANEDMNY like concat('%',#{nabplanedmny},'%') </if>
+            <if test="nabvarymny != null and nabvarymny != ''"> and NABVARYMNY like concat('%',#{nabvarymny},'%') </if>
+            <if test="ndrawsummny != null and ndrawsummny != ''"> and NDRAWSUMMNY like concat('%',#{ndrawsummny},'%') </if>
+            <if test="ninassistnum != null and ninassistnum != ''"> and NINASSISTNUM like concat('%',#{ninassistnum},'%') </if>
+            <if test="ninmny != null and ninmny != ''"> and NINMNY like concat('%',#{ninmny},'%') </if>
+            <if test="ninnum != null and ninnum != ''"> and NINNUM like concat('%',#{ninnum},'%') </if>
+            <if test="ninplanedmny != null and ninplanedmny != ''"> and NINPLANEDMNY like concat('%',#{ninplanedmny},'%') </if>
+            <if test="ninvarymny != null and ninvarymny != ''"> and NINVARYMNY like concat('%',#{ninvarymny},'%') </if>
+            <if test="noutassistnum != null and noutassistnum != ''"> and NOUTASSISTNUM like concat('%',#{noutassistnum},'%') </if>
+            <if test="noutmny != null and noutmny != ''"> and NOUTMNY like concat('%',#{noutmny},'%') </if>
+            <if test="noutnum != null and noutnum != ''"> and NOUTNUM like concat('%',#{noutnum},'%') </if>
+            <if test="noutplanedmny != null and noutplanedmny != ''"> and NOUTPLANEDMNY like concat('%',#{noutplanedmny},'%') </if>
+            <if test="noutvarymny != null and noutvarymny != ''"> and NOUTVARYMNY like concat('%',#{noutvarymny},'%') </if>
+            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP like concat('%',#{pkCorp},'%') </if>
+            <if test="ts != null and ts != ''"> and TS like concat('%',#{ts},'%') </if>
+            <if test="vbatch != null and vbatch != ''"> and VBATCH like concat('%',#{vbatch},'%') </if>
+            <if test="vfree1 != null and vfree1 != ''"> and VFREE1 like concat('%',#{vfree1},'%') </if>
+            <if test="vfree10 != null and vfree10 != ''"> and VFREE10 like concat('%',#{vfree10},'%') </if>
+            <if test="vfree2 != null and vfree2 != ''"> and VFREE2 like concat('%',#{vfree2},'%') </if>
+            <if test="vfree3 != null and vfree3 != ''"> and VFREE3 like concat('%',#{vfree3},'%') </if>
+            <if test="vfree4 != null and vfree4 != ''"> and VFREE4 like concat('%',#{vfree4},'%') </if>
+            <if test="vfree5 != null and vfree5 != ''"> and VFREE5 like concat('%',#{vfree5},'%') </if>
+            <if test="vfree6 != null and vfree6 != ''"> and VFREE6 like concat('%',#{vfree6},'%') </if>
+            <if test="vfree7 != null and vfree7 != ''"> and VFREE7 like concat('%',#{vfree7},'%') </if>
+            <if test="vfree8 != null and vfree8 != ''"> and VFREE8 like concat('%',#{vfree8},'%') </if>
+            <if test="vfree9 != null and vfree9 != ''"> and VFREE9 like concat('%',#{vfree9},'%') </if>
+            <if test="vproducebatch != null and vproducebatch != ''"> and VPRODUCEBATCH like concat('%',#{vproducebatch},'%') </if>
+            and sts='Y'
+    </trim>
+    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
+    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
+</select>
+
+<!-- 查询列表 字段采用or格式 -->
+<select id="IaPeriodaccountentity_list_or" resultMap="get-IaPeriodaccountEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity">
+    select
+    <include refid="IaPeriodaccountEntity_Base_Column_List" />
+    from IA_PERIODACCOUNT
+    <trim prefix="where" prefixOverrides="and"> 
+         <if test="caccountmonth != null and caccountmonth != ''"> or CACCOUNTMONTH = #{caccountmonth} </if>
+             <if test="caccountyear != null and caccountyear != ''"> or CACCOUNTYEAR = #{caccountyear} </if>
+             <if test="cagentid != null and cagentid != ''"> or CAGENTID = #{cagentid} </if>
+             <if test="castunitid != null and castunitid != ''"> or CASTUNITID = #{castunitid} </if>
+             <if test="ccustomvendorid != null and ccustomvendorid != ''"> or CCUSTOMVENDORID = #{ccustomvendorid} </if>
+             <if test="cdeptid != null and cdeptid != ''"> or CDEPTID = #{cdeptid} </if>
+             <if test="cemployeeid != null and cemployeeid != ''"> or CEMPLOYEEID = #{cemployeeid} </if>
+             <if test="cinventoryid != null and cinventoryid != ''"> or CINVENTORYID = #{cinventoryid} </if>
+             <if test="coperatorid != null and coperatorid != ''"> or COPERATORID = #{coperatorid} </if>
+             <if test="cprojectid != null and cprojectid != ''"> or CPROJECTID = #{cprojectid} </if>
+             <if test="cprojectphase != null and cprojectphase != ''"> or CPROJECTPHASE = #{cprojectphase} </if>
+             <if test="crdcenterid != null and crdcenterid != ''"> or CRDCENTERID = #{crdcenterid} </if>
+             <if test="cstockrdcenterid != null and cstockrdcenterid != ''"> or CSTOCKRDCENTERID = #{cstockrdcenterid} </if>
+             <if test="cvendorid != null and cvendorid != ''"> or CVENDORID = #{cvendorid} </if>
+             <if test="cwarehouseid != null and cwarehouseid != ''"> or CWAREHOUSEID = #{cwarehouseid} </if>
+             <if test="cwarehousemanagerid != null and cwarehousemanagerid != ''"> or CWAREHOUSEMANAGERID = #{cwarehousemanagerid} </if>
+             <if test="cwp != null and cwp != ''"> or CWP = #{cwp} </if>
+             <if test="dr != null and dr != ''"> or DR = #{dr} </if>
+             <if test="fpricemodeflag != null and fpricemodeflag != ''"> or FPRICEMODEFLAG = #{fpricemodeflag} </if>
+             <if test="nabassistnum != null and nabassistnum != ''"> or NABASSISTNUM = #{nabassistnum} </if>
+             <if test="nabmny != null and nabmny != ''"> or NABMNY = #{nabmny} </if>
+             <if test="nabnum != null and nabnum != ''"> or NABNUM = #{nabnum} </if>
+             <if test="nabplanedmny != null and nabplanedmny != ''"> or NABPLANEDMNY = #{nabplanedmny} </if>
+             <if test="nabvarymny != null and nabvarymny != ''"> or NABVARYMNY = #{nabvarymny} </if>
+             <if test="ndrawsummny != null and ndrawsummny != ''"> or NDRAWSUMMNY = #{ndrawsummny} </if>
+             <if test="ninassistnum != null and ninassistnum != ''"> or NINASSISTNUM = #{ninassistnum} </if>
+             <if test="ninmny != null and ninmny != ''"> or NINMNY = #{ninmny} </if>
+             <if test="ninnum != null and ninnum != ''"> or NINNUM = #{ninnum} </if>
+             <if test="ninplanedmny != null and ninplanedmny != ''"> or NINPLANEDMNY = #{ninplanedmny} </if>
+             <if test="ninvarymny != null and ninvarymny != ''"> or NINVARYMNY = #{ninvarymny} </if>
+             <if test="noutassistnum != null and noutassistnum != ''"> or NOUTASSISTNUM = #{noutassistnum} </if>
+             <if test="noutmny != null and noutmny != ''"> or NOUTMNY = #{noutmny} </if>
+             <if test="noutnum != null and noutnum != ''"> or NOUTNUM = #{noutnum} </if>
+             <if test="noutplanedmny != null and noutplanedmny != ''"> or NOUTPLANEDMNY = #{noutplanedmny} </if>
+             <if test="noutvarymny != null and noutvarymny != ''"> or NOUTVARYMNY = #{noutvarymny} </if>
+             <if test="pkCorp != null and pkCorp != ''"> or PK_CORP = #{pkCorp} </if>
+             <if test="ts != null and ts != ''"> or TS = #{ts} </if>
+             <if test="vbatch != null and vbatch != ''"> or VBATCH = #{vbatch} </if>
+             <if test="vfree1 != null and vfree1 != ''"> or VFREE1 = #{vfree1} </if>
+             <if test="vfree10 != null and vfree10 != ''"> or VFREE10 = #{vfree10} </if>
+             <if test="vfree2 != null and vfree2 != ''"> or VFREE2 = #{vfree2} </if>
+             <if test="vfree3 != null and vfree3 != ''"> or VFREE3 = #{vfree3} </if>
+             <if test="vfree4 != null and vfree4 != ''"> or VFREE4 = #{vfree4} </if>
+             <if test="vfree5 != null and vfree5 != ''"> or VFREE5 = #{vfree5} </if>
+             <if test="vfree6 != null and vfree6 != ''"> or VFREE6 = #{vfree6} </if>
+             <if test="vfree7 != null and vfree7 != ''"> or VFREE7 = #{vfree7} </if>
+             <if test="vfree8 != null and vfree8 != ''"> or VFREE8 = #{vfree8} </if>
+             <if test="vfree9 != null and vfree9 != ''"> or VFREE9 = #{vfree9} </if>
+             <if test="vproducebatch != null and vproducebatch != ''"> or VPRODUCEBATCH = #{vproducebatch} </if>
+            and sts='Y'
+    </trim>
+    <if test=" sort == null or sort == ''.toString()  "> order by sorts asc</if>
+    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
+</select>
+
+<!--新增所有列-->
+<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity" keyProperty="" useGeneratedKeys="true">
+    insert into IA_PERIODACCOUNT(
+  <trim suffix="" suffixOverrides=",">
+       <if test="caccountmonth != null and caccountmonth != ''"> CACCOUNTMONTH , </if>
+            <if test="caccountyear != null and caccountyear != ''"> CACCOUNTYEAR , </if>
+            <if test="cagentid != null and cagentid != ''"> CAGENTID , </if>
+            <if test="castunitid != null and castunitid != ''"> CASTUNITID , </if>
+            <if test="ccustomvendorid != null and ccustomvendorid != ''"> CCUSTOMVENDORID , </if>
+            <if test="cdeptid != null and cdeptid != ''"> CDEPTID , </if>
+            <if test="cemployeeid != null and cemployeeid != ''"> CEMPLOYEEID , </if>
+            <if test="cinventoryid != null and cinventoryid != ''"> CINVENTORYID , </if>
+            <if test="coperatorid != null and coperatorid != ''"> COPERATORID , </if>
+            <if test="cprojectid != null and cprojectid != ''"> CPROJECTID , </if>
+            <if test="cprojectphase != null and cprojectphase != ''"> CPROJECTPHASE , </if>
+            <if test="crdcenterid != null and crdcenterid != ''"> CRDCENTERID , </if>
+            <if test="cstockrdcenterid != null and cstockrdcenterid != ''"> CSTOCKRDCENTERID , </if>
+            <if test="cvendorid != null and cvendorid != ''"> CVENDORID , </if>
+            <if test="cwarehouseid != null and cwarehouseid != ''"> CWAREHOUSEID , </if>
+            <if test="cwarehousemanagerid != null and cwarehousemanagerid != ''"> CWAREHOUSEMANAGERID , </if>
+            <if test="cwp != null and cwp != ''"> CWP , </if>
+            <if test="dr != null and dr != ''"> DR , </if>
+            <if test="fpricemodeflag != null and fpricemodeflag != ''"> FPRICEMODEFLAG , </if>
+            <if test="nabassistnum != null and nabassistnum != ''"> NABASSISTNUM , </if>
+            <if test="nabmny != null and nabmny != ''"> NABMNY , </if>
+            <if test="nabnum != null and nabnum != ''"> NABNUM , </if>
+            <if test="nabplanedmny != null and nabplanedmny != ''"> NABPLANEDMNY , </if>
+            <if test="nabvarymny != null and nabvarymny != ''"> NABVARYMNY , </if>
+            <if test="ndrawsummny != null and ndrawsummny != ''"> NDRAWSUMMNY , </if>
+            <if test="ninassistnum != null and ninassistnum != ''"> NINASSISTNUM , </if>
+            <if test="ninmny != null and ninmny != ''"> NINMNY , </if>
+            <if test="ninnum != null and ninnum != ''"> NINNUM , </if>
+            <if test="ninplanedmny != null and ninplanedmny != ''"> NINPLANEDMNY , </if>
+            <if test="ninvarymny != null and ninvarymny != ''"> NINVARYMNY , </if>
+            <if test="noutassistnum != null and noutassistnum != ''"> NOUTASSISTNUM , </if>
+            <if test="noutmny != null and noutmny != ''"> NOUTMNY , </if>
+            <if test="noutnum != null and noutnum != ''"> NOUTNUM , </if>
+            <if test="noutplanedmny != null and noutplanedmny != ''"> NOUTPLANEDMNY , </if>
+            <if test="noutvarymny != null and noutvarymny != ''"> NOUTVARYMNY , </if>
+            <if test="pkCorp != null and pkCorp != ''"> PK_CORP , </if>
+            <if test="ts != null and ts != ''"> TS , </if>
+            <if test="vbatch != null and vbatch != ''"> VBATCH , </if>
+            <if test="vfree1 != null and vfree1 != ''"> VFREE1 , </if>
+            <if test="vfree10 != null and vfree10 != ''"> VFREE10 , </if>
+            <if test="vfree2 != null and vfree2 != ''"> VFREE2 , </if>
+            <if test="vfree3 != null and vfree3 != ''"> VFREE3 , </if>
+            <if test="vfree4 != null and vfree4 != ''"> VFREE4 , </if>
+            <if test="vfree5 != null and vfree5 != ''"> VFREE5 , </if>
+            <if test="vfree6 != null and vfree6 != ''"> VFREE6 , </if>
+            <if test="vfree7 != null and vfree7 != ''"> VFREE7 , </if>
+            <if test="vfree8 != null and vfree8 != ''"> VFREE8 , </if>
+            <if test="vfree9 != null and vfree9 != ''"> VFREE9 , </if>
+            <if test="vproducebatch != null and vproducebatch != ''"> VPRODUCEBATCH , </if>
+            <if test="sorts == null ">sorts,</if>
+    <if test="sts == null ">sts,</if>
+  </trim>
+  )values(
+ <trim suffix="" suffixOverrides=",">
+       <if test="caccountmonth != null and caccountmonth != ''"> #{caccountmonth} ,</if>
+            <if test="caccountyear != null and caccountyear != ''"> #{caccountyear} ,</if>
+            <if test="cagentid != null and cagentid != ''"> #{cagentid} ,</if>
+            <if test="castunitid != null and castunitid != ''"> #{castunitid} ,</if>
+            <if test="ccustomvendorid != null and ccustomvendorid != ''"> #{ccustomvendorid} ,</if>
+            <if test="cdeptid != null and cdeptid != ''"> #{cdeptid} ,</if>
+            <if test="cemployeeid != null and cemployeeid != ''"> #{cemployeeid} ,</if>
+            <if test="cinventoryid != null and cinventoryid != ''"> #{cinventoryid} ,</if>
+            <if test="coperatorid != null and coperatorid != ''"> #{coperatorid} ,</if>
+            <if test="cprojectid != null and cprojectid != ''"> #{cprojectid} ,</if>
+            <if test="cprojectphase != null and cprojectphase != ''"> #{cprojectphase} ,</if>
+            <if test="crdcenterid != null and crdcenterid != ''"> #{crdcenterid} ,</if>
+            <if test="cstockrdcenterid != null and cstockrdcenterid != ''"> #{cstockrdcenterid} ,</if>
+            <if test="cvendorid != null and cvendorid != ''"> #{cvendorid} ,</if>
+            <if test="cwarehouseid != null and cwarehouseid != ''"> #{cwarehouseid} ,</if>
+            <if test="cwarehousemanagerid != null and cwarehousemanagerid != ''"> #{cwarehousemanagerid} ,</if>
+            <if test="cwp != null and cwp != ''"> #{cwp} ,</if>
+            <if test="dr != null and dr != ''"> #{dr} ,</if>
+            <if test="fpricemodeflag != null and fpricemodeflag != ''"> #{fpricemodeflag} ,</if>
+            <if test="nabassistnum != null and nabassistnum != ''"> #{nabassistnum} ,</if>
+            <if test="nabmny != null and nabmny != ''"> #{nabmny} ,</if>
+            <if test="nabnum != null and nabnum != ''"> #{nabnum} ,</if>
+            <if test="nabplanedmny != null and nabplanedmny != ''"> #{nabplanedmny} ,</if>
+            <if test="nabvarymny != null and nabvarymny != ''"> #{nabvarymny} ,</if>
+            <if test="ndrawsummny != null and ndrawsummny != ''"> #{ndrawsummny} ,</if>
+            <if test="ninassistnum != null and ninassistnum != ''"> #{ninassistnum} ,</if>
+            <if test="ninmny != null and ninmny != ''"> #{ninmny} ,</if>
+            <if test="ninnum != null and ninnum != ''"> #{ninnum} ,</if>
+            <if test="ninplanedmny != null and ninplanedmny != ''"> #{ninplanedmny} ,</if>
+            <if test="ninvarymny != null and ninvarymny != ''"> #{ninvarymny} ,</if>
+            <if test="noutassistnum != null and noutassistnum != ''"> #{noutassistnum} ,</if>
+            <if test="noutmny != null and noutmny != ''"> #{noutmny} ,</if>
+            <if test="noutnum != null and noutnum != ''"> #{noutnum} ,</if>
+            <if test="noutplanedmny != null and noutplanedmny != ''"> #{noutplanedmny} ,</if>
+            <if test="noutvarymny != null and noutvarymny != ''"> #{noutvarymny} ,</if>
+            <if test="pkCorp != null and pkCorp != ''"> #{pkCorp} ,</if>
+            <if test="ts != null and ts != ''"> #{ts} ,</if>
+            <if test="vbatch != null and vbatch != ''"> #{vbatch} ,</if>
+            <if test="vfree1 != null and vfree1 != ''"> #{vfree1} ,</if>
+            <if test="vfree10 != null and vfree10 != ''"> #{vfree10} ,</if>
+            <if test="vfree2 != null and vfree2 != ''"> #{vfree2} ,</if>
+            <if test="vfree3 != null and vfree3 != ''"> #{vfree3} ,</if>
+            <if test="vfree4 != null and vfree4 != ''"> #{vfree4} ,</if>
+            <if test="vfree5 != null and vfree5 != ''"> #{vfree5} ,</if>
+            <if test="vfree6 != null and vfree6 != ''"> #{vfree6} ,</if>
+            <if test="vfree7 != null and vfree7 != ''"> #{vfree7} ,</if>
+            <if test="vfree8 != null and vfree8 != ''"> #{vfree8} ,</if>
+            <if test="vfree9 != null and vfree9 != ''"> #{vfree9} ,</if>
+            <if test="vproducebatch != null and vproducebatch != ''"> #{vproducebatch} ,</if>
+            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from IA_PERIODACCOUNT a WHERE a.sts = 'Y' ),</if>
+    <if test="sts == null ">'Y',</if>
+  </trim>
+  )  
+</insert>
+<!-- 批量新增 -->
+<insert id="entityInsertBatch" keyProperty="" useGeneratedKeys="true">
+  insert into IA_PERIODACCOUNT(CACCOUNTMONTH, CACCOUNTYEAR, CAGENTID, CASTUNITID, CCUSTOMVENDORID, CDEPTID, CEMPLOYEEID, CINVENTORYID, COPERATORID, CPROJECTID, CPROJECTPHASE, CRDCENTERID, CSTOCKRDCENTERID, CVENDORID, CWAREHOUSEID, CWAREHOUSEMANAGERID, CWP, DR, FPRICEMODEFLAG, NABASSISTNUM, NABMNY, NABNUM, NABPLANEDMNY, NABVARYMNY, NDRAWSUMMNY, NINASSISTNUM, NINMNY, NINNUM, NINPLANEDMNY, NINVARYMNY, NOUTASSISTNUM, NOUTMNY, NOUTNUM, NOUTPLANEDMNY, NOUTVARYMNY, PK_CORP, TS, VBATCH, VFREE1, VFREE10, VFREE2, VFREE3, VFREE4, VFREE5, VFREE6, VFREE7, VFREE8, VFREE9, VPRODUCEBATCH,  sts) 
+    values
+    <foreach collection="entities" item="entity" separator=",">
+    (#{entity.caccountmonth},#{entity.caccountyear},#{entity.cagentid},#{entity.castunitid},#{entity.ccustomvendorid},#{entity.cdeptid},#{entity.cemployeeid},#{entity.cinventoryid},#{entity.coperatorid},#{entity.cprojectid},#{entity.cprojectphase},#{entity.crdcenterid},#{entity.cstockrdcenterid},#{entity.cvendorid},#{entity.cwarehouseid},#{entity.cwarehousemanagerid},#{entity.cwp},#{entity.dr},#{entity.fpricemodeflag},#{entity.nabassistnum},#{entity.nabmny},#{entity.nabnum},#{entity.nabplanedmny},#{entity.nabvarymny},#{entity.ndrawsummny},#{entity.ninassistnum},#{entity.ninmny},#{entity.ninnum},#{entity.ninplanedmny},#{entity.ninvarymny},#{entity.noutassistnum},#{entity.noutmny},#{entity.noutnum},#{entity.noutplanedmny},#{entity.noutvarymny},#{entity.pkCorp},#{entity.ts},#{entity.vbatch},#{entity.vfree1},#{entity.vfree10},#{entity.vfree2},#{entity.vfree3},#{entity.vfree4},#{entity.vfree5},#{entity.vfree6},#{entity.vfree7},#{entity.vfree8},#{entity.vfree9},#{entity.vproducebatch}, 'Y')
+    </foreach>
+</insert>
+<!-- 批量新增或者修改-->
+<insert id="entityInsertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
+    insert into IA_PERIODACCOUNT(CACCOUNTMONTH, CACCOUNTYEAR, CAGENTID, CASTUNITID, CCUSTOMVENDORID, CDEPTID, CEMPLOYEEID, CINVENTORYID, COPERATORID, CPROJECTID, CPROJECTPHASE, CRDCENTERID, CSTOCKRDCENTERID, CVENDORID, CWAREHOUSEID, CWAREHOUSEMANAGERID, CWP, DR, FPRICEMODEFLAG, NABASSISTNUM, NABMNY, NABNUM, NABPLANEDMNY, NABVARYMNY, NDRAWSUMMNY, NINASSISTNUM, NINMNY, NINNUM, NINPLANEDMNY, NINVARYMNY, NOUTASSISTNUM, NOUTMNY, NOUTNUM, NOUTPLANEDMNY, NOUTVARYMNY, PK_CORP, TS, VBATCH, VFREE1, VFREE10, VFREE2, VFREE3, VFREE4, VFREE5, VFREE6, VFREE7, VFREE8, VFREE9, VPRODUCEBATCH)
+    values
+    <foreach collection="entities" item="entity" separator=",">
+    (#{entity.caccountmonth},#{entity.caccountyear},#{entity.cagentid},#{entity.castunitid},#{entity.ccustomvendorid},#{entity.cdeptid},#{entity.cemployeeid},#{entity.cinventoryid},#{entity.coperatorid},#{entity.cprojectid},#{entity.cprojectphase},#{entity.crdcenterid},#{entity.cstockrdcenterid},#{entity.cvendorid},#{entity.cwarehouseid},#{entity.cwarehousemanagerid},#{entity.cwp},#{entity.dr},#{entity.fpricemodeflag},#{entity.nabassistnum},#{entity.nabmny},#{entity.nabnum},#{entity.nabplanedmny},#{entity.nabvarymny},#{entity.ndrawsummny},#{entity.ninassistnum},#{entity.ninmny},#{entity.ninnum},#{entity.ninplanedmny},#{entity.ninvarymny},#{entity.noutassistnum},#{entity.noutmny},#{entity.noutnum},#{entity.noutplanedmny},#{entity.noutvarymny},#{entity.pkCorp},#{entity.ts},#{entity.vbatch},#{entity.vfree1},#{entity.vfree10},#{entity.vfree2},#{entity.vfree3},#{entity.vfree4},#{entity.vfree5},#{entity.vfree6},#{entity.vfree7},#{entity.vfree8},#{entity.vfree9},#{entity.vproducebatch})
+    </foreach>
+    on duplicate key update
+    CACCOUNTMONTH = values(CACCOUNTMONTH),
+    CACCOUNTYEAR = values(CACCOUNTYEAR),
+    CAGENTID = values(CAGENTID),
+    CASTUNITID = values(CASTUNITID),
+    CCUSTOMVENDORID = values(CCUSTOMVENDORID),
+    CDEPTID = values(CDEPTID),
+    CEMPLOYEEID = values(CEMPLOYEEID),
+    CINVENTORYID = values(CINVENTORYID),
+    COPERATORID = values(COPERATORID),
+    CPROJECTID = values(CPROJECTID),
+    CPROJECTPHASE = values(CPROJECTPHASE),
+    CRDCENTERID = values(CRDCENTERID),
+    CSTOCKRDCENTERID = values(CSTOCKRDCENTERID),
+    CVENDORID = values(CVENDORID),
+    CWAREHOUSEID = values(CWAREHOUSEID),
+    CWAREHOUSEMANAGERID = values(CWAREHOUSEMANAGERID),
+    CWP = values(CWP),
+    DR = values(DR),
+    FPRICEMODEFLAG = values(FPRICEMODEFLAG),
+    NABASSISTNUM = values(NABASSISTNUM),
+    NABMNY = values(NABMNY),
+    NABNUM = values(NABNUM),
+    NABPLANEDMNY = values(NABPLANEDMNY),
+    NABVARYMNY = values(NABVARYMNY),
+    NDRAWSUMMNY = values(NDRAWSUMMNY),
+    NINASSISTNUM = values(NINASSISTNUM),
+    NINMNY = values(NINMNY),
+    NINNUM = values(NINNUM),
+    NINPLANEDMNY = values(NINPLANEDMNY),
+    NINVARYMNY = values(NINVARYMNY),
+    NOUTASSISTNUM = values(NOUTASSISTNUM),
+    NOUTMNY = values(NOUTMNY),
+    NOUTNUM = values(NOUTNUM),
+    NOUTPLANEDMNY = values(NOUTPLANEDMNY),
+    NOUTVARYMNY = values(NOUTVARYMNY),
+    PK_CORP = values(PK_CORP),
+    TS = values(TS),
+    VBATCH = values(VBATCH),
+    VFREE1 = values(VFREE1),
+    VFREE10 = values(VFREE10),
+    VFREE2 = values(VFREE2),
+    VFREE3 = values(VFREE3),
+    VFREE4 = values(VFREE4),
+    VFREE5 = values(VFREE5),
+    VFREE6 = values(VFREE6),
+    VFREE7 = values(VFREE7),
+    VFREE8 = values(VFREE8),
+    VFREE9 = values(VFREE9),
+    VPRODUCEBATCH = values(VPRODUCEBATCH)</insert>
+<!--通过主键修改方法-->
+<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity" >
+update IA_PERIODACCOUNT  set
+<trim suffix="" suffixOverrides=",">
+  <if test="caccountmonth != null and caccountmonth != ''"> CACCOUNTMONTH = #{caccountmonth},</if>
+  <if test="caccountyear != null and caccountyear != ''"> CACCOUNTYEAR = #{caccountyear},</if>
+  <if test="cagentid != null and cagentid != ''"> CAGENTID = #{cagentid},</if>
+  <if test="castunitid != null and castunitid != ''"> CASTUNITID = #{castunitid},</if>
+  <if test="ccustomvendorid != null and ccustomvendorid != ''"> CCUSTOMVENDORID = #{ccustomvendorid},</if>
+  <if test="cdeptid != null and cdeptid != ''"> CDEPTID = #{cdeptid},</if>
+  <if test="cemployeeid != null and cemployeeid != ''"> CEMPLOYEEID = #{cemployeeid},</if>
+  <if test="cinventoryid != null and cinventoryid != ''"> CINVENTORYID = #{cinventoryid},</if>
+  <if test="coperatorid != null and coperatorid != ''"> COPERATORID = #{coperatorid},</if>
+  <if test="cprojectid != null and cprojectid != ''"> CPROJECTID = #{cprojectid},</if>
+  <if test="cprojectphase != null and cprojectphase != ''"> CPROJECTPHASE = #{cprojectphase},</if>
+  <if test="crdcenterid != null and crdcenterid != ''"> CRDCENTERID = #{crdcenterid},</if>
+  <if test="cstockrdcenterid != null and cstockrdcenterid != ''"> CSTOCKRDCENTERID = #{cstockrdcenterid},</if>
+  <if test="cvendorid != null and cvendorid != ''"> CVENDORID = #{cvendorid},</if>
+  <if test="cwarehouseid != null and cwarehouseid != ''"> CWAREHOUSEID = #{cwarehouseid},</if>
+  <if test="cwarehousemanagerid != null and cwarehousemanagerid != ''"> CWAREHOUSEMANAGERID = #{cwarehousemanagerid},</if>
+  <if test="cwp != null and cwp != ''"> CWP = #{cwp},</if>
+  <if test="dr != null and dr != ''"> DR = #{dr},</if>
+  <if test="fpricemodeflag != null and fpricemodeflag != ''"> FPRICEMODEFLAG = #{fpricemodeflag},</if>
+  <if test="nabassistnum != null and nabassistnum != ''"> NABASSISTNUM = #{nabassistnum},</if>
+  <if test="nabmny != null and nabmny != ''"> NABMNY = #{nabmny},</if>
+  <if test="nabnum != null and nabnum != ''"> NABNUM = #{nabnum},</if>
+  <if test="nabplanedmny != null and nabplanedmny != ''"> NABPLANEDMNY = #{nabplanedmny},</if>
+  <if test="nabvarymny != null and nabvarymny != ''"> NABVARYMNY = #{nabvarymny},</if>
+  <if test="ndrawsummny != null and ndrawsummny != ''"> NDRAWSUMMNY = #{ndrawsummny},</if>
+  <if test="ninassistnum != null and ninassistnum != ''"> NINASSISTNUM = #{ninassistnum},</if>
+  <if test="ninmny != null and ninmny != ''"> NINMNY = #{ninmny},</if>
+  <if test="ninnum != null and ninnum != ''"> NINNUM = #{ninnum},</if>
+  <if test="ninplanedmny != null and ninplanedmny != ''"> NINPLANEDMNY = #{ninplanedmny},</if>
+  <if test="ninvarymny != null and ninvarymny != ''"> NINVARYMNY = #{ninvarymny},</if>
+  <if test="noutassistnum != null and noutassistnum != ''"> NOUTASSISTNUM = #{noutassistnum},</if>
+  <if test="noutmny != null and noutmny != ''"> NOUTMNY = #{noutmny},</if>
+  <if test="noutnum != null and noutnum != ''"> NOUTNUM = #{noutnum},</if>
+  <if test="noutplanedmny != null and noutplanedmny != ''"> NOUTPLANEDMNY = #{noutplanedmny},</if>
+  <if test="noutvarymny != null and noutvarymny != ''"> NOUTVARYMNY = #{noutvarymny},</if>
+  <if test="pkCorp != null and pkCorp != ''"> PK_CORP = #{pkCorp},</if>
+  <if test="ts != null and ts != ''"> TS = #{ts},</if>
+  <if test="vbatch != null and vbatch != ''"> VBATCH = #{vbatch},</if>
+  <if test="vfree1 != null and vfree1 != ''"> VFREE1 = #{vfree1},</if>
+  <if test="vfree10 != null and vfree10 != ''"> VFREE10 = #{vfree10},</if>
+  <if test="vfree2 != null and vfree2 != ''"> VFREE2 = #{vfree2},</if>
+  <if test="vfree3 != null and vfree3 != ''"> VFREE3 = #{vfree3},</if>
+  <if test="vfree4 != null and vfree4 != ''"> VFREE4 = #{vfree4},</if>
+  <if test="vfree5 != null and vfree5 != ''"> VFREE5 = #{vfree5},</if>
+  <if test="vfree6 != null and vfree6 != ''"> VFREE6 = #{vfree6},</if>
+  <if test="vfree7 != null and vfree7 != ''"> VFREE7 = #{vfree7},</if>
+  <if test="vfree8 != null and vfree8 != ''"> VFREE8 = #{vfree8},</if>
+  <if test="vfree9 != null and vfree9 != ''"> VFREE9 = #{vfree9},</if>
+  <if test="vproducebatch != null and vproducebatch != ''"> VPRODUCEBATCH = #{vproducebatch},</if>
+</trim>
+where  = #{}
+</update>
+<!-- 逻辑删除 -->
+<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity" >
+update IA_PERIODACCOUNT  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
+where  = #{}
+</update>
+<!-- 多条件逻辑删除 -->
+<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity" >
+update IA_PERIODACCOUNT  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
+ <trim prefix="where" prefixOverrides="and"> 
+        <if test="caccountmonth != null and caccountmonth != ''"> and CACCOUNTMONTH = #{caccountmonth} </if>
+            <if test="caccountyear != null and caccountyear != ''"> and CACCOUNTYEAR = #{caccountyear} </if>
+            <if test="cagentid != null and cagentid != ''"> and CAGENTID = #{cagentid} </if>
+            <if test="castunitid != null and castunitid != ''"> and CASTUNITID = #{castunitid} </if>
+            <if test="ccustomvendorid != null and ccustomvendorid != ''"> and CCUSTOMVENDORID = #{ccustomvendorid} </if>
+            <if test="cdeptid != null and cdeptid != ''"> and CDEPTID = #{cdeptid} </if>
+            <if test="cemployeeid != null and cemployeeid != ''"> and CEMPLOYEEID = #{cemployeeid} </if>
+            <if test="cinventoryid != null and cinventoryid != ''"> and CINVENTORYID = #{cinventoryid} </if>
+            <if test="coperatorid != null and coperatorid != ''"> and COPERATORID = #{coperatorid} </if>
+            <if test="cprojectid != null and cprojectid != ''"> and CPROJECTID = #{cprojectid} </if>
+            <if test="cprojectphase != null and cprojectphase != ''"> and CPROJECTPHASE = #{cprojectphase} </if>
+            <if test="crdcenterid != null and crdcenterid != ''"> and CRDCENTERID = #{crdcenterid} </if>
+            <if test="cstockrdcenterid != null and cstockrdcenterid != ''"> and CSTOCKRDCENTERID = #{cstockrdcenterid} </if>
+            <if test="cvendorid != null and cvendorid != ''"> and CVENDORID = #{cvendorid} </if>
+            <if test="cwarehouseid != null and cwarehouseid != ''"> and CWAREHOUSEID = #{cwarehouseid} </if>
+            <if test="cwarehousemanagerid != null and cwarehousemanagerid != ''"> and CWAREHOUSEMANAGERID = #{cwarehousemanagerid} </if>
+            <if test="cwp != null and cwp != ''"> and CWP = #{cwp} </if>
+            <if test="dr != null and dr != ''"> and DR = #{dr} </if>
+            <if test="fpricemodeflag != null and fpricemodeflag != ''"> and FPRICEMODEFLAG = #{fpricemodeflag} </if>
+            <if test="nabassistnum != null and nabassistnum != ''"> and NABASSISTNUM = #{nabassistnum} </if>
+            <if test="nabmny != null and nabmny != ''"> and NABMNY = #{nabmny} </if>
+            <if test="nabnum != null and nabnum != ''"> and NABNUM = #{nabnum} </if>
+            <if test="nabplanedmny != null and nabplanedmny != ''"> and NABPLANEDMNY = #{nabplanedmny} </if>
+            <if test="nabvarymny != null and nabvarymny != ''"> and NABVARYMNY = #{nabvarymny} </if>
+            <if test="ndrawsummny != null and ndrawsummny != ''"> and NDRAWSUMMNY = #{ndrawsummny} </if>
+            <if test="ninassistnum != null and ninassistnum != ''"> and NINASSISTNUM = #{ninassistnum} </if>
+            <if test="ninmny != null and ninmny != ''"> and NINMNY = #{ninmny} </if>
+            <if test="ninnum != null and ninnum != ''"> and NINNUM = #{ninnum} </if>
+            <if test="ninplanedmny != null and ninplanedmny != ''"> and NINPLANEDMNY = #{ninplanedmny} </if>
+            <if test="ninvarymny != null and ninvarymny != ''"> and NINVARYMNY = #{ninvarymny} </if>
+            <if test="noutassistnum != null and noutassistnum != ''"> and NOUTASSISTNUM = #{noutassistnum} </if>
+            <if test="noutmny != null and noutmny != ''"> and NOUTMNY = #{noutmny} </if>
+            <if test="noutnum != null and noutnum != ''"> and NOUTNUM = #{noutnum} </if>
+            <if test="noutplanedmny != null and noutplanedmny != ''"> and NOUTPLANEDMNY = #{noutplanedmny} </if>
+            <if test="noutvarymny != null and noutvarymny != ''"> and NOUTVARYMNY = #{noutvarymny} </if>
+            <if test="pkCorp != null and pkCorp != ''"> and PK_CORP = #{pkCorp} </if>
+            <if test="ts != null and ts != ''"> and TS = #{ts} </if>
+            <if test="vbatch != null and vbatch != ''"> and VBATCH = #{vbatch} </if>
+            <if test="vfree1 != null and vfree1 != ''"> and VFREE1 = #{vfree1} </if>
+            <if test="vfree10 != null and vfree10 != ''"> and VFREE10 = #{vfree10} </if>
+            <if test="vfree2 != null and vfree2 != ''"> and VFREE2 = #{vfree2} </if>
+            <if test="vfree3 != null and vfree3 != ''"> and VFREE3 = #{vfree3} </if>
+            <if test="vfree4 != null and vfree4 != ''"> and VFREE4 = #{vfree4} </if>
+            <if test="vfree5 != null and vfree5 != ''"> and VFREE5 = #{vfree5} </if>
+            <if test="vfree6 != null and vfree6 != ''"> and VFREE6 = #{vfree6} </if>
+            <if test="vfree7 != null and vfree7 != ''"> and VFREE7 = #{vfree7} </if>
+            <if test="vfree8 != null and vfree8 != ''"> and VFREE8 = #{vfree8} </if>
+            <if test="vfree9 != null and vfree9 != ''"> and VFREE9 = #{vfree9} </if>
+            <if test="vproducebatch != null and vproducebatch != ''"> and VPRODUCEBATCH = #{vproducebatch} </if>
+            and sts='Y'
+    </trim>
+</update>
+<!--通过主键删除-->
+<delete id="entity_delete">
+    delete from IA_PERIODACCOUNT where  = #{}
+</delete>
+
+    <!--查询指定存货的结存价(成本价)-->
+    <select id="queryBalancePrice" parameterType="com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity" resultMap="get-IaPeriodaccountEntity-result">
+        SELECT
+            t.caccountmonth,
+            t.caccountyear,
+            t.cinventoryid,
+            t.nabmny,
+            t.nabnum,
+            b.pk_invmandoc,
+            b.pk_corp,
+            bc.unitname,
+            bi.invcode
+        FROM
+            ( SELECT ip.*, ROW_NUMBER() OVER (PARTITION BY cinventoryid ORDER BY caccountyear, caccountmonth DESC) AS row_number FROM ia_periodaccount ip) t
+                LEFT JOIN bd_invmandoc b ON b.pk_invmandoc = t.cinventoryid
+                LEFT JOIN bd_corp bc ON bc.pk_corp = b.pk_corp
+                LEFT JOIN bd_invbasdoc bi ON bi.pk_invbasdoc = b.pk_invbasdoc
+        WHERE
+            t.row_number = 1
+            and bi.invcode in (
+                ${invcodes}
+            )
+    </select>
+</mapper>
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/PoOrderBEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/PoOrderBEntity.java
index 53e431b3..386b868a 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/PoOrderBEntity.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/PoOrderBEntity.java
@@ -1,6 +1,7 @@
 package com.hzya.frame.plugin.lets.entity;
 
 import com.hzya.frame.web.entity.BaseEntity;
+import lombok.Data;
 
 /**
  * (PoOrderB)实体类
@@ -8,8 +9,8 @@ import com.hzya.frame.web.entity.BaseEntity;
  * @author makejava
  * @since 2023-08-25 08:53:25
  */
+@Data
 public class PoOrderBEntity extends BaseEntity {
-
     private String blargess;
     private String breceiveplan;
     private String btransclosed;
@@ -146,1076 +147,11 @@ public class PoOrderBEntity extends BaseEntity {
     private String vvendororderrow;
 
 
-    public String getBlargess() {
-        return blargess;
-    }
-
-    public void setBlargess(String blargess) {
-        this.blargess = blargess;
-    }
-
-    public String getBreceiveplan() {
-        return breceiveplan;
-    }
-
-    public void setBreceiveplan(String breceiveplan) {
-        this.breceiveplan = breceiveplan;
-    }
-
-    public String getBtransclosed() {
-        return btransclosed;
-    }
-
-    public void setBtransclosed(String btransclosed) {
-        this.btransclosed = btransclosed;
-    }
-
-    public String getCassistunit() {
-        return cassistunit;
-    }
-
-    public void setCassistunit(String cassistunit) {
-        this.cassistunit = cassistunit;
-    }
-
-    public String getCbaseid() {
-        return cbaseid;
-    }
-
-    public void setCbaseid(String cbaseid) {
-        this.cbaseid = cbaseid;
-    }
-
-    public String getCcloseuserid() {
-        return ccloseuserid;
-    }
-
-    public void setCcloseuserid(String ccloseuserid) {
-        this.ccloseuserid = ccloseuserid;
-    }
-
-    public String getCcontractid() {
-        return ccontractid;
-    }
-
-    public void setCcontractid(String ccontractid) {
-        this.ccontractid = ccontractid;
-    }
-
-    public String getCcontractrowid() {
-        return ccontractrowid;
-    }
-
-    public void setCcontractrowid(String ccontractrowid) {
-        this.ccontractrowid = ccontractrowid;
-    }
-
-    public String getCcorrectrowid() {
-        return ccorrectrowid;
-    }
-
-    public void setCcorrectrowid(String ccorrectrowid) {
-        this.ccorrectrowid = ccorrectrowid;
-    }
-
-    public String getCcurrencytypeid() {
-        return ccurrencytypeid;
-    }
-
-    public void setCcurrencytypeid(String ccurrencytypeid) {
-        this.ccurrencytypeid = ccurrencytypeid;
-    }
-
-    public String getCdevaddrid() {
-        return cdevaddrid;
-    }
-
-    public void setCdevaddrid(String cdevaddrid) {
-        this.cdevaddrid = cdevaddrid;
-    }
-
-    public String getCdevareaid() {
-        return cdevareaid;
-    }
-
-    public void setCdevareaid(String cdevareaid) {
-        this.cdevareaid = cdevareaid;
-    }
-
-    public String getCecbillBid() {
-        return cecbillBid;
-    }
-
-    public void setCecbillBid(String cecbillBid) {
-        this.cecbillBid = cecbillBid;
-    }
-
-    public String getCecbillid() {
-        return cecbillid;
-    }
-
-    public void setCecbillid(String cecbillid) {
-        this.cecbillid = cecbillid;
-    }
-
-    public String getClosingreason() {
-        return closingreason;
-    }
-
-    public void setClosingreason(String closingreason) {
-        this.closingreason = closingreason;
-    }
-
-    public String getCmangid() {
-        return cmangid;
-    }
-
-    public void setCmangid(String cmangid) {
-        this.cmangid = cmangid;
-    }
-
-    public String getCoperator() {
-        return coperator;
-    }
-
-    public void setCoperator(String coperator) {
-        this.coperator = coperator;
-    }
-
-    public String getCorderBid() {
-        return corderBid;
-    }
-
-    public void setCorderBid(String corderBid) {
-        this.corderBid = corderBid;
-    }
-
-    public String getCorderid() {
-        return corderid;
-    }
-
-    public void setCorderid(String corderid) {
-        this.corderid = corderid;
-    }
-
-    public String getCpriceauditBb1id() {
-        return cpriceauditBb1id;
-    }
-
-    public void setCpriceauditBb1id(String cpriceauditBb1id) {
-        this.cpriceauditBb1id = cpriceauditBb1id;
-    }
-
-    public String getCpriceauditBid() {
-        return cpriceauditBid;
-    }
-
-    public void setCpriceauditBid(String cpriceauditBid) {
-        this.cpriceauditBid = cpriceauditBid;
-    }
-
-    public String getCpriceauditid() {
-        return cpriceauditid;
-    }
-
-    public void setCpriceauditid(String cpriceauditid) {
-        this.cpriceauditid = cpriceauditid;
-    }
-
-    public String getCprojectid() {
-        return cprojectid;
-    }
-
-    public void setCprojectid(String cprojectid) {
-        this.cprojectid = cprojectid;
-    }
-
-    public String getCprojectphaseid() {
-        return cprojectphaseid;
-    }
-
-    public void setCprojectphaseid(String cprojectphaseid) {
-        this.cprojectphaseid = cprojectphaseid;
-    }
-
-    public String getCqpbaseschemeid() {
-        return cqpbaseschemeid;
-    }
-
-    public void setCqpbaseschemeid(String cqpbaseschemeid) {
-        this.cqpbaseschemeid = cqpbaseschemeid;
-    }
-
-    public String getCrowno() {
-        return crowno;
-    }
-
-    public void setCrowno(String crowno) {
-        this.crowno = crowno;
-    }
-
-    public String getCsourcebillid() {
-        return csourcebillid;
-    }
-
-    public void setCsourcebillid(String csourcebillid) {
-        this.csourcebillid = csourcebillid;
-    }
-
-    public String getCsourcebilltype() {
-        return csourcebilltype;
-    }
-
-    public void setCsourcebilltype(String csourcebilltype) {
-        this.csourcebilltype = csourcebilltype;
-    }
-
-    public String getCsourcerowid() {
-        return csourcerowid;
-    }
-
-    public void setCsourcerowid(String csourcerowid) {
-        this.csourcerowid = csourcerowid;
-    }
-
-    public String getCupsourcebillid() {
-        return cupsourcebillid;
-    }
-
-    public void setCupsourcebillid(String cupsourcebillid) {
-        this.cupsourcebillid = cupsourcebillid;
-    }
-
-    public String getCupsourcebillrowid() {
-        return cupsourcebillrowid;
-    }
-
-    public void setCupsourcebillrowid(String cupsourcebillrowid) {
-        this.cupsourcebillrowid = cupsourcebillrowid;
-    }
-
-    public String getCupsourcebilltype() {
-        return cupsourcebilltype;
-    }
-
-    public void setCupsourcebilltype(String cupsourcebilltype) {
-        this.cupsourcebilltype = cupsourcebilltype;
-    }
-
-    public String getCusedeptid() {
-        return cusedeptid;
-    }
-
-    public void setCusedeptid(String cusedeptid) {
-        this.cusedeptid = cusedeptid;
-    }
-
-    public String getCvenddevaddrid() {
-        return cvenddevaddrid;
-    }
-
-    public void setCvenddevaddrid(String cvenddevaddrid) {
-        this.cvenddevaddrid = cvenddevaddrid;
-    }
-
-    public String getCvenddevareaid() {
-        return cvenddevareaid;
-    }
-
-    public void setCvenddevareaid(String cvenddevareaid) {
-        this.cvenddevareaid = cvenddevareaid;
-    }
-
-    public String getCwarehouseid() {
-        return cwarehouseid;
-    }
-
-    public void setCwarehouseid(String cwarehouseid) {
-        this.cwarehouseid = cwarehouseid;
-    }
-
-    public String getDclosedate() {
-        return dclosedate;
-    }
-
-    public void setDclosedate(String dclosedate) {
-        this.dclosedate = dclosedate;
-    }
-
-    public String getDconfirmdate() {
-        return dconfirmdate;
-    }
-
-    public void setDconfirmdate(String dconfirmdate) {
-        this.dconfirmdate = dconfirmdate;
-    }
-
-    public String getDcorrectdate() {
-        return dcorrectdate;
-    }
-
-    public void setDcorrectdate(String dcorrectdate) {
-        this.dcorrectdate = dcorrectdate;
-    }
-
-    public String getDplanarrvdate() {
-        return dplanarrvdate;
-    }
-
-    public void setDplanarrvdate(String dplanarrvdate) {
-        this.dplanarrvdate = dplanarrvdate;
-    }
-
-    public Long getDr() {
-        return dr;
-    }
-
-    public void setDr(Long dr) {
-        this.dr = dr;
-    }
-
-    public Long getForderrowstatus() {
-        return forderrowstatus;
-    }
-
-    public void setForderrowstatus(Long forderrowstatus) {
-        this.forderrowstatus = forderrowstatus;
-    }
-
-    public String getIdiscounttaxtype() {
-        return idiscounttaxtype;
-    }
-
-    public void setIdiscounttaxtype(String idiscounttaxtype) {
-        this.idiscounttaxtype = idiscounttaxtype;
-    }
-
-    public Long getIisactive() {
-        return iisactive;
-    }
-
-    public void setIisactive(Long iisactive) {
-        this.iisactive = iisactive;
-    }
-
-    public Long getIisreplenish() {
-        return iisreplenish;
-    }
-
-    public void setIisreplenish(Long iisreplenish) {
-        this.iisreplenish = iisreplenish;
-    }
-
-    public String getNaccumarrvnum() {
-        return naccumarrvnum;
-    }
-
-    public void setNaccumarrvnum(String naccumarrvnum) {
-        this.naccumarrvnum = naccumarrvnum;
-    }
-
-    public String getNaccumdevnum() {
-        return naccumdevnum;
-    }
-
-    public void setNaccumdevnum(String naccumdevnum) {
-        this.naccumdevnum = naccumdevnum;
-    }
-
-    public String getNaccuminvoicenum() {
-        return naccuminvoicenum;
-    }
-
-    public void setNaccuminvoicenum(String naccuminvoicenum) {
-        this.naccuminvoicenum = naccuminvoicenum;
-    }
-
-    public String getNaccumrpnum() {
-        return naccumrpnum;
-    }
-
-    public void setNaccumrpnum(String naccumrpnum) {
-        this.naccumrpnum = naccumrpnum;
-    }
-
-    public String getNaccumstorenum() {
-        return naccumstorenum;
-    }
-
-    public void setNaccumstorenum(String naccumstorenum) {
-        this.naccumstorenum = naccumstorenum;
-    }
-
-    public String getNaccumwastnum() {
-        return naccumwastnum;
-    }
-
-    public void setNaccumwastnum(String naccumwastnum) {
-        this.naccumwastnum = naccumwastnum;
-    }
-
-    public String getNassistnum() {
-        return nassistnum;
-    }
-
-    public void setNassistnum(String nassistnum) {
-        this.nassistnum = nassistnum;
-    }
-
-    public String getNbackarrvnum() {
-        return nbackarrvnum;
-    }
-
-    public void setNbackarrvnum(String nbackarrvnum) {
-        this.nbackarrvnum = nbackarrvnum;
-    }
-
-    public String getNbackstorenum() {
-        return nbackstorenum;
-    }
-
-    public void setNbackstorenum(String nbackstorenum) {
-        this.nbackstorenum = nbackstorenum;
-    }
-
-    public String getNconfirmnum() {
-        return nconfirmnum;
-    }
-
-    public void setNconfirmnum(String nconfirmnum) {
-        this.nconfirmnum = nconfirmnum;
-    }
-
-    public String getNdiscountrate() {
-        return ndiscountrate;
-    }
-
-    public void setNdiscountrate(String ndiscountrate) {
-        this.ndiscountrate = ndiscountrate;
-    }
-
-    public String getNexchangeotobrate() {
-        return nexchangeotobrate;
-    }
-
-    public void setNexchangeotobrate(String nexchangeotobrate) {
-        this.nexchangeotobrate = nexchangeotobrate;
-    }
-
-    public String getNfeemny() {
-        return nfeemny;
-    }
-
-    public void setNfeemny(String nfeemny) {
-        this.nfeemny = nfeemny;
-    }
-
-    public String getNmoney() {
-        return nmoney;
-    }
-
-    public void setNmoney(String nmoney) {
-        this.nmoney = nmoney;
-    }
-
-    public String getNordernum() {
-        return nordernum;
-    }
-
-    public void setNordernum(String nordernum) {
-        this.nordernum = nordernum;
-    }
-
-    public String getNorgnettaxprice() {
-        return norgnettaxprice;
-    }
-
-    public void setNorgnettaxprice(String norgnettaxprice) {
-        this.norgnettaxprice = norgnettaxprice;
-    }
-
-    public String getNorgtaxprice() {
-        return norgtaxprice;
-    }
-
-    public void setNorgtaxprice(String norgtaxprice) {
-        this.norgtaxprice = norgtaxprice;
-    }
-
-    public String getNoriginalcurmny() {
-        return noriginalcurmny;
-    }
-
-    public void setNoriginalcurmny(String noriginalcurmny) {
-        this.noriginalcurmny = noriginalcurmny;
-    }
-
-    public String getNoriginalcurprice() {
-        return noriginalcurprice;
-    }
-
-    public void setNoriginalcurprice(String noriginalcurprice) {
-        this.noriginalcurprice = noriginalcurprice;
-    }
-
-    public String getNoriginalnetprice() {
-        return noriginalnetprice;
-    }
-
-    public void setNoriginalnetprice(String noriginalnetprice) {
-        this.noriginalnetprice = noriginalnetprice;
-    }
-
-    public String getNoriginaltaxmny() {
-        return noriginaltaxmny;
-    }
-
-    public void setNoriginaltaxmny(String noriginaltaxmny) {
-        this.noriginaltaxmny = noriginaltaxmny;
-    }
-
-    public String getNoriginaltaxpricemny() {
-        return noriginaltaxpricemny;
-    }
-
-    public void setNoriginaltaxpricemny(String noriginaltaxpricemny) {
-        this.noriginaltaxpricemny = noriginaltaxpricemny;
-    }
-
-    public String getNtaxmny() {
-        return ntaxmny;
-    }
-
-    public void setNtaxmny(String ntaxmny) {
-        this.ntaxmny = ntaxmny;
-    }
-
-    public String getNtaxpricemny() {
-        return ntaxpricemny;
-    }
-
-    public void setNtaxpricemny(String ntaxpricemny) {
-        this.ntaxpricemny = ntaxpricemny;
-    }
-
-    public String getNtaxrate() {
-        return ntaxrate;
-    }
-
-    public void setNtaxrate(String ntaxrate) {
-        this.ntaxrate = ntaxrate;
-    }
-
-    public String getPkArrvcorp() {
-        return pkArrvcorp;
-    }
-
-    public void setPkArrvcorp(String pkArrvcorp) {
-        this.pkArrvcorp = pkArrvcorp;
-    }
-
-    public String getPkArrvstoorg() {
-        return pkArrvstoorg;
-    }
-
-    public void setPkArrvstoorg(String pkArrvstoorg) {
-        this.pkArrvstoorg = pkArrvstoorg;
-    }
-
-    public String getPkCorp() {
-        return pkCorp;
-    }
-
-    public void setPkCorp(String pkCorp) {
-        this.pkCorp = pkCorp;
-    }
-
-    public String getPkCreqwareid() {
-        return pkCreqwareid;
-    }
-
-    public void setPkCreqwareid(String pkCreqwareid) {
-        this.pkCreqwareid = pkCreqwareid;
-    }
-
-    public String getPkDefdoc1() {
-        return pkDefdoc1;
-    }
-
-    public void setPkDefdoc1(String pkDefdoc1) {
-        this.pkDefdoc1 = pkDefdoc1;
-    }
-
-    public String getPkDefdoc10() {
-        return pkDefdoc10;
-    }
-
-    public void setPkDefdoc10(String pkDefdoc10) {
-        this.pkDefdoc10 = pkDefdoc10;
-    }
-
-    public String getPkDefdoc11() {
-        return pkDefdoc11;
-    }
-
-    public void setPkDefdoc11(String pkDefdoc11) {
-        this.pkDefdoc11 = pkDefdoc11;
-    }
-
-    public String getPkDefdoc12() {
-        return pkDefdoc12;
-    }
-
-    public void setPkDefdoc12(String pkDefdoc12) {
-        this.pkDefdoc12 = pkDefdoc12;
-    }
-
-    public String getPkDefdoc13() {
-        return pkDefdoc13;
-    }
-
-    public void setPkDefdoc13(String pkDefdoc13) {
-        this.pkDefdoc13 = pkDefdoc13;
-    }
-
-    public String getPkDefdoc14() {
-        return pkDefdoc14;
-    }
-
-    public void setPkDefdoc14(String pkDefdoc14) {
-        this.pkDefdoc14 = pkDefdoc14;
-    }
-
-    public String getPkDefdoc15() {
-        return pkDefdoc15;
-    }
-
-    public void setPkDefdoc15(String pkDefdoc15) {
-        this.pkDefdoc15 = pkDefdoc15;
-    }
-
-    public String getPkDefdoc16() {
-        return pkDefdoc16;
-    }
-
-    public void setPkDefdoc16(String pkDefdoc16) {
-        this.pkDefdoc16 = pkDefdoc16;
-    }
-
-    public String getPkDefdoc17() {
-        return pkDefdoc17;
-    }
-
-    public void setPkDefdoc17(String pkDefdoc17) {
-        this.pkDefdoc17 = pkDefdoc17;
-    }
-
-    public String getPkDefdoc18() {
-        return pkDefdoc18;
-    }
-
-    public void setPkDefdoc18(String pkDefdoc18) {
-        this.pkDefdoc18 = pkDefdoc18;
-    }
-
-    public String getPkDefdoc19() {
-        return pkDefdoc19;
-    }
-
-    public void setPkDefdoc19(String pkDefdoc19) {
-        this.pkDefdoc19 = pkDefdoc19;
-    }
-
-    public String getPkDefdoc2() {
-        return pkDefdoc2;
-    }
-
-    public void setPkDefdoc2(String pkDefdoc2) {
-        this.pkDefdoc2 = pkDefdoc2;
-    }
-
-    public String getPkDefdoc20() {
-        return pkDefdoc20;
-    }
-
-    public void setPkDefdoc20(String pkDefdoc20) {
-        this.pkDefdoc20 = pkDefdoc20;
-    }
-
-    public String getPkDefdoc3() {
-        return pkDefdoc3;
-    }
-
-    public void setPkDefdoc3(String pkDefdoc3) {
-        this.pkDefdoc3 = pkDefdoc3;
-    }
-
-    public String getPkDefdoc4() {
-        return pkDefdoc4;
-    }
-
-    public void setPkDefdoc4(String pkDefdoc4) {
-        this.pkDefdoc4 = pkDefdoc4;
-    }
-
-    public String getPkDefdoc5() {
-        return pkDefdoc5;
-    }
-
-    public void setPkDefdoc5(String pkDefdoc5) {
-        this.pkDefdoc5 = pkDefdoc5;
-    }
-
-    public String getPkDefdoc6() {
-        return pkDefdoc6;
-    }
-
-    public void setPkDefdoc6(String pkDefdoc6) {
-        this.pkDefdoc6 = pkDefdoc6;
-    }
-
-    public String getPkDefdoc7() {
-        return pkDefdoc7;
-    }
-
-    public void setPkDefdoc7(String pkDefdoc7) {
-        this.pkDefdoc7 = pkDefdoc7;
-    }
-
-    public String getPkDefdoc8() {
-        return pkDefdoc8;
-    }
-
-    public void setPkDefdoc8(String pkDefdoc8) {
-        this.pkDefdoc8 = pkDefdoc8;
-    }
-
-    public String getPkDefdoc9() {
-        return pkDefdoc9;
-    }
-
-    public void setPkDefdoc9(String pkDefdoc9) {
-        this.pkDefdoc9 = pkDefdoc9;
-    }
-
-    public String getPkInvoicecorp() {
-        return pkInvoicecorp;
-    }
-
-    public void setPkInvoicecorp(String pkInvoicecorp) {
-        this.pkInvoicecorp = pkInvoicecorp;
-    }
-
-    public String getPkReqcorp() {
-        return pkReqcorp;
-    }
-
-    public void setPkReqcorp(String pkReqcorp) {
-        this.pkReqcorp = pkReqcorp;
-    }
-
-    public String getPkReqstoorg() {
-        return pkReqstoorg;
-    }
-
-    public void setPkReqstoorg(String pkReqstoorg) {
-        this.pkReqstoorg = pkReqstoorg;
-    }
-
-    public String getPkUpsrccorp() {
-        return pkUpsrccorp;
-    }
-
-    public void setPkUpsrccorp(String pkUpsrccorp) {
-        this.pkUpsrccorp = pkUpsrccorp;
-    }
-
-    public String getTs() {
-        return ts;
-    }
-
-    public void setTs(String ts) {
-        this.ts = ts;
-    }
-
-    public String getVdef1() {
-        return vdef1;
-    }
-
-    public void setVdef1(String vdef1) {
-        this.vdef1 = vdef1;
-    }
-
-    public String getVdef10() {
-        return vdef10;
-    }
-
-    public void setVdef10(String vdef10) {
-        this.vdef10 = vdef10;
-    }
-
-    public String getVdef11() {
-        return vdef11;
-    }
-
-    public void setVdef11(String vdef11) {
-        this.vdef11 = vdef11;
-    }
-
-    public String getVdef12() {
-        return vdef12;
-    }
-
-    public void setVdef12(String vdef12) {
-        this.vdef12 = vdef12;
-    }
-
-    public String getVdef13() {
-        return vdef13;
-    }
-
-    public void setVdef13(String vdef13) {
-        this.vdef13 = vdef13;
-    }
-
-    public String getVdef14() {
-        return vdef14;
-    }
-
-    public void setVdef14(String vdef14) {
-        this.vdef14 = vdef14;
-    }
-
-    public String getVdef15() {
-        return vdef15;
-    }
-
-    public void setVdef15(String vdef15) {
-        this.vdef15 = vdef15;
-    }
-
-    public String getVdef16() {
-        return vdef16;
-    }
-
-    public void setVdef16(String vdef16) {
-        this.vdef16 = vdef16;
-    }
-
-    public String getVdef17() {
-        return vdef17;
-    }
-
-    public void setVdef17(String vdef17) {
-        this.vdef17 = vdef17;
-    }
-
-    public String getVdef18() {
-        return vdef18;
-    }
-
-    public void setVdef18(String vdef18) {
-        this.vdef18 = vdef18;
-    }
-
-    public String getVdef19() {
-        return vdef19;
-    }
-
-    public void setVdef19(String vdef19) {
-        this.vdef19 = vdef19;
-    }
-
-    public String getVdef2() {
-        return vdef2;
-    }
-
-    public void setVdef2(String vdef2) {
-        this.vdef2 = vdef2;
-    }
-
-    public String getVdef20() {
-        return vdef20;
-    }
-
-    public void setVdef20(String vdef20) {
-        this.vdef20 = vdef20;
-    }
-
-    public String getVdef3() {
-        return vdef3;
-    }
-
-    public void setVdef3(String vdef3) {
-        this.vdef3 = vdef3;
-    }
-
-    public String getVdef4() {
-        return vdef4;
-    }
-
-    public void setVdef4(String vdef4) {
-        this.vdef4 = vdef4;
-    }
-
-    public String getVdef5() {
-        return vdef5;
-    }
-
-    public void setVdef5(String vdef5) {
-        this.vdef5 = vdef5;
-    }
-
-    public String getVdef6() {
-        return vdef6;
-    }
-
-    public void setVdef6(String vdef6) {
-        this.vdef6 = vdef6;
-    }
-
-    public String getVdef7() {
-        return vdef7;
-    }
-
-    public void setVdef7(String vdef7) {
-        this.vdef7 = vdef7;
-    }
-
-    public String getVdef8() {
-        return vdef8;
-    }
-
-    public void setVdef8(String vdef8) {
-        this.vdef8 = vdef8;
-    }
-
-    public String getVdef9() {
-        return vdef9;
-    }
-
-    public void setVdef9(String vdef9) {
-        this.vdef9 = vdef9;
-    }
-
-    public String getVecbilltype() {
-        return vecbilltype;
-    }
-
-    public void setVecbilltype(String vecbilltype) {
-        this.vecbilltype = vecbilltype;
-    }
-
-    public String getVfree1() {
-        return vfree1;
-    }
-
-    public void setVfree1(String vfree1) {
-        this.vfree1 = vfree1;
-    }
-
-    public String getVfree2() {
-        return vfree2;
-    }
-
-    public void setVfree2(String vfree2) {
-        this.vfree2 = vfree2;
-    }
-
-    public String getVfree3() {
-        return vfree3;
-    }
-
-    public void setVfree3(String vfree3) {
-        this.vfree3 = vfree3;
-    }
-
-    public String getVfree4() {
-        return vfree4;
-    }
-
-    public void setVfree4(String vfree4) {
-        this.vfree4 = vfree4;
-    }
-
-    public String getVfree5() {
-        return vfree5;
-    }
-
-    public void setVfree5(String vfree5) {
-        this.vfree5 = vfree5;
-    }
-
-    public String getVmemo() {
-        return vmemo;
-    }
-
-    public void setVmemo(String vmemo) {
-        this.vmemo = vmemo;
-    }
-
-    public String getVpriceauditcode() {
-        return vpriceauditcode;
-    }
-
-    public void setVpriceauditcode(String vpriceauditcode) {
-        this.vpriceauditcode = vpriceauditcode;
-    }
-
-    public String getVproducenum() {
-        return vproducenum;
-    }
-
-    public void setVproducenum(String vproducenum) {
-        this.vproducenum = vproducenum;
-    }
-
-    public String getVreceiveaddress() {
-        return vreceiveaddress;
-    }
-
-    public void setVreceiveaddress(String vreceiveaddress) {
-        this.vreceiveaddress = vreceiveaddress;
-    }
-
-    public String getVvenddevaddr() {
-        return vvenddevaddr;
-    }
-
-    public void setVvenddevaddr(String vvenddevaddr) {
-        this.vvenddevaddr = vvenddevaddr;
-    }
-
-    public String getVvendinventorycode() {
-        return vvendinventorycode;
-    }
-
-    public void setVvendinventorycode(String vvendinventorycode) {
-        this.vvendinventorycode = vvendinventorycode;
-    }
-
-    public String getVvendinventoryname() {
-        return vvendinventoryname;
-    }
-
-    public void setVvendinventoryname(String vvendinventoryname) {
-        this.vvendinventoryname = vvendinventoryname;
-    }
-
-    public String getVvendorordercode() {
-        return vvendorordercode;
-    }
-
-    public void setVvendorordercode(String vvendorordercode) {
-        this.vvendorordercode = vvendorordercode;
-    }
-
-    public String getVvendororderrow() {
-        return vvendororderrow;
-    }
-
-    public void setVvendororderrow(String vvendororderrow) {
-        this.vvendororderrow = vvendororderrow;
-    }
 
+    //查询存货对应的最新采购价
+    private String invcodes;
+    private String pk_invmandoc;
+    private String pk_corp;
+    private String unitname;
+    private String invcode;
 }
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/PoOrderBEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/PoOrderBEntity.xml
index f316d52d..b1848a19 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/PoOrderBEntity.xml
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/PoOrderBEntity.xml
@@ -137,7 +137,12 @@
         <result property="vvendinventoryname" column="vvendinventoryname" jdbcType="VARCHAR"/>
         <result property="vvendorordercode" column="vvendorordercode" jdbcType="VARCHAR"/>
         <result property="vvendororderrow" column="vvendororderrow" jdbcType="VARCHAR"/>
+        <result property="pk_invmandoc" column="pk_invmandoc" jdbcType="VARCHAR"/>
+        <result property="pk_corp" column="pk_corp" jdbcType="VARCHAR"/>
+        <result property="unitname" column="unitname" jdbcType="VARCHAR"/>
+        <result property="invcode" column="invcode" jdbcType="VARCHAR"/>
     </resultMap>
+
     <!-- 查询的字段-->
     <sql id="PoOrderBEntity_Base_Column_List">
         blargess
@@ -1814,5 +1819,26 @@
         where corder_bid = #{corderBid}
     </delete>
 
+    <!--查询某个存货最新的采购单价-->
+    <select id="queryPurchaseUnitPriceByInvcodes" parameterType="com.hzya.frame.plugin.lets.entity.PoOrderBEntity" resultMap="get-PoOrderBEntity-result">
+        SELECT
+            t.cmangid,
+            t.norgtaxprice,
+            t.ts,
+            b.pk_invmandoc,
+            b.pk_corp,
+            bc.unitname,
+            bi.invcode
+        FROM
+            ( SELECT pob.*, ROW_NUMBER ( ) OVER ( PARTITION BY CMANGID ORDER BY ts DESC ) AS row_number FROM po_order_b pob ) t
+                LEFT JOIN bd_invmandoc b ON b.pk_invmandoc = t.cmangid
+                LEFT JOIN bd_corp bc ON bc.pk_corp = b.pk_corp
+                LEFT JOIN bd_invbasdoc bi ON bi.pk_invbasdoc = b.pk_invbasdoc
+        WHERE
+            t.row_number = 1
+            <if test="invcodes!=null and invcodes!=''">
+                and bi.invcode in ${invcodes}
+            </if>
+    </select>
 </mapper>
 
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/BalanceUnitPriceUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/BalanceUnitPriceUtil.java
new file mode 100644
index 00000000..8a64a3be
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/BalanceUnitPriceUtil.java
@@ -0,0 +1,85 @@
+package com.hzya.frame.plugin.lets.util;
+
+import com.hzya.frame.plugin.lets.dao.IIaPeriodaccountDao;
+import com.hzya.frame.plugin.lets.dao.IPoOrderBDao;
+import com.hzya.frame.plugin.lets.entity.BdInvbasdocEntity;
+import com.hzya.frame.plugin.lets.entity.IaPeriodaccountEntity;
+import com.hzya.frame.plugin.lets.entity.PoOrderBEntity;
+import com.hzya.frame.split.SplitListByCountUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 得到存货的结存单价和采购价
+ *
+ * @Author:liuyang
+ * @Package:com.hzya.frame.plugin.lets.util
+ * @Project:kangarooDataCenterV3
+ * @name:BalanceUnitPriceUtil
+ * @Date:2024/10/17 09:17
+ * @Filename:BalanceUnitPriceUtil
+ */
+@Component
+public class BalanceUnitPriceUtil {
+
+    @Autowired
+    private IIaPeriodaccountDao iIaPeriodaccountDao;
+
+    @Autowired
+    private IPoOrderBDao iPoOrderBDao;
+
+    public Boolean checkOfsShop() {
+        return false;
+    }
+
+    /**
+     * 查询存货的结存金额、数量等信息
+     * 需要手动计算一遍,用金额/数量,可能会有负结存的情况,我取绝对值
+     *
+     * @author liuyang
+     */
+    public List<IaPeriodaccountEntity> queryBalanceUnitPrice(List<BdInvbasdocEntity> bdInvbasdocEntityList) throws Exception {
+        List<IaPeriodaccountEntity> iaPeriodaccountEntityList = new ArrayList<>();
+        if (bdInvbasdocEntityList != null && bdInvbasdocEntityList.size() > 0) {
+            List<List<BdInvbasdocEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(bdInvbasdocEntityList, 100);
+            for (int i = 0; i < splitListByCount.size(); i++) {
+                List<BdInvbasdocEntity> bdInvbasdocEntities = splitListByCount.get(i);
+
+                String invcodes = bdInvbasdocEntities.stream().map(bdInvbasdoc -> "'" + bdInvbasdoc.getInvcode() + "'").collect(Collectors.joining(","));
+                IaPeriodaccountEntity iaPeriodaccountEntity = new IaPeriodaccountEntity();
+                iaPeriodaccountEntity.setDataSourceCode("lets_u8c");
+                iaPeriodaccountEntity.setInvcodes(invcodes);
+                List<IaPeriodaccountEntity> iaPeriodaccountEntityList1 = iIaPeriodaccountDao.queryBalancePrice(iaPeriodaccountEntity);
+                iaPeriodaccountEntityList.addAll(iaPeriodaccountEntityList1);
+            }
+        }
+        return iaPeriodaccountEntityList;
+    }
+
+    /**
+     * 查询存货对应的采购单价
+     *
+     * @author liuyang
+     */
+    public List<PoOrderBEntity> queryPurchaseUnitPriceByInvcodes(List<BdInvbasdocEntity> bdInvbasdocEntityList) throws Exception {
+        List<PoOrderBEntity> poOrderBEntityList = new ArrayList<>();
+        if (bdInvbasdocEntityList != null && bdInvbasdocEntityList.size() > 0) {
+            List<List<BdInvbasdocEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(bdInvbasdocEntityList, 100);
+            for (int i = 0; i < splitListByCount.size(); i++) {
+                List<BdInvbasdocEntity> bdInvbasdocEntities = splitListByCount.get(i);
+                String invcodes = bdInvbasdocEntities.stream().map(bdInvbasdoc -> "'" + bdInvbasdoc.getInvcode() + "'").collect(Collectors.joining(","));
+
+                PoOrderBEntity poOrderBEntity = new PoOrderBEntity();
+                poOrderBEntity.setInvcodes(invcodes);
+                poOrderBEntity.setDataSourceCode("lets_u8c");
+                List<PoOrderBEntity> poOrderBEntityList1 = iPoOrderBDao.queryPurchaseUnitPriceByInvcodes(poOrderBEntity);
+                poOrderBEntityList.addAll(poOrderBEntityList1);
+            }
+        }
+        return poOrderBEntityList;
+    }
+}
\ No newline at end of file
diff --git a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml
index 224aae8c..08e1a40b 100644
--- a/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml
+++ b/buildpackage/src/main/resources/cfgHome/plugin/lets/spring/spring-lets-dao.xml
@@ -64,4 +64,6 @@
 
     <bean name="onlyAfterSalesHDao" class="com.hzya.frame.plugin.lets.dao.impl.OnlyAfterSalesHDaoImpl"/>
     <bean name="onlyAfterSalesBDao" class="com.hzya.frame.plugin.lets.dao.impl.OnlyAfterSalesBDaoImpl"/>
+
+    <bean name="iaPeriodaccountDao" class="com.hzya.frame.plugin.lets.dao.impl.IaPeriodaccountDaoImpl"/>
 </beans>
\ No newline at end of file