新增接口和实现类以查询存货结存价和最新采购价- 添加 IIaPeriodaccountDao接口,用于查询存货结存价

- 实现 IaPeriodaccountDaoImpl 类,实现上述接口
- 在 IPoOrderBDao 接口新增查询最新采购价的方法
- 在 PoOrderBDaoImpl 类中实现新方法
- 创建 IaPeriodaccountEntity 实体类,用于处理存货会计期间数据
This commit is contained in:
liuy 2024-10-17 17:01:29 +08:00
parent 992e143bbc
commit 498a0da6ce
10 changed files with 926 additions and 1074 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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>

View File

@ -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>

View File

@ -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;
/**
* 得到存货的结存单价和采购价
*
* @Authorliuyang
* @Packagecom.hzya.frame.plugin.lets.util
* @ProjectkangarooDataCenterV3
* @nameBalanceUnitPriceUtil
* @Date2024/10/17 09:17
* @FilenameBalanceUnitPriceUtil
*/
@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;
}
}

View File

@ -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>