1、新增科目辅助余额插件。
This commit is contained in:
parent
89be574f19
commit
64843c4624
|
@ -0,0 +1,201 @@
|
|||
package com.hzya.frame.plugin.gm;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.plugin.gm.constant.ProfilesActiveConstant;
|
||||
import com.hzya.frame.plugin.gm.dao.IMdmGmSubjectBalanceDao;
|
||||
import com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity;
|
||||
import com.hzya.frame.plugin.gm.utils.SaveOrUpdateBusinessLogUtil;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* Created by zydd on 2025-08-01 14:31
|
||||
* 广脉:科目辅助余额表 同步
|
||||
* 根据科目同步余额
|
||||
* table:mdm_gm_subject_balance
|
||||
*/
|
||||
public class SubjectAssBalancePlugin extends PluginBaseEntity {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(SubjectAssBalancePlugin.class);
|
||||
|
||||
private static final ReentrantLock LOCK = new ReentrantLock(true);
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "gm.SubjectAssBalancePlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "广脉:科目辅助余额表同步";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "广脉:科目辅助余额表同步";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
try {
|
||||
logger.info("调用:" + getPluginName() + "-插件");
|
||||
String prod = "prod";
|
||||
String param = String.valueOf(requestJson.get("param"));
|
||||
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
|
||||
//按日期
|
||||
if (param != null && !"".equals(param)) {
|
||||
String[] split = param.split("/");
|
||||
if (!(split.length == 2)) {
|
||||
Assert.state(false, "时间格式传递不正确");
|
||||
}
|
||||
Assert.notNull(split[0], "开始时间不能为空");
|
||||
Assert.notNull(split[1], "结束时间不能为空");
|
||||
// start(split[0], split[1]);
|
||||
}
|
||||
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
|
||||
//默认
|
||||
start();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("executeBusiness方法抛出异常", e);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("插件执行成功");
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao;
|
||||
@Autowired
|
||||
private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil;
|
||||
|
||||
@Autowired
|
||||
private IMdmGmSubjectBalanceDao mdmGmSubjectBalanceDao;
|
||||
|
||||
|
||||
/**
|
||||
* 科目:
|
||||
* 54010501
|
||||
* 54010601
|
||||
* 54010701
|
||||
* 220202
|
||||
* 54010502
|
||||
* 54010602
|
||||
* 54010702
|
||||
* '54010501','54010601','54010701','220202','54010502','54010602','54010702'
|
||||
*/
|
||||
public void start() {
|
||||
LocalDate now = LocalDate.now();
|
||||
LocalTime time = LocalTime.now();
|
||||
String subjCodes = "'54010501','54010601','54010701','220202','54010502','54010602','54010702'";
|
||||
try {
|
||||
logger.info("调用:" + getPluginName() + "-插件");
|
||||
long a = System.currentTimeMillis();
|
||||
this.delete();
|
||||
long b = System.currentTimeMillis();
|
||||
System.out.println("清理耗时:" + (b - a));
|
||||
|
||||
MdmGmSubjectBalanceEntity mdmGmSubjectBalanceEntity = new MdmGmSubjectBalanceEntity();
|
||||
mdmGmSubjectBalanceEntity.setPkCorp("1001");
|
||||
mdmGmSubjectBalanceEntity.setSubjcodes(subjCodes);
|
||||
List<MdmGmSubjectBalanceEntity> mdmGmSubjectBalanceEntities = mdmGmSubjectBalanceDao.queryBalanceBySubjectCodesAndPkCorp(mdmGmSubjectBalanceEntity);
|
||||
long c = System.currentTimeMillis();
|
||||
System.out.println("查询耗时:" + (c - b));
|
||||
List<List<MdmGmSubjectBalanceEntity>> batches = Lists.partition(mdmGmSubjectBalanceEntities, 500);
|
||||
for (List<MdmGmSubjectBalanceEntity> batch : batches) {
|
||||
mdmGmSubjectBalanceDao.saveList(batch);
|
||||
}
|
||||
long d = System.currentTimeMillis();
|
||||
System.out.println("插入耗时:" + (d - c));
|
||||
System.out.println("总耗时:" + (d - a));
|
||||
|
||||
|
||||
//成功
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(subjCodes);
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(subjCodes);
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(now.toString());
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(now + " " + time);
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(now + " " + time);
|
||||
integrationTaskLivingDetailsEntity.setNewSystemPrimary(null);
|
||||
integrationTaskLivingDetailsEntity.setNewSystemNumber(null);
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//失败
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(subjCodes);
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(e.getMessage());
|
||||
integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
|
||||
integrationTaskLivingDetailsEntity.setBusinessDate(now.toString());
|
||||
integrationTaskLivingDetailsEntity.setRootAppPk(now + " " + time);
|
||||
integrationTaskLivingDetailsEntity.setRootAppBill(now + " " + time);
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public List<MdmGmSubjectBalanceEntity> start(MdmGmSubjectBalanceEntity mdmGmSubjectBalanceEntity) {
|
||||
try {
|
||||
Assert.notNull(mdmGmSubjectBalanceEntity.getPkCorp(), "pkCorp不能为空");
|
||||
Assert.notNull(mdmGmSubjectBalanceEntity.getSubjcode(), "subjcode不能为空");
|
||||
List<MdmGmSubjectBalanceEntity> mdmGmSubjectBalanceEntities = mdmGmSubjectBalanceDao.queryBalanceBySubjectCodeAndPkCorp(mdmGmSubjectBalanceEntity);
|
||||
// 切割成每 500 条一组
|
||||
List<List<MdmGmSubjectBalanceEntity>> batches = Lists.partition(mdmGmSubjectBalanceEntities, 500);
|
||||
for (List<MdmGmSubjectBalanceEntity> batch : batches) {
|
||||
mdmGmSubjectBalanceDao.saveList(batch);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public List<MdmGmSubjectBalanceEntity> delete() {
|
||||
mdmGmSubjectBalanceDao.clearTable();
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.hzya.frame.plugin.gm;
|
||||
|
||||
/**
|
||||
* Created by zydd on 2025-08-02 13:59
|
||||
*/
|
||||
|
||||
public class TestController {
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.hzya.frame.plugin.gm.constant;
|
||||
|
||||
public class ProfilesActiveConstant {
|
||||
|
||||
public static final String LETS_DATE_SOURCE = "gm_u8c_prod";
|
||||
|
||||
public static final String LETS_PROFILES_ACTIVE = "prod";
|
||||
|
||||
public static final String LOG_STATUS_Y = "Y";
|
||||
|
||||
public static final String LOG_STATUS_N = "N";
|
||||
|
||||
public static final String LOG_STATUS_Y_H = "'Y','H'";
|
||||
|
||||
public static final String TYPE_DATE = "date";
|
||||
|
||||
public static final String TYPE_VBILLCODE = "vbillcode";
|
||||
|
||||
public static final String TYPE_DETAIL_ERROR = "details_error";
|
||||
|
||||
public static final String TYPE_TIME_FRAME = "time_frame";
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.hzya.frame.plugin.gm.dao;
|
||||
|
||||
import com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广脉科目辅助余额表(mdm_gm_subject_balance: table)表数据库访问层
|
||||
*
|
||||
* @author zydd
|
||||
* @since 2025-08-02 13:39:24
|
||||
*/
|
||||
public interface IMdmGmSubjectBalanceDao extends IBaseDao<MdmGmSubjectBalanceEntity, String> {
|
||||
|
||||
public List<MdmGmSubjectBalanceEntity> queryBalanceBySubjectCodesAndPkCorp(MdmGmSubjectBalanceEntity entity);
|
||||
public List<MdmGmSubjectBalanceEntity> queryBalanceBySubjectCodeAndPkCorp(MdmGmSubjectBalanceEntity entity);
|
||||
|
||||
|
||||
void saveList(List<MdmGmSubjectBalanceEntity> mdmGmSubjectBalanceEntities);
|
||||
|
||||
void clearTable();
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.hzya.frame.plugin.gm.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.plugin.gm.constant.ProfilesActiveConstant;
|
||||
import com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity;
|
||||
import com.hzya.frame.plugin.gm.dao.IMdmGmSubjectBalanceDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广脉科目辅助余额表(MdmGmSubjectBalance)表数据库访问层
|
||||
*
|
||||
* @author zydd
|
||||
* @since 2025-08-02 13:39:24
|
||||
*/
|
||||
public class MdmGmSubjectBalanceDaoImpl extends MybatisGenericDao<MdmGmSubjectBalanceEntity, String> implements IMdmGmSubjectBalanceDao {
|
||||
|
||||
@DS(ProfilesActiveConstant.LETS_DATE_SOURCE)
|
||||
@Override
|
||||
public List<MdmGmSubjectBalanceEntity> queryBalanceBySubjectCodesAndPkCorp(MdmGmSubjectBalanceEntity entity) {
|
||||
List<MdmGmSubjectBalanceEntity> mdmGmSubjectBalanceEntityList =
|
||||
(List<MdmGmSubjectBalanceEntity>) super.selectList("com.hzya.frame.plugin.gm.dao.impl.MdmGmSubjectBalanceDaoImpl.queryBalanceBySubjectCodesAndPkCorp", entity);
|
||||
return mdmGmSubjectBalanceEntityList;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdmGmSubjectBalanceEntity> queryBalanceBySubjectCodeAndPkCorp(MdmGmSubjectBalanceEntity entity) {
|
||||
List<MdmGmSubjectBalanceEntity> mdmGmSubjectBalanceEntityList =
|
||||
(List<MdmGmSubjectBalanceEntity>) super.selectList("com.hzya.frame.plugin.gm.dao.impl.MdmGmSubjectBalanceDaoImpl.queryBalanceBySubjectCodeAndPkCorp", entity);
|
||||
return mdmGmSubjectBalanceEntityList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveList(List<MdmGmSubjectBalanceEntity> mdmGmSubjectBalanceEntities) {
|
||||
this.insert("com.hzya.frame.plugin.gm.dao.impl.MdmGmSubjectBalanceDaoImpl.saveList", mdmGmSubjectBalanceEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearTable() {
|
||||
this.delete("com.hzya.frame.plugin.gm.dao.impl.MdmGmSubjectBalanceDaoImpl.clearTable",null);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,354 @@
|
|||
package com.hzya.frame.plugin.gm.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 广脉科目辅助余额表(MdmGmSubjectBalance)实体类
|
||||
*
|
||||
* @author zydd
|
||||
* @since 2025-08-02 13:39:24
|
||||
*/
|
||||
public class MdmGmSubjectBalanceEntity extends BaseEntity {
|
||||
|
||||
/** 单据规则 */
|
||||
private String documentRule;
|
||||
/** 单据规则流水号 */
|
||||
private Long documentRuleNum;
|
||||
/** 数据状态 Y正常 N删除 F修改 */
|
||||
private String dataStatus;
|
||||
/** 新增数据状态 0待下发 1已下发 */
|
||||
private String addStatus;
|
||||
/** 修改数据状态 0待下发 1已下发 */
|
||||
private String updateStatus;
|
||||
/** 删除数据状态 0待下发 1已下发 */
|
||||
private String deleteStatus;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
/** data_id */
|
||||
private String dataId;
|
||||
/** mdm_up_id */
|
||||
private String mdmUpId;
|
||||
/** 公司主键 */
|
||||
private String pkCorp;
|
||||
/** 科目编码 */
|
||||
private String subjcode;
|
||||
private String subjcodes;
|
||||
/** 科目名称 */
|
||||
private String subjname;
|
||||
/** code1 */
|
||||
private String code1;
|
||||
/** code2 */
|
||||
private String code2;
|
||||
/** code3 */
|
||||
private String code3;
|
||||
/** code4 */
|
||||
private String code4;
|
||||
/** code5 */
|
||||
private String code5;
|
||||
/** code6 */
|
||||
private String code6;
|
||||
/** code7 */
|
||||
private String code7;
|
||||
/** code8 */
|
||||
private String code8;
|
||||
/** code9 */
|
||||
private String code9;
|
||||
/** code10 */
|
||||
private String code10;
|
||||
/** def1 */
|
||||
private String def1;
|
||||
/** def2 */
|
||||
private String def2;
|
||||
/** def3 */
|
||||
private String def3;
|
||||
/** def4 */
|
||||
private String def4;
|
||||
/** def5 */
|
||||
private String def5;
|
||||
/** def6 */
|
||||
private String def6;
|
||||
/** def7 */
|
||||
private String def7;
|
||||
/** def8 */
|
||||
private String def8;
|
||||
/** def9 */
|
||||
private String def9;
|
||||
/** def10 */
|
||||
private String def10;
|
||||
/** 余额 */
|
||||
private String balance;
|
||||
|
||||
public String getSubjcodes() {
|
||||
return subjcodes;
|
||||
}
|
||||
|
||||
public void setSubjcodes(String subjcodes) {
|
||||
this.subjcodes = subjcodes;
|
||||
}
|
||||
|
||||
public String getDocumentRule() {
|
||||
return documentRule;
|
||||
}
|
||||
|
||||
public void setDocumentRule(String documentRule) {
|
||||
this.documentRule = documentRule;
|
||||
}
|
||||
|
||||
public Long getDocumentRuleNum() {
|
||||
return documentRuleNum;
|
||||
}
|
||||
|
||||
public void setDocumentRuleNum(Long documentRuleNum) {
|
||||
this.documentRuleNum = documentRuleNum;
|
||||
}
|
||||
|
||||
public String getDataStatus() {
|
||||
return dataStatus;
|
||||
}
|
||||
|
||||
public void setDataStatus(String dataStatus) {
|
||||
this.dataStatus = dataStatus;
|
||||
}
|
||||
|
||||
public String getAddStatus() {
|
||||
return addStatus;
|
||||
}
|
||||
|
||||
public void setAddStatus(String addStatus) {
|
||||
this.addStatus = addStatus;
|
||||
}
|
||||
|
||||
public String getUpdateStatus() {
|
||||
return updateStatus;
|
||||
}
|
||||
|
||||
public void setUpdateStatus(String updateStatus) {
|
||||
this.updateStatus = updateStatus;
|
||||
}
|
||||
|
||||
public String getDeleteStatus() {
|
||||
return deleteStatus;
|
||||
}
|
||||
|
||||
public void setDeleteStatus(String deleteStatus) {
|
||||
this.deleteStatus = deleteStatus;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getDataId() {
|
||||
return dataId;
|
||||
}
|
||||
|
||||
public void setDataId(String dataId) {
|
||||
this.dataId = dataId;
|
||||
}
|
||||
|
||||
public String getMdmUpId() {
|
||||
return mdmUpId;
|
||||
}
|
||||
|
||||
public void setMdmUpId(String mdmUpId) {
|
||||
this.mdmUpId = mdmUpId;
|
||||
}
|
||||
|
||||
public String getPkCorp() {
|
||||
return pkCorp;
|
||||
}
|
||||
|
||||
public void setPkCorp(String pkCorp) {
|
||||
this.pkCorp = pkCorp;
|
||||
}
|
||||
|
||||
public String getSubjcode() {
|
||||
return subjcode;
|
||||
}
|
||||
|
||||
public void setSubjcode(String subjcode) {
|
||||
this.subjcode = subjcode;
|
||||
}
|
||||
|
||||
public String getSubjname() {
|
||||
return subjname;
|
||||
}
|
||||
|
||||
public void setSubjname(String subjname) {
|
||||
this.subjname = subjname;
|
||||
}
|
||||
|
||||
public String getCode1() {
|
||||
return code1;
|
||||
}
|
||||
|
||||
public void setCode1(String code1) {
|
||||
this.code1 = code1;
|
||||
}
|
||||
|
||||
public String getCode2() {
|
||||
return code2;
|
||||
}
|
||||
|
||||
public void setCode2(String code2) {
|
||||
this.code2 = code2;
|
||||
}
|
||||
|
||||
public String getCode3() {
|
||||
return code3;
|
||||
}
|
||||
|
||||
public void setCode3(String code3) {
|
||||
this.code3 = code3;
|
||||
}
|
||||
|
||||
public String getCode4() {
|
||||
return code4;
|
||||
}
|
||||
|
||||
public void setCode4(String code4) {
|
||||
this.code4 = code4;
|
||||
}
|
||||
|
||||
public String getCode5() {
|
||||
return code5;
|
||||
}
|
||||
|
||||
public void setCode5(String code5) {
|
||||
this.code5 = code5;
|
||||
}
|
||||
|
||||
public String getCode6() {
|
||||
return code6;
|
||||
}
|
||||
|
||||
public void setCode6(String code6) {
|
||||
this.code6 = code6;
|
||||
}
|
||||
|
||||
public String getCode7() {
|
||||
return code7;
|
||||
}
|
||||
|
||||
public void setCode7(String code7) {
|
||||
this.code7 = code7;
|
||||
}
|
||||
|
||||
public String getCode8() {
|
||||
return code8;
|
||||
}
|
||||
|
||||
public void setCode8(String code8) {
|
||||
this.code8 = code8;
|
||||
}
|
||||
|
||||
public String getCode9() {
|
||||
return code9;
|
||||
}
|
||||
|
||||
public void setCode9(String code9) {
|
||||
this.code9 = code9;
|
||||
}
|
||||
|
||||
public String getCode10() {
|
||||
return code10;
|
||||
}
|
||||
|
||||
public void setCode10(String code10) {
|
||||
this.code10 = code10;
|
||||
}
|
||||
|
||||
public String getDef1() {
|
||||
return def1;
|
||||
}
|
||||
|
||||
public void setDef1(String def1) {
|
||||
this.def1 = def1;
|
||||
}
|
||||
|
||||
public String getDef2() {
|
||||
return def2;
|
||||
}
|
||||
|
||||
public void setDef2(String def2) {
|
||||
this.def2 = def2;
|
||||
}
|
||||
|
||||
public String getDef3() {
|
||||
return def3;
|
||||
}
|
||||
|
||||
public void setDef3(String def3) {
|
||||
this.def3 = def3;
|
||||
}
|
||||
|
||||
public String getDef4() {
|
||||
return def4;
|
||||
}
|
||||
|
||||
public void setDef4(String def4) {
|
||||
this.def4 = def4;
|
||||
}
|
||||
|
||||
public String getDef5() {
|
||||
return def5;
|
||||
}
|
||||
|
||||
public void setDef5(String def5) {
|
||||
this.def5 = def5;
|
||||
}
|
||||
|
||||
public String getDef6() {
|
||||
return def6;
|
||||
}
|
||||
|
||||
public void setDef6(String def6) {
|
||||
this.def6 = def6;
|
||||
}
|
||||
|
||||
public String getDef7() {
|
||||
return def7;
|
||||
}
|
||||
|
||||
public void setDef7(String def7) {
|
||||
this.def7 = def7;
|
||||
}
|
||||
|
||||
public String getDef8() {
|
||||
return def8;
|
||||
}
|
||||
|
||||
public void setDef8(String def8) {
|
||||
this.def8 = def8;
|
||||
}
|
||||
|
||||
public String getDef9() {
|
||||
return def9;
|
||||
}
|
||||
|
||||
public void setDef9(String def9) {
|
||||
this.def9 = def9;
|
||||
}
|
||||
|
||||
public String getDef10() {
|
||||
return def10;
|
||||
}
|
||||
|
||||
public void setDef10(String def10) {
|
||||
this.def10 = def10;
|
||||
}
|
||||
|
||||
public String getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(String balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,685 @@
|
|||
<?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.gm.dao.impl.MdmGmSubjectBalanceDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmGmSubjectBalanceEntity-result"
|
||||
type="com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="documentRule" column="document_rule" jdbcType="VARCHAR"/>
|
||||
<result property="documentRuleNum" column="document_rule_num" jdbcType="INTEGER"/>
|
||||
<result property="dataStatus" column="data_status" jdbcType="VARCHAR"/>
|
||||
<result property="addStatus" column="add_status" jdbcType="VARCHAR"/>
|
||||
<result property="updateStatus" column="update_status" jdbcType="VARCHAR"/>
|
||||
<result property="deleteStatus" column="delete_status" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
<result property="dataId" column="data_id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmUpId" column="mdm_up_id" jdbcType="VARCHAR"/>
|
||||
<result property="pkCorp" column="pk_corp" jdbcType="VARCHAR"/>
|
||||
<result property="subjcode" column="subjcode" jdbcType="VARCHAR"/>
|
||||
<result property="subjname" column="subjname" jdbcType="VARCHAR"/>
|
||||
<result property="code1" column="code1" jdbcType="VARCHAR"/>
|
||||
<result property="code2" column="code2" jdbcType="VARCHAR"/>
|
||||
<result property="code3" column="code3" jdbcType="VARCHAR"/>
|
||||
<result property="code4" column="code4" jdbcType="VARCHAR"/>
|
||||
<result property="code5" column="code5" jdbcType="VARCHAR"/>
|
||||
<result property="code6" column="code6" jdbcType="VARCHAR"/>
|
||||
<result property="code7" column="code7" jdbcType="VARCHAR"/>
|
||||
<result property="code8" column="code8" jdbcType="VARCHAR"/>
|
||||
<result property="code9" column="code9" jdbcType="VARCHAR"/>
|
||||
<result property="code10" column="code10" jdbcType="VARCHAR"/>
|
||||
<result property="def1" column="def1" jdbcType="VARCHAR"/>
|
||||
<result property="def2" column="def2" jdbcType="VARCHAR"/>
|
||||
<result property="def3" column="def3" jdbcType="VARCHAR"/>
|
||||
<result property="def4" column="def4" jdbcType="VARCHAR"/>
|
||||
<result property="def5" column="def5" jdbcType="VARCHAR"/>
|
||||
<result property="def6" column="def6" jdbcType="VARCHAR"/>
|
||||
<result property="def7" column="def7" jdbcType="VARCHAR"/>
|
||||
<result property="def8" column="def8" jdbcType="VARCHAR"/>
|
||||
<result property="def9" column="def9" jdbcType="VARCHAR"/>
|
||||
<result property="def10" column="def10" jdbcType="VARCHAR"/>
|
||||
<result property="balance" column="balance" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="MdmGmSubjectBalanceEntity_Base_Column_List">
|
||||
id
|
||||
,document_rule
|
||||
,document_rule_num
|
||||
,data_status
|
||||
,add_status
|
||||
,update_status
|
||||
,delete_status
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
,company_id
|
||||
,data_id
|
||||
,mdm_up_id
|
||||
,pk_corp
|
||||
,subjcode
|
||||
,subjname
|
||||
,code1
|
||||
,code2
|
||||
,code3
|
||||
,code4
|
||||
,code5
|
||||
,code6
|
||||
,code7
|
||||
,code8
|
||||
,code9
|
||||
,code10
|
||||
,def1
|
||||
,def2
|
||||
,def3
|
||||
,def4
|
||||
,def5
|
||||
,def6
|
||||
,def7
|
||||
,def8
|
||||
,def9
|
||||
,def10
|
||||
,balance
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmGmSubjectBalanceEntity-result"
|
||||
parameterType="com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity">
|
||||
select
|
||||
<include refid="MdmGmSubjectBalanceEntity_Base_Column_List"/>
|
||||
from mdm_gm_subject_balance
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="documentRule != null and documentRule != ''">and document_rule = #{documentRule}</if>
|
||||
<if test="documentRuleNum != null">and document_rule_num = #{documentRuleNum}</if>
|
||||
<if test="dataStatus != null and dataStatus != ''">and data_status = #{dataStatus}</if>
|
||||
<if test="addStatus != null and addStatus != ''">and add_status = #{addStatus}</if>
|
||||
<if test="updateStatus != null and updateStatus != ''">and update_status = #{updateStatus}</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''">and delete_status = #{deleteStatus}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
<if test="dataId != null and dataId != ''">and data_id = #{dataId}</if>
|
||||
<if test="mdmUpId != null and mdmUpId != ''">and mdm_up_id = #{mdmUpId}</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">and pk_corp = #{pkCorp}</if>
|
||||
<if test="subjcode != null and subjcode != ''">and subjcode = #{subjcode}</if>
|
||||
<if test="subjname != null and subjname != ''">and subjname = #{subjname}</if>
|
||||
<if test="code1 != null and code1 != ''">and code1 = #{code1}</if>
|
||||
<if test="code2 != null and code2 != ''">and code2 = #{code2}</if>
|
||||
<if test="code3 != null and code3 != ''">and code3 = #{code3}</if>
|
||||
<if test="code4 != null and code4 != ''">and code4 = #{code4}</if>
|
||||
<if test="code5 != null and code5 != ''">and code5 = #{code5}</if>
|
||||
<if test="code6 != null and code6 != ''">and code6 = #{code6}</if>
|
||||
<if test="code7 != null and code7 != ''">and code7 = #{code7}</if>
|
||||
<if test="code8 != null and code8 != ''">and code8 = #{code8}</if>
|
||||
<if test="code9 != null and code9 != ''">and code9 = #{code9}</if>
|
||||
<if test="code10 != null and code10 != ''">and code10 = #{code10}</if>
|
||||
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
|
||||
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
|
||||
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
|
||||
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
|
||||
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
|
||||
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
|
||||
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
|
||||
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
|
||||
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
|
||||
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
|
||||
<if test="balance != null and balance != ''">and balance = #{balance}</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.gm.entity.MdmGmSubjectBalanceEntity">
|
||||
select count(1) from mdm_gm_subject_balance
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="documentRule != null and documentRule != ''">and document_rule = #{documentRule}</if>
|
||||
<if test="documentRuleNum != null">and document_rule_num = #{documentRuleNum}</if>
|
||||
<if test="dataStatus != null and dataStatus != ''">and data_status = #{dataStatus}</if>
|
||||
<if test="addStatus != null and addStatus != ''">and add_status = #{addStatus}</if>
|
||||
<if test="updateStatus != null and updateStatus != ''">and update_status = #{updateStatus}</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''">and delete_status = #{deleteStatus}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
<if test="dataId != null and dataId != ''">and data_id = #{dataId}</if>
|
||||
<if test="mdmUpId != null and mdmUpId != ''">and mdm_up_id = #{mdmUpId}</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">and pk_corp = #{pkCorp}</if>
|
||||
<if test="subjcode != null and subjcode != ''">and subjcode = #{subjcode}</if>
|
||||
<if test="subjname != null and subjname != ''">and subjname = #{subjname}</if>
|
||||
<if test="code1 != null and code1 != ''">and code1 = #{code1}</if>
|
||||
<if test="code2 != null and code2 != ''">and code2 = #{code2}</if>
|
||||
<if test="code3 != null and code3 != ''">and code3 = #{code3}</if>
|
||||
<if test="code4 != null and code4 != ''">and code4 = #{code4}</if>
|
||||
<if test="code5 != null and code5 != ''">and code5 = #{code5}</if>
|
||||
<if test="code6 != null and code6 != ''">and code6 = #{code6}</if>
|
||||
<if test="code7 != null and code7 != ''">and code7 = #{code7}</if>
|
||||
<if test="code8 != null and code8 != ''">and code8 = #{code8}</if>
|
||||
<if test="code9 != null and code9 != ''">and code9 = #{code9}</if>
|
||||
<if test="code10 != null and code10 != ''">and code10 = #{code10}</if>
|
||||
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
|
||||
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
|
||||
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
|
||||
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
|
||||
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
|
||||
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
|
||||
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
|
||||
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
|
||||
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
|
||||
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
|
||||
<if test="balance != null and balance != ''">and balance = #{balance}</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-MdmGmSubjectBalanceEntity-result"
|
||||
parameterType="com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity">
|
||||
select
|
||||
<include refid="MdmGmSubjectBalanceEntity_Base_Column_List"/>
|
||||
from mdm_gm_subject_balance
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="documentRule != null and documentRule != ''">and document_rule like
|
||||
concat('%',#{documentRule},'%')
|
||||
</if>
|
||||
<if test="documentRuleNum != null">and document_rule_num like concat('%',#{documentRuleNum},'%')</if>
|
||||
<if test="dataStatus != null and dataStatus != ''">and data_status like concat('%',#{dataStatus},'%')</if>
|
||||
<if test="addStatus != null and addStatus != ''">and add_status like concat('%',#{addStatus},'%')</if>
|
||||
<if test="updateStatus != null and updateStatus != ''">and update_status like
|
||||
concat('%',#{updateStatus},'%')
|
||||
</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''">and delete_status like
|
||||
concat('%',#{deleteStatus},'%')
|
||||
</if>
|
||||
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||
concat('%',#{create_user_id},'%')
|
||||
</if>
|
||||
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
||||
concat('%',#{modify_user_id},'%')
|
||||
</if>
|
||||
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||
<if test="dataId != null and dataId != ''">and data_id like concat('%',#{dataId},'%')</if>
|
||||
<if test="mdmUpId != null and mdmUpId != ''">and mdm_up_id like concat('%',#{mdmUpId},'%')</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">and pk_corp like concat('%',#{pkCorp},'%')</if>
|
||||
<if test="subjcode != null and subjcode != ''">and subjcode like concat('%',#{subjcode},'%')</if>
|
||||
<if test="subjname != null and subjname != ''">and subjname like concat('%',#{subjname},'%')</if>
|
||||
<if test="code1 != null and code1 != ''">and code1 like concat('%',#{code1},'%')</if>
|
||||
<if test="code2 != null and code2 != ''">and code2 like concat('%',#{code2},'%')</if>
|
||||
<if test="code3 != null and code3 != ''">and code3 like concat('%',#{code3},'%')</if>
|
||||
<if test="code4 != null and code4 != ''">and code4 like concat('%',#{code4},'%')</if>
|
||||
<if test="code5 != null and code5 != ''">and code5 like concat('%',#{code5},'%')</if>
|
||||
<if test="code6 != null and code6 != ''">and code6 like concat('%',#{code6},'%')</if>
|
||||
<if test="code7 != null and code7 != ''">and code7 like concat('%',#{code7},'%')</if>
|
||||
<if test="code8 != null and code8 != ''">and code8 like concat('%',#{code8},'%')</if>
|
||||
<if test="code9 != null and code9 != ''">and code9 like concat('%',#{code9},'%')</if>
|
||||
<if test="code10 != null and code10 != ''">and code10 like concat('%',#{code10},'%')</if>
|
||||
<if test="def1 != null and def1 != ''">and def1 like concat('%',#{def1},'%')</if>
|
||||
<if test="def2 != null and def2 != ''">and def2 like concat('%',#{def2},'%')</if>
|
||||
<if test="def3 != null and def3 != ''">and def3 like concat('%',#{def3},'%')</if>
|
||||
<if test="def4 != null and def4 != ''">and def4 like concat('%',#{def4},'%')</if>
|
||||
<if test="def5 != null and def5 != ''">and def5 like concat('%',#{def5},'%')</if>
|
||||
<if test="def6 != null and def6 != ''">and def6 like concat('%',#{def6},'%')</if>
|
||||
<if test="def7 != null and def7 != ''">and def7 like concat('%',#{def7},'%')</if>
|
||||
<if test="def8 != null and def8 != ''">and def8 like concat('%',#{def8},'%')</if>
|
||||
<if test="def9 != null and def9 != ''">and def9 like concat('%',#{def9},'%')</if>
|
||||
<if test="def10 != null and def10 != ''">and def10 like concat('%',#{def10},'%')</if>
|
||||
<if test="balance != null and balance != ''">and balance like concat('%',#{balance},'%')</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="MdmGmSubjectBalanceentity_list_or" resultMap="get-MdmGmSubjectBalanceEntity-result"
|
||||
parameterType="com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity">
|
||||
select
|
||||
<include refid="MdmGmSubjectBalanceEntity_Base_Column_List"/>
|
||||
from mdm_gm_subject_balance
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="documentRule != null and documentRule != ''">or document_rule = #{documentRule}</if>
|
||||
<if test="documentRuleNum != null">or document_rule_num = #{documentRuleNum}</if>
|
||||
<if test="dataStatus != null and dataStatus != ''">or data_status = #{dataStatus}</if>
|
||||
<if test="addStatus != null and addStatus != ''">or add_status = #{addStatus}</if>
|
||||
<if test="updateStatus != null and updateStatus != ''">or update_status = #{updateStatus}</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''">or delete_status = #{deleteStatus}</if>
|
||||
<if test="sorts != null">or sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">or create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">or modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||
<if test="dataId != null and dataId != ''">or data_id = #{dataId}</if>
|
||||
<if test="mdmUpId != null and mdmUpId != ''">or mdm_up_id = #{mdmUpId}</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">or pk_corp = #{pkCorp}</if>
|
||||
<if test="subjcode != null and subjcode != ''">or subjcode = #{subjcode}</if>
|
||||
<if test="subjname != null and subjname != ''">or subjname = #{subjname}</if>
|
||||
<if test="code1 != null and code1 != ''">or code1 = #{code1}</if>
|
||||
<if test="code2 != null and code2 != ''">or code2 = #{code2}</if>
|
||||
<if test="code3 != null and code3 != ''">or code3 = #{code3}</if>
|
||||
<if test="code4 != null and code4 != ''">or code4 = #{code4}</if>
|
||||
<if test="code5 != null and code5 != ''">or code5 = #{code5}</if>
|
||||
<if test="code6 != null and code6 != ''">or code6 = #{code6}</if>
|
||||
<if test="code7 != null and code7 != ''">or code7 = #{code7}</if>
|
||||
<if test="code8 != null and code8 != ''">or code8 = #{code8}</if>
|
||||
<if test="code9 != null and code9 != ''">or code9 = #{code9}</if>
|
||||
<if test="code10 != null and code10 != ''">or code10 = #{code10}</if>
|
||||
<if test="def1 != null and def1 != ''">or def1 = #{def1}</if>
|
||||
<if test="def2 != null and def2 != ''">or def2 = #{def2}</if>
|
||||
<if test="def3 != null and def3 != ''">or def3 = #{def3}</if>
|
||||
<if test="def4 != null and def4 != ''">or def4 = #{def4}</if>
|
||||
<if test="def5 != null and def5 != ''">or def5 = #{def5}</if>
|
||||
<if test="def6 != null and def6 != ''">or def6 = #{def6}</if>
|
||||
<if test="def7 != null and def7 != ''">or def7 = #{def7}</if>
|
||||
<if test="def8 != null and def8 != ''">or def8 = #{def8}</if>
|
||||
<if test="def9 != null and def9 != ''">or def9 = #{def9}</if>
|
||||
<if test="def10 != null and def10 != ''">or def10 = #{def10}</if>
|
||||
<if test="balance != null and balance != ''">or balance = #{balance}</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.gm.entity.MdmGmSubjectBalanceEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_gm_subject_balance(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="documentRule != null and documentRule != ''">document_rule ,</if>
|
||||
<if test="documentRuleNum != null">document_rule_num ,</if>
|
||||
<if test="dataStatus != null and dataStatus != ''">data_status ,</if>
|
||||
<if test="addStatus != null and addStatus != ''">add_status ,</if>
|
||||
<if test="updateStatus != null and updateStatus != ''">update_status ,</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''">delete_status ,</if>
|
||||
<if test="sorts != null">sorts ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
|
||||
<if test="create_time != null">create_time ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
|
||||
<if test="modify_time != null">modify_time ,</if>
|
||||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="dataId != null and dataId != ''">data_id ,</if>
|
||||
<if test="mdmUpId != null and mdmUpId != ''">mdm_up_id ,</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">pk_corp ,</if>
|
||||
<if test="subjcode != null and subjcode != ''">subjcode ,</if>
|
||||
<if test="subjname != null and subjname != ''">subjname ,</if>
|
||||
<if test="code1 != null and code1 != ''">code1 ,</if>
|
||||
<if test="code2 != null and code2 != ''">code2 ,</if>
|
||||
<if test="code3 != null and code3 != ''">code3 ,</if>
|
||||
<if test="code4 != null and code4 != ''">code4 ,</if>
|
||||
<if test="code5 != null and code5 != ''">code5 ,</if>
|
||||
<if test="code6 != null and code6 != ''">code6 ,</if>
|
||||
<if test="code7 != null and code7 != ''">code7 ,</if>
|
||||
<if test="code8 != null and code8 != ''">code8 ,</if>
|
||||
<if test="code9 != null and code9 != ''">code9 ,</if>
|
||||
<if test="code10 != null and code10 != ''">code10 ,</if>
|
||||
<if test="def1 != null and def1 != ''">def1 ,</if>
|
||||
<if test="def2 != null and def2 != ''">def2 ,</if>
|
||||
<if test="def3 != null and def3 != ''">def3 ,</if>
|
||||
<if test="def4 != null and def4 != ''">def4 ,</if>
|
||||
<if test="def5 != null and def5 != ''">def5 ,</if>
|
||||
<if test="def6 != null and def6 != ''">def6 ,</if>
|
||||
<if test="def7 != null and def7 != ''">def7 ,</if>
|
||||
<if test="def8 != null and def8 != ''">def8 ,</if>
|
||||
<if test="def9 != null and def9 != ''">def9 ,</if>
|
||||
<if test="def10 != null and def10 != ''">def10 ,</if>
|
||||
<if test="balance != null and balance != ''">balance ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id} ,</if>
|
||||
<if test="documentRule != null and documentRule != ''">#{documentRule} ,</if>
|
||||
<if test="documentRuleNum != null">#{documentRuleNum} ,</if>
|
||||
<if test="dataStatus != null and dataStatus != ''">#{dataStatus} ,</if>
|
||||
<if test="addStatus != null and addStatus != ''">#{addStatus} ,</if>
|
||||
<if test="updateStatus != null and updateStatus != ''">#{updateStatus} ,</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''">#{deleteStatus} ,</if>
|
||||
<if test="sorts != null">#{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
|
||||
<if test="create_time != null">#{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
|
||||
<if test="modify_time != null">#{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="dataId != null and dataId != ''">#{dataId} ,</if>
|
||||
<if test="mdmUpId != null and mdmUpId != ''">#{mdmUpId} ,</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">#{pkCorp} ,</if>
|
||||
<if test="subjcode != null and subjcode != ''">#{subjcode} ,</if>
|
||||
<if test="subjname != null and subjname != ''">#{subjname} ,</if>
|
||||
<if test="code1 != null and code1 != ''">#{code1} ,</if>
|
||||
<if test="code2 != null and code2 != ''">#{code2} ,</if>
|
||||
<if test="code3 != null and code3 != ''">#{code3} ,</if>
|
||||
<if test="code4 != null and code4 != ''">#{code4} ,</if>
|
||||
<if test="code5 != null and code5 != ''">#{code5} ,</if>
|
||||
<if test="code6 != null and code6 != ''">#{code6} ,</if>
|
||||
<if test="code7 != null and code7 != ''">#{code7} ,</if>
|
||||
<if test="code8 != null and code8 != ''">#{code8} ,</if>
|
||||
<if test="code9 != null and code9 != ''">#{code9} ,</if>
|
||||
<if test="code10 != null and code10 != ''">#{code10} ,</if>
|
||||
<if test="def1 != null and def1 != ''">#{def1} ,</if>
|
||||
<if test="def2 != null and def2 != ''">#{def2} ,</if>
|
||||
<if test="def3 != null and def3 != ''">#{def3} ,</if>
|
||||
<if test="def4 != null and def4 != ''">#{def4} ,</if>
|
||||
<if test="def5 != null and def5 != ''">#{def5} ,</if>
|
||||
<if test="def6 != null and def6 != ''">#{def6} ,</if>
|
||||
<if test="def7 != null and def7 != ''">#{def7} ,</if>
|
||||
<if test="def8 != null and def8 != ''">#{def8} ,</if>
|
||||
<if test="def9 != null and def9 != ''">#{def9} ,</if>
|
||||
<if test="def10 != null and def10 != ''">#{def10} ,</if>
|
||||
<if test="balance != null and balance != ''">#{balance} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_gm_subject_balance a
|
||||
WHERE a.sts = 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_gm_subject_balance(document_rule, document_rule_num, data_status, add_status, update_status,
|
||||
delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, data_id,
|
||||
mdm_up_id, pk_corp, subjcode, subjname, code1, code2, code3, code4, code5, code6, code7, code8, code9, code10,
|
||||
def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, balance, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.dataId},#{entity.mdmUpId},#{entity.pkCorp},#{entity.subjcode},#{entity.subjname},#{entity.code1},#{entity.code2},#{entity.code3},#{entity.code4},#{entity.code5},#{entity.code6},#{entity.code7},#{entity.code8},#{entity.code9},#{entity.code10},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.balance},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_gm_subject_balance(document_rule, document_rule_num, data_status, add_status, update_status,
|
||||
delete_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, data_id,
|
||||
mdm_up_id, pk_corp, subjcode, subjname, code1, code2, code3, code4, code5, code6, code7, code8, code9, code10,
|
||||
def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, balance)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.documentRule},#{entity.documentRuleNum},#{entity.dataStatus},#{entity.addStatus},#{entity.updateStatus},#{entity.deleteStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.dataId},#{entity.mdmUpId},#{entity.pkCorp},#{entity.subjcode},#{entity.subjname},#{entity.code1},#{entity.code2},#{entity.code3},#{entity.code4},#{entity.code5},#{entity.code6},#{entity.code7},#{entity.code8},#{entity.code9},#{entity.code10},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.balance})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
document_rule = values(document_rule),
|
||||
document_rule_num = values(document_rule_num),
|
||||
data_status = values(data_status),
|
||||
add_status = values(add_status),
|
||||
update_status = values(update_status),
|
||||
delete_status = values(delete_status),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id),
|
||||
data_id = values(data_id),
|
||||
mdm_up_id = values(mdm_up_id),
|
||||
pk_corp = values(pk_corp),
|
||||
subjcode = values(subjcode),
|
||||
subjname = values(subjname),
|
||||
code1 = values(code1),
|
||||
code2 = values(code2),
|
||||
code3 = values(code3),
|
||||
code4 = values(code4),
|
||||
code5 = values(code5),
|
||||
code6 = values(code6),
|
||||
code7 = values(code7),
|
||||
code8 = values(code8),
|
||||
code9 = values(code9),
|
||||
code10 = values(code10),
|
||||
def1 = values(def1),
|
||||
def2 = values(def2),
|
||||
def3 = values(def3),
|
||||
def4 = values(def4),
|
||||
def5 = values(def5),
|
||||
def6 = values(def6),
|
||||
def7 = values(def7),
|
||||
def8 = values(def8),
|
||||
def9 = values(def9),
|
||||
def10 = values(def10),
|
||||
balance = values(balance)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity">
|
||||
update mdm_gm_subject_balance set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="documentRule != null and documentRule != ''">document_rule = #{documentRule},</if>
|
||||
<if test="documentRuleNum != null">document_rule_num = #{documentRuleNum},</if>
|
||||
<if test="dataStatus != null and dataStatus != ''">data_status = #{dataStatus},</if>
|
||||
<if test="addStatus != null and addStatus != ''">add_status = #{addStatus},</if>
|
||||
<if test="updateStatus != null and updateStatus != ''">update_status = #{updateStatus},</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''">delete_status = #{deleteStatus},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null">create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null">modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
<if test="dataId != null and dataId != ''">data_id = #{dataId},</if>
|
||||
<if test="mdmUpId != null and mdmUpId != ''">mdm_up_id = #{mdmUpId},</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">pk_corp = #{pkCorp},</if>
|
||||
<if test="subjcode != null and subjcode != ''">subjcode = #{subjcode},</if>
|
||||
<if test="subjname != null and subjname != ''">subjname = #{subjname},</if>
|
||||
<if test="code1 != null and code1 != ''">code1 = #{code1},</if>
|
||||
<if test="code2 != null and code2 != ''">code2 = #{code2},</if>
|
||||
<if test="code3 != null and code3 != ''">code3 = #{code3},</if>
|
||||
<if test="code4 != null and code4 != ''">code4 = #{code4},</if>
|
||||
<if test="code5 != null and code5 != ''">code5 = #{code5},</if>
|
||||
<if test="code6 != null and code6 != ''">code6 = #{code6},</if>
|
||||
<if test="code7 != null and code7 != ''">code7 = #{code7},</if>
|
||||
<if test="code8 != null and code8 != ''">code8 = #{code8},</if>
|
||||
<if test="code9 != null and code9 != ''">code9 = #{code9},</if>
|
||||
<if test="code10 != null and code10 != ''">code10 = #{code10},</if>
|
||||
<if test="def1 != null and def1 != ''">def1 = #{def1},</if>
|
||||
<if test="def2 != null and def2 != ''">def2 = #{def2},</if>
|
||||
<if test="def3 != null and def3 != ''">def3 = #{def3},</if>
|
||||
<if test="def4 != null and def4 != ''">def4 = #{def4},</if>
|
||||
<if test="def5 != null and def5 != ''">def5 = #{def5},</if>
|
||||
<if test="def6 != null and def6 != ''">def6 = #{def6},</if>
|
||||
<if test="def7 != null and def7 != ''">def7 = #{def7},</if>
|
||||
<if test="def8 != null and def8 != ''">def8 = #{def8},</if>
|
||||
<if test="def9 != null and def9 != ''">def9 = #{def9},</if>
|
||||
<if test="def10 != null and def10 != ''">def10 = #{def10},</if>
|
||||
<if test="balance != null and balance != ''">balance = #{balance},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity">
|
||||
update mdm_gm_subject_balance
|
||||
set sts= 'N',
|
||||
modify_time = #{modify_time},
|
||||
modify_user_id = #{modify_user_id}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition"
|
||||
parameterType="com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity">
|
||||
update mdm_gm_subject_balance set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="documentRule != null and documentRule != ''">and document_rule = #{documentRule}</if>
|
||||
<if test="documentRuleNum != null">and document_rule_num = #{documentRuleNum}</if>
|
||||
<if test="dataStatus != null and dataStatus != ''">and data_status = #{dataStatus}</if>
|
||||
<if test="addStatus != null and addStatus != ''">and add_status = #{addStatus}</if>
|
||||
<if test="updateStatus != null and updateStatus != ''">and update_status = #{updateStatus}</if>
|
||||
<if test="deleteStatus != null and deleteStatus != ''">and delete_status = #{deleteStatus}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
<if test="dataId != null and dataId != ''">and data_id = #{dataId}</if>
|
||||
<if test="mdmUpId != null and mdmUpId != ''">and mdm_up_id = #{mdmUpId}</if>
|
||||
<if test="pkCorp != null and pkCorp != ''">and pk_corp = #{pkCorp}</if>
|
||||
<if test="subjcode != null and subjcode != ''">and subjcode = #{subjcode}</if>
|
||||
<if test="subjname != null and subjname != ''">and subjname = #{subjname}</if>
|
||||
<if test="code1 != null and code1 != ''">and code1 = #{code1}</if>
|
||||
<if test="code2 != null and code2 != ''">and code2 = #{code2}</if>
|
||||
<if test="code3 != null and code3 != ''">and code3 = #{code3}</if>
|
||||
<if test="code4 != null and code4 != ''">and code4 = #{code4}</if>
|
||||
<if test="code5 != null and code5 != ''">and code5 = #{code5}</if>
|
||||
<if test="code6 != null and code6 != ''">and code6 = #{code6}</if>
|
||||
<if test="code7 != null and code7 != ''">and code7 = #{code7}</if>
|
||||
<if test="code8 != null and code8 != ''">and code8 = #{code8}</if>
|
||||
<if test="code9 != null and code9 != ''">and code9 = #{code9}</if>
|
||||
<if test="code10 != null and code10 != ''">and code10 = #{code10}</if>
|
||||
<if test="def1 != null and def1 != ''">and def1 = #{def1}</if>
|
||||
<if test="def2 != null and def2 != ''">and def2 = #{def2}</if>
|
||||
<if test="def3 != null and def3 != ''">and def3 = #{def3}</if>
|
||||
<if test="def4 != null and def4 != ''">and def4 = #{def4}</if>
|
||||
<if test="def5 != null and def5 != ''">and def5 = #{def5}</if>
|
||||
<if test="def6 != null and def6 != ''">and def6 = #{def6}</if>
|
||||
<if test="def7 != null and def7 != ''">and def7 = #{def7}</if>
|
||||
<if test="def8 != null and def8 != ''">and def8 = #{def8}</if>
|
||||
<if test="def9 != null and def9 != ''">and def9 = #{def9}</if>
|
||||
<if test="def10 != null and def10 != ''">and def10 = #{def10}</if>
|
||||
<if test="balance != null and balance != ''">and balance = #{balance}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete
|
||||
from mdm_gm_subject_balance
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="queryBalanceBySubjectCodeAndPkCorp" parameterType="com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity" resultMap="get-MdmGmSubjectBalanceEntity-result">
|
||||
SELECT
|
||||
gl_detail.pk_corp as pkCorp,
|
||||
bd_accsubj.subjcode as subjcode,
|
||||
bd_accsubj.subjname as subjname,
|
||||
gl_ftpfreevalue.code1 as code1,
|
||||
gl_ftpfreevalue.code3 as code3,
|
||||
gl_ftpfreevalue.code5 as code5,
|
||||
gl_ftpfreevalue.code8 as code8,
|
||||
SUM(gl_detail.localdebitamount)- SUM(gl_detail.localcreditamount) as balance
|
||||
FROM
|
||||
gl_detail gl_detail
|
||||
LEFT JOIN gl_fixtmpfreevalue gl_ftpfreevalue ON gl_detail.assid = gl_ftpfreevalue.assid
|
||||
INNER JOIN bd_accsubj bd_accsubj ON gl_detail.pk_accsubj = bd_accsubj.pk_accsubj
|
||||
INNER JOIN gl_voucher voucher ON voucher.pk_voucher = gl_detail.pk_voucher
|
||||
WHERE
|
||||
1=1
|
||||
AND bd_accsubj.subjcode = #{subjcode}
|
||||
AND gl_detail.dr = 0
|
||||
AND gl_detail.discardflagv = 'N'
|
||||
AND pk_managerv != 'N/A'
|
||||
AND gl_detail.pk_corp = #{pkCorp}
|
||||
GROUP BY
|
||||
gl_detail.pk_corp,
|
||||
bd_accsubj.subjcode,
|
||||
bd_accsubj.subjname,
|
||||
gl_ftpfreevalue.code1,
|
||||
gl_ftpfreevalue.code3,
|
||||
gl_ftpfreevalue.code5,
|
||||
gl_ftpfreevalue.code8
|
||||
</select>
|
||||
|
||||
<select id="queryBalanceBySubjectCodesAndPkCorp" parameterType="com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity" resultMap="get-MdmGmSubjectBalanceEntity-result">
|
||||
SELECT
|
||||
gl_detail.pk_corp as pkCorp,
|
||||
bd_accsubj.subjcode as subjcode,
|
||||
bd_accsubj.subjname as subjname,
|
||||
gl_ftpfreevalue.code1 as code1,
|
||||
gl_ftpfreevalue.code3 as code3,
|
||||
gl_ftpfreevalue.code5 as code5,
|
||||
gl_ftpfreevalue.code8 as code8,
|
||||
SUM(gl_detail.localdebitamount)- SUM(gl_detail.localcreditamount) as balance
|
||||
FROM
|
||||
gl_detail gl_detail
|
||||
LEFT JOIN gl_fixtmpfreevalue gl_ftpfreevalue ON gl_detail.assid = gl_ftpfreevalue.assid
|
||||
INNER JOIN bd_accsubj bd_accsubj ON gl_detail.pk_accsubj = bd_accsubj.pk_accsubj
|
||||
INNER JOIN gl_voucher voucher ON voucher.pk_voucher = gl_detail.pk_voucher
|
||||
WHERE
|
||||
1=1
|
||||
AND bd_accsubj.subjcode IN (${subjcodes})
|
||||
AND gl_detail.dr = 0
|
||||
AND gl_detail.discardflagv = 'N'
|
||||
AND pk_managerv != 'N/A'
|
||||
AND gl_detail.pk_corp = #{pkCorp}
|
||||
GROUP BY
|
||||
gl_detail.pk_corp,
|
||||
bd_accsubj.subjcode,
|
||||
bd_accsubj.subjname,
|
||||
gl_ftpfreevalue.code1,
|
||||
gl_ftpfreevalue.code3,
|
||||
gl_ftpfreevalue.code5,
|
||||
gl_ftpfreevalue.code8
|
||||
</select>
|
||||
|
||||
<insert id="saveList" parameterType="java.util.List">
|
||||
INSERT INTO mdm_gm_subject_balance (
|
||||
id,
|
||||
pk_corp,
|
||||
subjcode,
|
||||
subjname,
|
||||
code1,
|
||||
code3,
|
||||
code5,
|
||||
code8,
|
||||
balance,
|
||||
sts,
|
||||
data_status
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
UUID(),
|
||||
#{item.pkCorp},
|
||||
#{item.subjcode},
|
||||
#{item.subjname},
|
||||
#{item.code1},
|
||||
#{item.code3},
|
||||
#{item.code5},
|
||||
#{item.code8},
|
||||
#{item.balance},
|
||||
'Y',
|
||||
'Y'
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="clearTable">
|
||||
TRUNCATE TABLE mdm_gm_subject_balance;
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.plugin.gm.service;
|
||||
|
||||
import com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
/**
|
||||
* 广脉科目辅助余额表(MdmGmSubjectBalance)表服务接口
|
||||
*
|
||||
* @author zydd
|
||||
* @since 2025-08-02 13:39:24
|
||||
*/
|
||||
public interface IMdmGmSubjectBalanceService extends IBaseService<MdmGmSubjectBalanceEntity, String>{
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.hzya.frame.plugin.gm.service.impl;
|
||||
|
||||
import com.hzya.frame.plugin.gm.entity.MdmGmSubjectBalanceEntity;
|
||||
import com.hzya.frame.plugin.gm.dao.IMdmGmSubjectBalanceDao;
|
||||
import com.hzya.frame.plugin.gm.service.IMdmGmSubjectBalanceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
/**
|
||||
* 广脉科目辅助余额表(MdmGmSubjectBalance)表服务实现类
|
||||
*
|
||||
* @author zydd
|
||||
* @since 2025-08-02 13:39:24
|
||||
*/
|
||||
public class MdmGmSubjectBalanceServiceImpl extends BaseService<MdmGmSubjectBalanceEntity, String> implements IMdmGmSubjectBalanceService {
|
||||
|
||||
private IMdmGmSubjectBalanceDao mdmGmSubjectBalanceDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmGmSubjectBalanceDao(IMdmGmSubjectBalanceDao dao) {
|
||||
this.mdmGmSubjectBalanceDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,178 @@
|
|||
package com.hzya.frame.plugin.gm.utils;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.uuid.UUIDLong;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保存或者更新业务日志
|
||||
*/
|
||||
@Component
|
||||
public class SaveOrUpdateBusinessLogUtil {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(SaveOrUpdateBusinessLogUtil.class);
|
||||
|
||||
@Autowired
|
||||
private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao;
|
||||
|
||||
private static final Object insertOrUpdateLock = new Object();
|
||||
|
||||
private static final Object queryDetailsLock = new Object();
|
||||
|
||||
private static final String successY = "Y";
|
||||
|
||||
private static final String failN = "N";
|
||||
|
||||
private static final Object OBJECT_LOCK = new Object();
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
*
|
||||
* @param integrationTaskLivingDetailsEntity 提交参数
|
||||
*/
|
||||
public void saveOrUpdate(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity) {
|
||||
Assert.notNull(integrationTaskLivingDetailsEntity, "integrationTaskLivingDetailsEntity不能为空");
|
||||
Assert.notNull(integrationTaskLivingDetailsEntity.getRootAppPk(), "源系统单号不能为空");
|
||||
Assert.notNull(integrationTaskLivingDetailsEntity.getPluginId(), "场景id不能为空");
|
||||
|
||||
synchronized (OBJECT_LOCK) {
|
||||
Thread n = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetails = null;
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity1 = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity1.setNewState("N");
|
||||
integrationTaskLivingDetailsEntity1.setRootAppPk(integrationTaskLivingDetailsEntity.getRootAppPk());
|
||||
integrationTaskLivingDetailsEntity1.setPluginId(integrationTaskLivingDetailsEntity.getPluginId());
|
||||
List<IntegrationTaskLivingDetailsEntity> integrationTaskLivingDetailsEntities = iIntegrationTaskLivingDetailsDao.query(integrationTaskLivingDetailsEntity1);
|
||||
if (integrationTaskLivingDetailsEntities != null && integrationTaskLivingDetailsEntities.size() > 0) {
|
||||
integrationTaskLivingDetails = integrationTaskLivingDetailsEntities.get(0);
|
||||
}
|
||||
|
||||
if (integrationTaskLivingDetails != null) {
|
||||
//存在,则更新,可能是N→Y / N→N
|
||||
integrationTaskLivingDetailsEntity.setId(integrationTaskLivingDetails.getId());
|
||||
updateSuccessMessage(integrationTaskLivingDetailsEntity);
|
||||
} else {
|
||||
//不存在,则新增,可能是→Y / →N
|
||||
Long uuid = UUIDLong.longUUID();
|
||||
integrationTaskLivingDetailsEntity.setId(String.valueOf(uuid));
|
||||
saveSuccessMessage(integrationTaskLivingDetailsEntity);
|
||||
// logger.info("integration_task_living_details->日志保存成功,主键:{}", save.getId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("SaveOrUpdateBusinessLogUtil对应的saveOrUpdate方法抛出异常,日志详情保存失败!", e);
|
||||
//2024年9月3日 10:26:45 如果这里往上抛出异常,没有功能搭配处理
|
||||
}
|
||||
}
|
||||
});
|
||||
n.start();
|
||||
try{
|
||||
n.join();
|
||||
}catch (Exception e){
|
||||
logger.error("",e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新日志 存在,则更新,可能是N→Y / N→N
|
||||
* 肯定有id
|
||||
*
|
||||
* @param integrationTaskLivingDetailsEntity
|
||||
*/
|
||||
private void updateSuccessMessage(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity) {
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity1 = queryIntegrationTaskLivingDetailsEntityN(integrationTaskLivingDetailsEntity.getId());
|
||||
if (successY.equals(integrationTaskLivingDetailsEntity.getNewState())) {
|
||||
//N→Y
|
||||
iIntegrationTaskLivingDetailsDao.deleteEntity(integrationTaskLivingDetailsEntity1);
|
||||
|
||||
String successIdentification = "success";
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(successIdentification);
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(successIdentification);
|
||||
iIntegrationTaskLivingDetailsDao.saveSuccessLog(integrationTaskLivingDetailsEntity);
|
||||
|
||||
} else if (failN.equals(integrationTaskLivingDetailsEntity.getNewState())) {
|
||||
//N→N
|
||||
String rootAppNewData = integrationTaskLivingDetailsEntity.getRootAppNewData();
|
||||
if (integrationTaskLivingDetailsEntity.getRootAppNewData() != null && !integrationTaskLivingDetailsEntity.getRootAppNewData().trim().equals("") && integrationTaskLivingDetailsEntity.getRootAppNewData().length() >= 500) {
|
||||
rootAppNewData = integrationTaskLivingDetailsEntity.getRootAppNewData().substring(0, 500);
|
||||
}
|
||||
String newTransmitInfo = integrationTaskLivingDetailsEntity.getNewTransmitInfo();
|
||||
if (integrationTaskLivingDetailsEntity.getNewTransmitInfo() != null && !integrationTaskLivingDetailsEntity.getNewTransmitInfo().trim().equals("") && integrationTaskLivingDetailsEntity.getNewTransmitInfo().length() >= 500) {
|
||||
newTransmitInfo = integrationTaskLivingDetailsEntity.getNewTransmitInfo().substring(0, 500);
|
||||
}
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData);
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo);
|
||||
iIntegrationTaskLivingDetailsDao.update(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增日志 不存在,则新增,可能是→Y / →N
|
||||
*
|
||||
* @param integrationTaskLivingDetailsEntity
|
||||
*/
|
||||
private void saveSuccessMessage(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity) {
|
||||
if (successY.equals(integrationTaskLivingDetailsEntity.getNewState())) {
|
||||
//→Y
|
||||
String successIdentification = "success";
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(successIdentification);
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(successIdentification);
|
||||
iIntegrationTaskLivingDetailsDao.saveSuccessLog(integrationTaskLivingDetailsEntity);
|
||||
|
||||
} else if (failN.equals(integrationTaskLivingDetailsEntity.getNewState())) {
|
||||
//→N
|
||||
String rootAppNewData = integrationTaskLivingDetailsEntity.getRootAppNewData();
|
||||
if (integrationTaskLivingDetailsEntity.getRootAppNewData() != null && !integrationTaskLivingDetailsEntity.getRootAppNewData().trim().equals("") && integrationTaskLivingDetailsEntity.getRootAppNewData().length() >= 500) {
|
||||
rootAppNewData = integrationTaskLivingDetailsEntity.getRootAppNewData().substring(0, 500);
|
||||
}
|
||||
String newTransmitInfo = integrationTaskLivingDetailsEntity.getNewTransmitInfo();
|
||||
if (integrationTaskLivingDetailsEntity.getNewTransmitInfo() != null && !integrationTaskLivingDetailsEntity.getNewTransmitInfo().trim().equals("") && integrationTaskLivingDetailsEntity.getNewTransmitInfo().length() >= 500) {
|
||||
newTransmitInfo = integrationTaskLivingDetailsEntity.getNewTransmitInfo().substring(0, 500);
|
||||
}
|
||||
integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData);
|
||||
integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo);
|
||||
iIntegrationTaskLivingDetailsDao.save(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static final Object queryIntegrationTaskLivingDetailsEntityLock = new Object();
|
||||
|
||||
|
||||
/**
|
||||
* 根据明细id查询明细信息,成功表 integration_task_living_details_success
|
||||
*/
|
||||
public IntegrationTaskLivingDetailsEntity queryIntegrationTaskLivingDetailsEntityY(IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity) {
|
||||
// Assert.notNull(integration_task_living_details_id, "业务明细id不能为空");
|
||||
// IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
// integrationTaskLivingDetailsEntity.setId(integration_task_living_details_id);
|
||||
// integrationTaskLivingDetailsEntity.setNewState("Y");//查询成功表
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity1 = iIntegrationTaskLivingDetailsDao.queryEntity(integrationTaskLivingDetailsEntity);
|
||||
Assert.notNull(integrationTaskLivingDetailsEntity1, "根据主键id没有查询到明细信息");
|
||||
return integrationTaskLivingDetailsEntity1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据明细id查询明细信息,错误表 integration_task_living_details
|
||||
*/
|
||||
public IntegrationTaskLivingDetailsEntity queryIntegrationTaskLivingDetailsEntityN(String integration_task_living_details_id) {
|
||||
Assert.notNull(integration_task_living_details_id, "业务明细id不能为空");
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setId(integration_task_living_details_id);
|
||||
integrationTaskLivingDetailsEntity.setNewState("N");//查询失败表
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity1 = iIntegrationTaskLivingDetailsDao.queryEntity(integrationTaskLivingDetailsEntity);
|
||||
Assert.notNull(integrationTaskLivingDetailsEntity1, "根据主键id没有查询到明细信息");
|
||||
return integrationTaskLivingDetailsEntity1;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>GmPlugin</id>
|
||||
<name>GmPlugin插件</name>
|
||||
<category>20250801</category>
|
||||
</plugin>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="mdmGmSubjectBalanceDao" class="com.hzya.frame.plugin.gm.dao.impl.MdmGmSubjectBalanceDaoImpl"/>
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="subjectAssBalancePlugin" class="com.hzya.frame.plugin.gm.SubjectAssBalancePlugin"/>
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="mdmGmSubjectBalanceService" class="com.hzya.frame.plugin.gm.service.impl.MdmGmSubjectBalanceServiceImpl"/>
|
||||
</beans>
|
Loading…
Reference in New Issue