广脉:1、优化业务模块-主数据一对一的问题。

2、优化业务模块-主数据删除时影响因素关联问题。
This commit is contained in:
zhengyf 2025-06-03 11:20:01 +08:00
parent fd6dcba206
commit 27c69cc33f
10 changed files with 874 additions and 4 deletions

View File

@ -336,8 +336,7 @@
parameterType="com.hzya.frame.voucher.ae.comf.factor.entity.AeConfInfluenceFactorEntity">
update ae_conf_influence_factor
set sts= 'N',
modify_time = #{modify_time},
modify_user_id = #{modify_user_id}
modify_time = now()
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->

View File

@ -86,8 +86,8 @@ public class AeConfInfluenceFactorServiceImpl extends BaseService<AeConfInfluenc
//如有模块更改需要更新此表的ae_conf_module_name模块名称
updateModuleName(entity);
AeConfInfluenceFactorEntity save = this.dao.save(entity);
return save;
AeConfInfluenceFactorEntity update = this.dao.update(entity);
return update;
}

View File

@ -5,6 +5,10 @@ import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.voucher.ae.comf.factor.dao.IAeConfInfluenceFactorCorrelationDao;
import com.hzya.frame.voucher.ae.comf.factor.dao.IAeConfInfluenceFactorDao;
import com.hzya.frame.voucher.ae.comf.factor.entity.AeConfInfluenceFactorCorrelationEntity;
import com.hzya.frame.voucher.ae.comf.factor.entity.AeConfInfluenceFactorEntity;
import com.hzya.frame.voucher.ae.comf.module.dao.IAeConfBusinessModuleDao;
import com.hzya.frame.voucher.ae.comf.module.entity.AeConfBusinessModuleEntity;
import com.hzya.frame.voucher.ae.comf.module.entity.AeConfBusinessModuleMdmEntity;
@ -38,6 +42,10 @@ public class AeConfBusinessModuleMdmServiceImpl extends BaseService<AeConfBusine
private IMdmModuleDao mdmModuleDao;
@Autowired
private IAeConfBusinessModuleDao aeConfBusinessModuleDao;
@Autowired
private IAeConfInfluenceFactorCorrelationDao aeConfInfluenceFactorCorrelationDao;
@Autowired
private IAeConfInfluenceFactorDao aeConfInfluenceFactorDao;
@Override
@ -62,6 +70,7 @@ public class AeConfBusinessModuleMdmServiceImpl extends BaseService<AeConfBusine
List<MdmModuleEntity> mdmList = new ArrayList<>();
for (AeConfBusinessModuleMdmEntity aeConfBusinessModuleMdmEntity : value) {
MdmModuleEntity mdmModuleEntity = new MdmModuleEntity();
mdmModuleEntity.setId(aeConfBusinessModuleMdmEntity.getMdmId());
mdmModuleEntity.setMdmCode(Long.valueOf(aeConfBusinessModuleMdmEntity.getMdmCode()));
mdmModuleEntity.setMdmName(aeConfBusinessModuleMdmEntity.getMdmName());
mdmList.add(mdmModuleEntity);
@ -87,6 +96,9 @@ public class AeConfBusinessModuleMdmServiceImpl extends BaseService<AeConfBusine
return all;
}
/**
* 保存业务模块-主数据关联关系一对一的关系需要校验
*/
@Override
public List<AeConfBusinessModuleMdmEntity> saveList(List<AeConfBusinessModuleMdmEntity> list) {
if (list.size() == 0) {
@ -99,6 +111,17 @@ public class AeConfBusinessModuleMdmServiceImpl extends BaseService<AeConfBusine
Assert.notNull(moduleMdmEntity.getMdmCode(), "业务模块-主数据保存时主数据code不能为空请检查检验数据为{}", JSONUtil.toJsonStr(moduleMdmEntity));
Assert.notNull(moduleMdmEntity.getMdmName(), "业务模块-主数据保存时主数据name不能为空请检查检验数据为{}", JSONUtil.toJsonStr(moduleMdmEntity));
}
//校验是否存在重复
for (AeConfBusinessModuleMdmEntity aeConfBusinessModuleMdmEntity : list) {
AeConfBusinessModuleMdmEntity ae1 = new AeConfBusinessModuleMdmEntity();
ae1.setAeConfModuleId(aeConfBusinessModuleMdmEntity.getAeConfModuleId());
ae1.setMdmId(aeConfBusinessModuleMdmEntity.getMdmId());
List<AeConfBusinessModuleMdmEntity> query1 = aeConfBusinessModuleMdmDao.query(ae1);
if (query1.size() > 0) {
Assert.state(false, "该主数据:{},已和模块:{},绑定,请检查。", aeConfBusinessModuleMdmEntity.getMdmName(), aeConfBusinessModuleMdmEntity.getAeConfModuleName());
}
}
List<AeConfBusinessModuleMdmEntity> saveList = new ArrayList<>();
for (AeConfBusinessModuleMdmEntity aeConfBusinessModuleMdmEntity : list) {
AeConfBusinessModuleMdmEntity save = aeConfBusinessModuleMdmDao.save(aeConfBusinessModuleMdmEntity);
@ -107,6 +130,9 @@ public class AeConfBusinessModuleMdmServiceImpl extends BaseService<AeConfBusine
return saveList;
}
/**
* 更新时需要检查有没有配置影响因素有则不允许更新
*/
@Override
public List<AeConfBusinessModuleMdmEntity> updateList(List<AeConfBusinessModuleMdmEntity> list) {
if (list.size() == 0) {
@ -120,6 +146,29 @@ public class AeConfBusinessModuleMdmServiceImpl extends BaseService<AeConfBusine
Assert.notNull(moduleMdmEntity.getMdmCode(), "业务模块-主数据保存时主数据code不能为空请检查检验数据为{}", JSONUtil.toJsonStr(moduleMdmEntity));
Assert.notNull(moduleMdmEntity.getMdmName(), "业务模块-主数据保存时主数据name不能为空请检查检验数据为{}", JSONUtil.toJsonStr(moduleMdmEntity));
}
//查询影响因素,再根据影响因素查询业务模块
for (AeConfBusinessModuleMdmEntity moduleMdmEntity : list) {
AeConfInfluenceFactorCorrelationEntity factorCorrelation = new AeConfInfluenceFactorCorrelationEntity();
factorCorrelation.setMdmId(moduleMdmEntity.getMdmId());
List<AeConfInfluenceFactorCorrelationEntity> query = aeConfInfluenceFactorCorrelationDao.query(factorCorrelation);
//查询模块id
// List<Long> factorIds = query.stream()
// .map(AeConfInfluenceFactorCorrelationEntity::getFactorId)
// .collect(Collectors.toList());
List<Long> factorIds = Optional.ofNullable(query).orElse(Collections.emptyList()).stream()
.map(AeConfInfluenceFactorCorrelationEntity::getFactorId)
.collect(Collectors.toList());
for (Long factorId : factorIds) {
AeConfInfluenceFactorEntity aeConfInfluenceFactorEntity = new AeConfInfluenceFactorEntity();
aeConfInfluenceFactorEntity.setId(String.valueOf(factorId));
List<AeConfInfluenceFactorEntity> query1 = aeConfInfluenceFactorDao.query(aeConfInfluenceFactorEntity);
AeConfInfluenceFactorEntity aeConfInfluenceFactorEntity1 = query1.get(0);
if(!aeConfInfluenceFactorEntity1.getAeConfModuleId().equals(moduleMdmEntity.getAeConfModuleId())){
Assert.state(false,"该主数据已关联影响因素,请删除影响因素关联后进行修改");
}
}
}
List<AeConfBusinessModuleMdmEntity> updateList = new ArrayList<>();
for (AeConfBusinessModuleMdmEntity aeConfBusinessModuleMdmEntity : list) {
AeConfBusinessModuleMdmEntity update = aeConfBusinessModuleMdmDao.update(aeConfBusinessModuleMdmEntity);
@ -136,6 +185,30 @@ public class AeConfBusinessModuleMdmServiceImpl extends BaseService<AeConfBusine
for (AeConfBusinessModuleMdmEntity moduleMdmEntity : list) {
Assert.notNull(moduleMdmEntity.getId(), "业务模块-主数据删除时,业务模块-主数据id不能为空请检查检验数据为{}", JSONUtil.toJsonStr(moduleMdmEntity));
}
//查询影响因素,再根据影响因素查询业务模块
for (AeConfBusinessModuleMdmEntity moduleMdmEntity : list) {
AeConfInfluenceFactorCorrelationEntity factorCorrelation = new AeConfInfluenceFactorCorrelationEntity();
factorCorrelation.setMdmId(moduleMdmEntity.getMdmId());
List<AeConfInfluenceFactorCorrelationEntity> query = aeConfInfluenceFactorCorrelationDao.query(factorCorrelation);
//查询模块id
// List<Long> factorIds = query.stream()
// .map(AeConfInfluenceFactorCorrelationEntity::getFactorId)
// .collect(Collectors.toList());
List<Long> factorIds = Optional.ofNullable(query).orElse(Collections.emptyList()).stream()
.map(AeConfInfluenceFactorCorrelationEntity::getFactorId)
.collect(Collectors.toList());
for (Long factorId : factorIds) {
AeConfInfluenceFactorEntity aeConfInfluenceFactorEntity = new AeConfInfluenceFactorEntity();
aeConfInfluenceFactorEntity.setId(String.valueOf(factorId));
List<AeConfInfluenceFactorEntity> query1 = aeConfInfluenceFactorDao.query(aeConfInfluenceFactorEntity);
AeConfInfluenceFactorEntity aeConfInfluenceFactorEntity1 = query1.get(0);
if(!aeConfInfluenceFactorEntity1.getAeConfModuleId().equals(moduleMdmEntity.getAeConfModuleId())){
Assert.state(false,"该主数据已关联影响因素,请删除影响因素关联后进行删除");
}
}
}
Map<String, Integer> deleteMap = new HashMap<>();
for (AeConfBusinessModuleMdmEntity aeConfBusinessModuleMdmEntity : list) {
int i = aeConfBusinessModuleMdmDao.logicRemove(aeConfBusinessModuleMdmEntity);

View File

@ -0,0 +1,56 @@
package com.hzya.frame.voucher.ae.comf.subject.controller;
import com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity;
import com.hzya.frame.voucher.ae.comf.subject.service.IAeConfSubjectContrastService;
import com.hzya.frame.web.action.DefaultController;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Created by zydd on 2025-05-30 15:13
*/
@RestController
@RequestMapping("/ae/conf/subjectContrast")
public class ContrastController extends DefaultController {
@Autowired
private IAeConfSubjectContrastService aeConfSubjectContrastService;
@RequestMapping(value = "/queryAll", method = RequestMethod.POST)
public JsonResultEntity queryAll(@RequestBody AeConfSubjectContrastEntity entity){
try {
List<AeConfSubjectContrastEntity> all = aeConfSubjectContrastService.queryAll(entity);
return getSuccessMessageEntity("请求成功",all);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity("请求失败",e.getMessage());
}
}
@RequestMapping(value = "/queryById", method = RequestMethod.POST)
public JsonResultEntity queryById(@RequestBody AeConfSubjectContrastEntity entity){
try {
List<AeConfSubjectContrastEntity> all = aeConfSubjectContrastService.queryById(entity);
return getSuccessMessageEntity("请求成功",all);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity("请求失败",e.getMessage());
}
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
public JsonResultEntity save(@RequestBody AeConfSubjectContrastEntity entity){
try {
AeConfSubjectContrastEntity save = aeConfSubjectContrastService.saveEntity(entity);
return getSuccessMessageEntity("请求成功",save);
} catch (Exception e) {
e.printStackTrace();
return getFailureMessageEntity("请求失败",e.getMessage());
}
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.voucher.ae.comf.subject.dao;
import com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 会计事项(accounting_event)-配置-科目对照(ae_conf_subject_contrast: table)表数据库访问层
*
* @author zydd
* @since 2025-05-30 15:04:47
*/
public interface IAeConfSubjectContrastDao extends IBaseDao<AeConfSubjectContrastEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.voucher.ae.comf.subject.dao.impl;
import com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity;
import com.hzya.frame.voucher.ae.comf.subject.dao.IAeConfSubjectContrastDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 会计事项(accounting_event)-配置-科目对照(AeConfSubjectContrast)表数据库访问层
*
* @author zydd
* @since 2025-05-30 15:04:47
*/
@Repository
public class AeConfSubjectContrastDaoImpl extends MybatisGenericDao<AeConfSubjectContrastEntity, String> implements IAeConfSubjectContrastDao{
}

View File

@ -0,0 +1,226 @@
package com.hzya.frame.voucher.ae.comf.subject.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 会计事项(accounting_event)-配置-科目对照(AeConfSubjectContrast)实体类
*
* @author zydd
* @since 2025-05-30 15:04:47
*/
public class AeConfSubjectContrastEntity extends BaseEntity {
/** 对照表code */
private String code;
/** 对照便name */
private String name;
/** 账簿id */
private String accountBookId;
/** 账簿code */
private String accountBookCode;
/** 账簿名称 */
private String accountBookName;
/** 公司pk */
private String pkCorp;
/** 公司类型 */
private String corpType;
/** 目标档案类型 */
private String desdocid;
/** 关联公司 */
private String pkSetcorp1;
/** 备注 */
private String remark;
private String def1;
private String def2;
private String def3;
private String def4;
private String def5;
private String def6;
private String def7;
private String def8;
private String def9;
private String def10;
/** 创建人 */
private String createUser;
/** 修改人 */
private String modifyUser;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAccountBookId() {
return accountBookId;
}
public void setAccountBookId(String accountBookId) {
this.accountBookId = accountBookId;
}
public String getAccountBookCode() {
return accountBookCode;
}
public void setAccountBookCode(String accountBookCode) {
this.accountBookCode = accountBookCode;
}
public String getAccountBookName() {
return accountBookName;
}
public void setAccountBookName(String accountBookName) {
this.accountBookName = accountBookName;
}
public String getPkCorp() {
return pkCorp;
}
public void setPkCorp(String pkCorp) {
this.pkCorp = pkCorp;
}
public String getCorpType() {
return corpType;
}
public void setCorpType(String corpType) {
this.corpType = corpType;
}
public String getDesdocid() {
return desdocid;
}
public void setDesdocid(String desdocid) {
this.desdocid = desdocid;
}
public String getPkSetcorp1() {
return pkSetcorp1;
}
public void setPkSetcorp1(String pkSetcorp1) {
this.pkSetcorp1 = pkSetcorp1;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
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 getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
}

View File

@ -0,0 +1,410 @@
<?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.voucher.ae.comf.subject.dao.impl.AeConfSubjectContrastDaoImpl">
<resultMap id="get-AeConfSubjectContrastEntity-result"
type="com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="accountBookId" column="account_book_id" jdbcType="VARCHAR"/>
<result property="accountBookCode" column="account_book_code" jdbcType="VARCHAR"/>
<result property="accountBookName" column="account_book_name" jdbcType="VARCHAR"/>
<result property="pkCorp" column="pk_corp" jdbcType="VARCHAR"/>
<result property="corpType" column="corp_type" jdbcType="VARCHAR"/>
<result property="desdocid" column="desdocid" jdbcType="VARCHAR"/>
<result property="pkSetcorp1" column="pk_setcorp1" jdbcType="VARCHAR"/>
<result property="remark" column="remark" 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="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createUser" column="create_user" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="modifyUser" column="modify_user" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="AeConfSubjectContrastEntity_Base_Column_List">
id
,code
,name
,account_book_id
,account_book_code
,account_book_name
,pk_corp
,corp_type
,desdocid
,pk_setcorp1
,remark
,def1
,def2
,def3
,def4
,def5
,def6
,def7
,def8
,def9
,def10
,create_time
,create_user
,modify_time
,modify_user
,sts
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-AeConfSubjectContrastEntity-result"
parameterType="com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity">
select
<include refid="AeConfSubjectContrastEntity_Base_Column_List"/>
from ae_conf_subject_contrast
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="code != null and code != ''">and code = #{code}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="accountBookId != null and accountBookId != ''">and account_book_id = #{accountBookId}</if>
<if test="accountBookCode != null and accountBookCode != ''">and account_book_code = #{accountBookCode}</if>
<if test="accountBookName != null and accountBookName != ''">and account_book_name = #{accountBookName}</if>
<if test="pkCorp != null and pkCorp != ''">and pk_corp = #{pkCorp}</if>
<if test="corpType != null and corpType != ''">and corp_type = #{corpType}</if>
<if test="desdocid != null and desdocid != ''">and desdocid = #{desdocid}</if>
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">and pk_setcorp1 = #{pkSetcorp1}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</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="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity">
select count(1) from ae_conf_subject_contrast
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="code != null and code != ''">and code = #{code}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="accountBookId != null and accountBookId != ''">and account_book_id = #{accountBookId}</if>
<if test="accountBookCode != null and accountBookCode != ''">and account_book_code = #{accountBookCode}</if>
<if test="accountBookName != null and accountBookName != ''">and account_book_name = #{accountBookName}</if>
<if test="pkCorp != null and pkCorp != ''">and pk_corp = #{pkCorp}</if>
<if test="corpType != null and corpType != ''">and corp_type = #{corpType}</if>
<if test="desdocid != null and desdocid != ''">and desdocid = #{desdocid}</if>
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">and pk_setcorp1 = #{pkSetcorp1}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</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="create_time != null">and create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-AeConfSubjectContrastEntity-result"
parameterType="com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity">
select
<include refid="AeConfSubjectContrastEntity_Base_Column_List"/>
from ae_conf_subject_contrast
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id like concat('%',#{id},'%')</if>
<if test="code != null and code != ''">and code like concat('%',#{code},'%')</if>
<if test="name != null and name != ''">and name like concat('%',#{name},'%')</if>
<if test="accountBookId != null and accountBookId != ''">and account_book_id like
concat('%',#{accountBookId},'%')
</if>
<if test="accountBookCode != null and accountBookCode != ''">and account_book_code like
concat('%',#{accountBookCode},'%')
</if>
<if test="accountBookName != null and accountBookName != ''">and account_book_name like
concat('%',#{accountBookName},'%')
</if>
<if test="pkCorp != null and pkCorp != ''">and pk_corp like concat('%',#{pkCorp},'%')</if>
<if test="corpType != null and corpType != ''">and corp_type like concat('%',#{corpType},'%')</if>
<if test="desdocid != null and desdocid != ''">and desdocid like concat('%',#{desdocid},'%')</if>
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">and pk_setcorp1 like concat('%',#{pkSetcorp1},'%')</if>
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</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="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="createUser != null and createUser != ''">and create_user like concat('%',#{createUser},'%')</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user like concat('%',#{modifyUser},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
and sts='Y'
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="AeConfSubjectContrastentity_list_or" resultMap="get-AeConfSubjectContrastEntity-result"
parameterType="com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity">
select
<include refid="AeConfSubjectContrastEntity_Base_Column_List"/>
from ae_conf_subject_contrast
<trim prefix="where" prefixOverrides="and">
<if test="id != null">or id = #{id}</if>
<if test="code != null and code != ''">or code = #{code}</if>
<if test="name != null and name != ''">or name = #{name}</if>
<if test="accountBookId != null and accountBookId != ''">or account_book_id = #{accountBookId}</if>
<if test="accountBookCode != null and accountBookCode != ''">or account_book_code = #{accountBookCode}</if>
<if test="accountBookName != null and accountBookName != ''">or account_book_name = #{accountBookName}</if>
<if test="pkCorp != null and pkCorp != ''">or pk_corp = #{pkCorp}</if>
<if test="corpType != null and corpType != ''">or corp_type = #{corpType}</if>
<if test="desdocid != null and desdocid != ''">or desdocid = #{desdocid}</if>
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">or pk_setcorp1 = #{pkSetcorp1}</if>
<if test="remark != null and remark != ''">or remark = #{remark}</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="create_time != null">or create_time = #{create_time}</if>
<if test="createUser != null and createUser != ''">or create_user = #{createUser}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="modifyUser != null and modifyUser != ''">or modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
and sts='Y'
</trim>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity"
keyProperty="id" useGeneratedKeys="true">
insert into ae_conf_subject_contrast(
<trim suffix="" suffixOverrides=",">
<if test="code != null and code != ''">code ,</if>
<if test="name != null and name != ''">name ,</if>
<if test="accountBookId != null and accountBookId != ''">account_book_id ,</if>
<if test="accountBookCode != null and accountBookCode != ''">account_book_code ,</if>
<if test="accountBookName != null and accountBookName != ''">account_book_name ,</if>
<if test="pkCorp != null and pkCorp != ''">pk_corp ,</if>
<if test="corpType != null and corpType != ''">corp_type ,</if>
<if test="desdocid != null and desdocid != ''">desdocid ,</if>
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">pk_setcorp1 ,</if>
<if test="remark != null and remark != ''">remark ,</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="create_time != null">create_time ,</if>
<if test="create_time == null">create_time ,</if>
<if test="createUser != null and createUser != ''">create_user ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="modify_time == null">modify_time ,</if>
<if test="modifyUser != null and modifyUser != ''">modify_user ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="code != null and code != ''">#{code} ,</if>
<if test="name != null and name != ''">#{name} ,</if>
<if test="accountBookId != null and accountBookId != ''">#{accountBookId} ,</if>
<if test="accountBookCode != null and accountBookCode != ''">#{accountBookCode} ,</if>
<if test="accountBookName != null and accountBookName != ''">#{accountBookName} ,</if>
<if test="pkCorp != null and pkCorp != ''">#{pkCorp} ,</if>
<if test="corpType != null and corpType != ''">#{corpType} ,</if>
<if test="desdocid != null and desdocid != ''">#{desdocid} ,</if>
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">#{pkSetcorp1} ,</if>
<if test="remark != null and remark != ''">#{remark} ,</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="create_time != null">#{create_time} ,</if>
<if test="create_time == null">now() ,</if>
<if test="createUser != null and createUser != ''">#{createUser} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="modify_time == null">now() ,</if>
<if test="modifyUser != null and modifyUser != ''">#{modifyUser} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into ae_conf_subject_contrast(code, name, account_book_id, account_book_code, account_book_name, pk_corp,
corp_type, desdocid, pk_setcorp1, remark, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10,
create_time, create_user, modify_time, modify_user, sts, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.name},#{entity.accountBookId},#{entity.accountBookCode},#{entity.accountBookName},#{entity.pkCorp},#{entity.corpType},#{entity.desdocid},#{entity.pkSetcorp1},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into ae_conf_subject_contrast(code, name, account_book_id, account_book_code, account_book_name, pk_corp,
corp_type, desdocid, pk_setcorp1, remark, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10,
create_time, create_user, modify_time, modify_user, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.code},#{entity.name},#{entity.accountBookId},#{entity.accountBookCode},#{entity.accountBookName},#{entity.pkCorp},#{entity.corpType},#{entity.desdocid},#{entity.pkSetcorp1},#{entity.remark},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.create_time},#{entity.createUser},#{entity.modify_time},#{entity.modifyUser},#{entity.sts})
</foreach>
on duplicate key update
code = values(code),
name = values(name),
account_book_id = values(account_book_id),
account_book_code = values(account_book_code),
account_book_name = values(account_book_name),
pk_corp = values(pk_corp),
corp_type = values(corp_type),
desdocid = values(desdocid),
pk_setcorp1 = values(pk_setcorp1),
remark = values(remark),
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),
create_time = values(create_time),
create_user = values(create_user),
modify_time = values(modify_time),
modify_user = values(modify_user),
sts = values(sts)
</insert>
<!--通过主键修改方法-->
<update id="entity_update"
parameterType="com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity">
update ae_conf_subject_contrast set
<trim suffix="" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="accountBookId != null and accountBookId != ''">account_book_id = #{accountBookId},</if>
<if test="accountBookCode != null and accountBookCode != ''">account_book_code = #{accountBookCode},</if>
<if test="accountBookName != null and accountBookName != ''">account_book_name = #{accountBookName},</if>
<if test="pkCorp != null and pkCorp != ''">pk_corp = #{pkCorp},</if>
<if test="corpType != null and corpType != ''">corp_type = #{corpType},</if>
<if test="desdocid != null and desdocid != ''">desdocid = #{desdocid},</if>
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">pk_setcorp1 = #{pkSetcorp1},</if>
<if test="remark != null and remark != ''">remark = #{remark},</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="create_time != null">create_time = #{create_time},</if>
<if test="createUser != null and createUser != ''">create_user = #{createUser},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="modifyUser != null and modifyUser != ''">modify_user = #{modifyUser},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete"
parameterType="com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity">
update ae_conf_subject_contrast
set sts= 'N',
modify_time = now()
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity">
update ae_conf_subject_contrast set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null">and id = #{id}</if>
<if test="code != null and code != ''">and code = #{code}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="accountBookId != null and accountBookId != ''">and account_book_id = #{accountBookId}</if>
<if test="accountBookCode != null and accountBookCode != ''">and account_book_code = #{accountBookCode}</if>
<if test="accountBookName != null and accountBookName != ''">and account_book_name = #{accountBookName}</if>
<if test="pkCorp != null and pkCorp != ''">and pk_corp = #{pkCorp}</if>
<if test="corpType != null and corpType != ''">and corp_type = #{corpType}</if>
<if test="desdocid != null and desdocid != ''">and desdocid = #{desdocid}</if>
<if test="pkSetcorp1 != null and pkSetcorp1 != ''">and pk_setcorp1 = #{pkSetcorp1}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</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="createUser != null and createUser != ''">and create_user = #{createUser}</if>
<if test="modifyUser != null and modifyUser != ''">and modify_user = #{modifyUser}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete
from ae_conf_subject_contrast
where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,20 @@
package com.hzya.frame.voucher.ae.comf.subject.service;
import com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity;
import com.hzya.frame.basedao.service.IBaseService;
import java.util.List;
/**
* 会计事项(accounting_event)-配置-科目对照(AeConfSubjectContrast)表服务接口
*
* @author zydd
* @since 2025-05-30 15:04:47
*/
public interface IAeConfSubjectContrastService extends IBaseService<AeConfSubjectContrastEntity, String>{
List<AeConfSubjectContrastEntity> queryAll(AeConfSubjectContrastEntity entity);
List<AeConfSubjectContrastEntity> queryById(AeConfSubjectContrastEntity entity);
AeConfSubjectContrastEntity saveEntity(AeConfSubjectContrastEntity entity);
}

View File

@ -0,0 +1,54 @@
package com.hzya.frame.voucher.ae.comf.subject.service.impl;
import cn.hutool.core.lang.Assert;
import com.hzya.frame.voucher.ae.comf.subject.entity.AeConfSubjectContrastEntity;
import com.hzya.frame.voucher.ae.comf.subject.dao.IAeConfSubjectContrastDao;
import com.hzya.frame.voucher.ae.comf.subject.service.IAeConfSubjectContrastService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* 会计事项(accounting_event)-配置-科目对照(AeConfSubjectContrast)表服务实现类
*
* @author zydd
* @since 2025-05-30 15:04:47
*/
@Service
public class AeConfSubjectContrastServiceImpl extends BaseService<AeConfSubjectContrastEntity, String> implements IAeConfSubjectContrastService {
private IAeConfSubjectContrastDao aeConfSubjectContrastDao;
@Autowired
public void setAeConfSubjectContrastDao(IAeConfSubjectContrastDao dao) {
this.aeConfSubjectContrastDao = dao;
this.dao = dao;
}
@Override
public List<AeConfSubjectContrastEntity> queryAll(AeConfSubjectContrastEntity entity) {
return null;
}
@Override
public List<AeConfSubjectContrastEntity> queryById(AeConfSubjectContrastEntity entity) {
Assert.notNull(entity.getId(),"根据id查询科目对照时科目对照表id不能为空");
return null;
}
/**
* 新增科目对照表
* TODO..账簿未同步
*/
@Override
public AeConfSubjectContrastEntity saveEntity(AeConfSubjectContrastEntity entity) {
Assert.notNull(entity.getAccountBookId(),"科目对照表新增时账簿id不能为空");
Assert.notNull(entity.getAccountBookCode(),"科目对照表新增时账簿code不能为空");
Assert.notNull(entity.getAccountBookName(),"科目对照表新增时账簿name不能为空");
return null;
}
}