Commit 55d67351 by 宋祥

1.采购入库实体类和XML

parent f2d28b86
...@@ -7,6 +7,54 @@ package com.baosight.hpjx.hp.constant; ...@@ -7,6 +7,54 @@ package com.baosight.hpjx.hp.constant;
public class HPSqlConstant { public class HPSqlConstant {
/** /**
* HPKC001 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC001 {
// 统计
public static final String STAT_DATE = "HPKC001.statDate";
}
/**
* HPKC002 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC002 {
// 统计
public static final String STAT_DATE = "HPKC002.statDate";
}
/**
* HPKC003 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC003 {
// 统计
public static final String STAT_DATE = "HPKC003.statDate";
}
/**
* HPKC004 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC004 {
// 统计
public static final String STAT_DATE = "HPKC004.statDate";
}
/**
* HPKC005 SQL 定义 * HPKC005 SQL 定义
* *
* @author:songx * @author:songx
...@@ -32,6 +80,8 @@ public class HPSqlConstant { ...@@ -32,6 +80,8 @@ public class HPSqlConstant {
public static final String QUERY_SUM = "HPKC006.querySum"; public static final String QUERY_SUM = "HPKC006.querySum";
// 锁 // 锁
public static final String LOCK = "HPKC006.lock"; public static final String LOCK = "HPKC006.lock";
// 统计
public static final String STAT_DATE = "HPKC006.statDate";
} }
/** /**
...@@ -46,6 +96,8 @@ public class HPSqlConstant { ...@@ -46,6 +96,8 @@ public class HPSqlConstant {
public static final String QUERY_SUM = "HPKC007.querySum"; public static final String QUERY_SUM = "HPKC007.querySum";
// 锁 // 锁
public static final String LOCK = "HPKC007.lock"; public static final String LOCK = "HPKC007.lock";
// 统计
public static final String STAT_DATE = "HPKC007.statDate";
} }
/** /**
......
...@@ -177,25 +177,25 @@ public class ServiceHPKC009 extends ServiceBase { ...@@ -177,25 +177,25 @@ public class ServiceHPKC009 extends ServiceBase {
private List<HPKC009> statCg(Map queryMap) { private List<HPKC009> statCg(Map queryMap) {
Map<String, HPKC009> kc009Map = new HashMap(); Map<String, HPKC009> kc009Map = new HashMap();
// 1.1、期末库存 // 1.1、期末库存
List<HPKC001> aItems = dao.query("HPKC001.statDate", new HashMap<>()); List<HPKC001> aItems = dao.query(HPSqlConstant.HPKC001.STAT_DATE, new HashMap<>());
// 1.2、收入 // 1.2、收入
queryMap.put("createdTimeFrom", queryMap.get("yesterFrom") + "000000"); queryMap.put("createdTimeFrom", queryMap.get("yesterFrom") + "000000");
queryMap.put("createdTimeTo", queryMap.get("yesterTo") + "235959"); queryMap.put("createdTimeTo", queryMap.get("yesterTo") + "235959");
List<HPKC001> bKc001s = dao.query("HPKC001.statDate", queryMap); List<HPKC001> bKc001s = dao.query(HPSqlConstant.HPKC001.STAT_DATE, queryMap);
Map<String, HPKC001> bKc001Map = bKc001s.stream().collect(Collectors.toMap(item -> Map<String, HPKC001> bKc001Map = bKc001s.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMaterialType() + "#" + item.getMaterialCode() + "#" + item.getInventType() + "#" + item.getInventCode() + "#"
+ item.getSpec(), item -> item)); + item.getInventRecordId(), item -> item));
// 1.3、发出 // 1.3、发出
List<HPKC002> cKc002s = dao.query("HPKC002.statDate", queryMap); List<HPKC002> cKc002s = dao.query(HPSqlConstant.HPKC002.STAT_DATE, queryMap);
Map<String, HPKC002> cKc001Map = cKc002s.stream().collect(Collectors.toMap(item -> Map<String, HPKC002> cKc001Map = cKc002s.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getMaterialType() + "#" + item.getMaterialCode() + "#" + item.getInventType() + "#" + item.getInventCode() + "#"
+ item.getSpec(), item -> item)); + item.getInventRecordId(), item -> item));
// 1.4、期初库存 // 1.4、期初库存
queryMap.put("dateProc", queryMap.get("beforeDate")); queryMap.put("dateProc", queryMap.get("beforeDate"));
queryMap.put("kcType", HPConstant.KcType.CG); queryMap.put("kcType", HPConstant.KcType.CG);
List<HPKC009> dKc009s = dao.query("HPKC009.query", new HashMap<>()); List<HPKC009> dKc009s = dao.query(HPKC009.QUERY, new HashMap<>());
Map<String, HPKC009> dKc009Map = dKc009s.stream().collect(Collectors.toMap(item -> Map<String, HPKC009> dKc009Map = dKc009s.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode() + "#" + item.getInventType() + "#" + item.getInventCode() + "#"
...@@ -203,24 +203,24 @@ public class ServiceHPKC009 extends ServiceBase { ...@@ -203,24 +203,24 @@ public class ServiceHPKC009 extends ServiceBase {
// 根据期末库存生成收发存对象 // 根据期末库存生成收发存对象
for (HPKC001 aItem : aItems) { for (HPKC001 aItem : aItems) {
String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#" String key = aItem.getCompanyCode() + "#" + aItem.getDepCode() + "#"
+ aItem.getWhCode() + "#" + aItem.getMaterialType() + "#" + aItem.getWhCode() + "#" + aItem.getInventType() + "#"
+ aItem.getMaterialCode() + "#" + aItem.getSpec(); + aItem.getInventCode() + "#" + aItem.getInventRecordId();
HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class); HPKC009 kc009 = BeanUtils.copy(aItem, HPKC009.class);
kc009.setInventType(aItem.getMaterialType()); kc009.setInventType(aItem.getInventType());
kc009.setInventCode(aItem.getMaterialCode()); kc009.setInventCode(aItem.getInventCode());
kc009.setKcType(HPConstant.KcType.CG); kc009.setKcType(HPConstant.KcType.CG);
kc009.setDateType(queryMap.get("dateType").toString()); kc009.setDateType(queryMap.get("dateType").toString());
kc009.setDateProc(queryMap.get("yesterDate").toString()); kc009.setDateProc(queryMap.get("yesterDate").toString());
// 期末 // 期末
kc009.setEndAmount(BigDecimal.valueOf(aItem.getQuantity())); kc009.setEndAmount(aItem.getAmount());
kc009.setEndWeight(aItem.getWeight()); kc009.setEndWeight(aItem.getWeight());
// 收入 // 收入
HPKC001 bKc001 = bKc001Map.get(key); HPKC001 bKc001 = bKc001Map.get(key);
kc009.setEnterAmount(bKc001 == null ? BigDecimal.ZERO : BigDecimal.valueOf(bKc001.getQuantity())); kc009.setEnterAmount(bKc001 == null ? BigDecimal.ZERO : bKc001.getAmount());
kc009.setEnterWeight(bKc001 == null ? BigDecimal.ZERO : bKc001.getWeight()); kc009.setEnterWeight(bKc001 == null ? BigDecimal.ZERO : bKc001.getWeight());
// 发出 // 发出
HPKC002 cKc002 = cKc001Map.get(key); HPKC002 cKc002 = cKc001Map.get(key);
kc009.setOuterAmount(cKc002 == null ? BigDecimal.ZERO : BigDecimal.valueOf(cKc002.getQuantity())); kc009.setOuterAmount(cKc002 == null ? BigDecimal.ZERO : cKc002.getAmount());
kc009.setOuterWeight(cKc002 == null ? BigDecimal.ZERO : cKc002.getWeight()); kc009.setOuterWeight(cKc002 == null ? BigDecimal.ZERO : cKc002.getWeight());
// 期初 // 期初
HPKC009 dKc009 = dKc009Map.get(key); HPKC009 dKc009 = dKc009Map.get(key);
...@@ -247,23 +247,23 @@ public class ServiceHPKC009 extends ServiceBase { ...@@ -247,23 +247,23 @@ public class ServiceHPKC009 extends ServiceBase {
private List<HPKC009> statSc(Map queryMap) { private List<HPKC009> statSc(Map queryMap) {
Map<String, HPKC009> kc009Map = new HashMap(); Map<String, HPKC009> kc009Map = new HashMap();
// 1.1、期末库存 // 1.1、期末库存
List<HPKC003> aItems = dao.query("HPKC003.statDate", new HashMap<>()); List<HPKC003> aItems = dao.query(HPSqlConstant.HPKC003.STAT_DATE, new HashMap<>());
// 1.2、收入 // 1.2、收入
queryMap.put("createdTimeFrom", queryMap.get("yesterday") + "000000"); queryMap.put("createdTimeFrom", queryMap.get("yesterday") + "000000");
queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959"); queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959");
List<HPKC003> bItems = dao.query("HPKC003.statDate", queryMap); List<HPKC003> bItems = dao.query(HPSqlConstant.HPKC003.STAT_DATE, queryMap);
Map<String, HPKC003> bItemMap = bItems.stream().collect(Collectors.toMap(item -> Map<String, HPKC003> bItemMap = bItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode(), item -> item)); + item.getInventType() + "#" + item.getInventCode(), item -> item));
// 1.3、发出 // 1.3、发出
List<HPKC004> cItems = dao.query("HPKC004.statDate", queryMap); List<HPKC004> cItems = dao.query(HPSqlConstant.HPKC004.STAT_DATE, queryMap);
Map<String, HPKC004> cItemMap = cItems.stream().collect(Collectors.toMap(item -> Map<String, HPKC004> cItemMap = cItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode(), item -> item)); + item.getInventType() + "#" + item.getInventCode(), item -> item));
// 1.4、期初库存 // 1.4、期初库存
queryMap.put("dateProc", queryMap.get("beforeDate")); queryMap.put("dateProc", queryMap.get("beforeDate"));
queryMap.put("kcType", HPConstant.KcType.SC); queryMap.put("kcType", HPConstant.KcType.SC);
List<HPKC009> dItems = dao.query("HPKC009.query", new HashMap<>()); List<HPKC009> dItems = dao.query(HPKC009.QUERY, new HashMap<>());
Map<String, HPKC009> dItemMap = dItems.stream().collect(Collectors.toMap(item -> Map<String, HPKC009> dItemMap = dItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode(), item -> item)); + item.getInventType() + "#" + item.getInventCode(), item -> item));
...@@ -315,23 +315,23 @@ public class ServiceHPKC009 extends ServiceBase { ...@@ -315,23 +315,23 @@ public class ServiceHPKC009 extends ServiceBase {
private List<HPKC009> statQt(Map queryMap) { private List<HPKC009> statQt(Map queryMap) {
Map<String, HPKC009> kc009Map = new HashMap(); Map<String, HPKC009> kc009Map = new HashMap();
// 1.1、期末库存 // 1.1、期末库存
List<HPKC006> aItems = dao.query("HPKC006.statDate", new HashMap<>()); List<HPKC006> aItems = dao.query(HPSqlConstant.HPKC006.STAT_DATE, new HashMap<>());
// 1.2、收入 // 1.2、收入
queryMap.put("createdTimeFrom", queryMap.get("yesterday") + "000000"); queryMap.put("createdTimeFrom", queryMap.get("yesterday") + "000000");
queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959"); queryMap.put("createdTimeTo", queryMap.get("yesterday") + "235959");
List<HPKC006> bItems = dao.query("HPKC006.statDate", queryMap); List<HPKC006> bItems = dao.query(HPSqlConstant.HPKC006.STAT_DATE, queryMap);
Map<String, HPKC006> bItemMap = bItems.stream().collect(Collectors.toMap(item -> Map<String, HPKC006> bItemMap = bItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode(), item -> item)); + item.getInventType() + "#" + item.getInventCode(), item -> item));
// 1.3、发出 // 1.3、发出
List<HPKC007> cItems = dao.query("HPKC007.statDate", queryMap); List<HPKC007> cItems = dao.query(HPSqlConstant.HPKC007.STAT_DATE, queryMap);
Map<String, HPKC007> cItemMap = cItems.stream().collect(Collectors.toMap(item -> Map<String, HPKC007> cItemMap = cItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode(), item -> item)); + item.getInventType() + "#" + item.getInventCode(), item -> item));
// 1.4、期初库存 // 1.4、期初库存
queryMap.put("dateProc", queryMap.get("beforeDate")); queryMap.put("dateProc", queryMap.get("beforeDate"));
queryMap.put("kcType", HPConstant.KcType.QT); queryMap.put("kcType", HPConstant.KcType.QT);
List<HPKC009> dItems = dao.query("HPKC009.query", new HashMap<>()); List<HPKC009> dItems = dao.query(HPKC009.QUERY, new HashMap<>());
Map<String, HPKC009> dItemMap = dItems.stream().collect(Collectors.toMap(item -> Map<String, HPKC009> dItemMap = dItems.stream().collect(Collectors.toMap(item ->
item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#" item.getCompanyCode() + "#" + item.getDepCode() + "#" + item.getWhCode() + "#"
+ item.getInventType() + "#" + item.getInventCode(), item -> item)); + item.getInventType() + "#" + item.getInventCode(), item -> item));
......
...@@ -30,23 +30,68 @@ ...@@ -30,23 +30,68 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="documentTime"> <isNotEmpty prepend=" AND " property="companyCode">
DOCUMENT_TIME = #documentTime# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="documentCode"> <isNotEmpty prepend=" AND " property="depCode">
DOCUMENT_CODE LIKE CONCAT('%',CONCAT( #documentCode#,'%')) DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="materialType"> <isNotEmpty prepend=" AND " property="createdBy">
MATERIAL_TYPE = #materialType# CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="purchaseCode">
PURCHASE_CODE = #purchaseCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode"> <isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode# WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="materialCode"> <isNotEmpty prepend=" AND " property="whName">
MATERIAL_CODE = #materialCode# WH_NAME = #whName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="inventType">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo# INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remarks">
REMARKS = #remarks#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="oldPurchaseCode">
OLD_PURCHASE_CODE = #oldPurchaseCode#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -133,17 +178,17 @@ ...@@ -133,17 +178,17 @@
COMPANY_CODE AS "companyCode", COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode", DEP_CODE AS "depCode",
WH_CODE AS "whCode", WH_CODE AS "whCode",
MATERIAL_TYPE AS "materialType", INVENT_TYPE AS "inventType",
MATERIAL_CODE AS "materialCode", INVENT_CODE AS "inventCode",
SPEC AS "spec", INVENT_RECORD_ID AS "inventRecordId",
COALESCE(SUM(QUANTITY), 0) AS "quantity", COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight" COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC001 FROM ${hpjxSchema}.T_HPKC001
WHERE 1=1 WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo# CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty> </isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MATERIAL_TYPE, MATERIAL_CODE, SPEC GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID
</select> </select>
</sqlMap> </sqlMap>
...@@ -30,23 +30,65 @@ ...@@ -30,23 +30,65 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="documentTime"> <isNotEmpty prepend=" AND " property="companyCode">
DOCUMENT_TIME = #documentTime# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="documentCode"> <isNotEmpty prepend=" AND " property="depCode">
DOCUMENT_CODE LIKE CONCAT('%',CONCAT( #documentCode#,'%')) DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="materialType"> <isNotEmpty prepend=" AND " property="createdBy">
MATERIAL_TYPE = #materialType# CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reqCode">
REQ_CODE = #reqCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode"> <isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode# WH_CODE = #whCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="materialCode"> <isNotEmpty prepend=" AND " property="whName">
MATERIAL_CODE = #materialCode# WH_NAME = #whName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="inventType">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo# INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remarks">
REMARKS = #remarks#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -128,17 +170,17 @@ ...@@ -128,17 +170,17 @@
COMPANY_CODE AS "companyCode", COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode", DEP_CODE AS "depCode",
WH_CODE AS "whCode", WH_CODE AS "whCode",
MATERIAL_TYPE AS "materialType", INVENT_TYPE AS "inventType",
MATERIAL_CODE AS "materialCode", INVENT_CODE AS "inventCode",
SPEC AS "spec", INVENT_RECORD_ID AS "inventRecordId",
COALESCE(SUM(QUANTITY), 0) AS "quantity", COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight" COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hpjxSchema}.T_HPKC002 FROM ${hpjxSchema}.T_HPKC002
WHERE 1=1 WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo# CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty> </isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, MATERIAL_TYPE, MATERIAL_CODE, SPEC GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID
</select> </select>
</sqlMap> </sqlMap>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment