旧代码合并,接口权限代码编写
This commit is contained in:
parent
3943e13755
commit
d8a14add80
|
@ -637,10 +637,7 @@ public class GeneralServiceImpl implements GeneralService {
|
|||
@Override
|
||||
public JsonResultEntity selectDictionaryshop(JSONObject object) {
|
||||
//校验数据(只校验表名称)
|
||||
if (!checkStr(object.getString("tableName"))) {
|
||||
return BaseResult.getFailureMessageEntity("表名不存在");
|
||||
}
|
||||
String tablename = object.getString("tableName");
|
||||
String tablename = "sys_dictionaryshop_new";
|
||||
JSONObject jsonObject = object.getJSONObject("jsonStr");
|
||||
List<WhereCriterion> whereCriteria = new ArrayList<>();
|
||||
whereCriteria.add(new WhereCriterion("(", "sts", ConditionType.等于.getValue(), "Y", ")", ConnectType.AND));
|
||||
|
|
|
@ -61,7 +61,7 @@ public class ExecSqlServiceImpl implements IExecSqlService {
|
|||
logger.info("=============execSelectSql方法要执行的sql:============" + select_sql);
|
||||
if (!select_sql.contains("update") && !select_sql.contains("delete")
|
||||
&& !select_sql.contains("insert") && !select_sql.contains("create")) {
|
||||
list = sqlSession.selectList("com.hzya.frame.sys.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql", entity);
|
||||
list = sqlSession.selectList("com.hzya.frame.sysnew.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql", entity);
|
||||
logger.info("===========execSelectSql方法返回的结果条数=============" + list.size());
|
||||
}
|
||||
//sqlSession.close();
|
||||
|
@ -87,7 +87,7 @@ public class ExecSqlServiceImpl implements IExecSqlService {
|
|||
logger.info("=============execUpdateSql方法要执行的sql:============" + sql);
|
||||
ExecSqlEntity entity = new ExecSqlEntity();
|
||||
entity.setSql(sql);
|
||||
int result = sqlSession.update("com.hzya.frame.sys.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_update", entity);
|
||||
int result = sqlSession.update("com.hzya.frame.sysnew.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_update", entity);
|
||||
logger.info("update受影响行数:" + result);
|
||||
//sqlSession.close();
|
||||
return result;
|
||||
|
@ -117,7 +117,7 @@ public class ExecSqlServiceImpl implements IExecSqlService {
|
|||
logger.info("=============execInsertSql方法要执行的sql:============" + sql);
|
||||
ExecSqlEntity entity = new ExecSqlEntity();
|
||||
entity.setSql(sql);
|
||||
int result = sqlSession.insert("com.hzya.frame.sys.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_insert", entity);
|
||||
int result = sqlSession.insert("com.hzya.frame.sysnew.execsql.entity.ExecSqlEntity.ExecSqlEntity_execsql_insert", entity);
|
||||
logger.info("insert受影响行数:" + result);
|
||||
//sqlSession.close();
|
||||
return result;
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface IBipOrgsDao extends IBaseDao<BipOrgsEntity, String> {
|
||||
|
||||
/**
|
||||
* 查询BIP业务单元
|
||||
* @param BipOrgsEntity
|
||||
* @return
|
||||
*/
|
||||
List<BipOrgsEntity> thirdInterfaceGetOrgs(BipOrgsEntity BipOrgsEntity);
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface IBipOrgsDetailsDao extends IBaseDao<BipOrgsDetailsEntity, String> {
|
||||
|
||||
/**
|
||||
* 查询BIP业务单元银行账户
|
||||
* @param BipOrgsDetailsEntity
|
||||
* @return
|
||||
*/
|
||||
List<BipOrgsDetailsEntity> thirdInterfaceGetOrgsDetails(BipOrgsDetailsEntity BipOrgsDetailsEntity);
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dao;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface IBipSupplierDao extends IBaseDao<BipSupplierEntity, String> {
|
||||
|
||||
/**
|
||||
* 查询BIP供应商
|
||||
* @param bipSupplierEntity
|
||||
* @return
|
||||
*/
|
||||
List<BipSupplierEntity> thirdInterfaceGetSupplier(BipSupplierEntity bipSupplierEntity);
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface IBipSupplierDetailsDao extends IBaseDao<BipSupplierDetailsEntity, String> {
|
||||
|
||||
/**
|
||||
* 查询BIP供应商明细
|
||||
* @param bipSupplierDetailsEntity
|
||||
* @return
|
||||
*/
|
||||
List<BipSupplierDetailsEntity> thirdInterfaceGetSupplierDetails(BipSupplierDetailsEntity bipSupplierDetailsEntity);
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository("bipOrgsDaoImpl")
|
||||
public class BipOrgsDaoImpl extends MybatisGenericDao<BipOrgsEntity,String> implements IBipOrgsDao {
|
||||
/**
|
||||
* 查询BIP业务单元
|
||||
* @param BipOrgsEntity
|
||||
* @return
|
||||
*/
|
||||
@DS("oracle91")
|
||||
@Override
|
||||
public List<BipOrgsEntity> thirdInterfaceGetOrgs(BipOrgsEntity BipOrgsEntity) {
|
||||
return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipOrgsDaoImpl.thirdInterfaceGetOrgs",BipOrgsEntity);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDetailsDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDetailsDao;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository("bipOrgsDetailsDaoImpl")
|
||||
public class BipOrgsDetailsDaoImpl extends MybatisGenericDao<BipOrgsDetailsEntity,String> implements IBipOrgsDetailsDao {
|
||||
@DS("oracle91")
|
||||
@Override
|
||||
public List<BipOrgsDetailsEntity> thirdInterfaceGetOrgsDetails(BipOrgsDetailsEntity bipOrgsDetailsEntity) {
|
||||
return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipOrgsDetailsDaoImpl.thirdInterfaceGetOrgsDetails",bipOrgsDetailsEntity);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dao.impl;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
|
||||
import com.hzya.frame.util.HttpUtil;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository("bipSupplierDaoImpl")
|
||||
public class BipSupplierDaoImpl extends MybatisGenericDao<BipSupplierEntity,String> implements IBipSupplierDao {
|
||||
/**
|
||||
* 查询BIP供应商
|
||||
* @param bipSupplierEntity
|
||||
* @return
|
||||
*/
|
||||
@DS("oracle91")
|
||||
@Override
|
||||
public List<BipSupplierEntity> thirdInterfaceGetSupplier(BipSupplierEntity bipSupplierEntity) {
|
||||
return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipSupplierDaoImpl.thirdInterfaceGetSupplier",bipSupplierEntity);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDetailsDao;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository("bipSupplierDetailsDaoImpl")
|
||||
public class BipSupplierDetailsDaoImpl extends MybatisGenericDao<BipSupplierDetailsEntity,String> implements IBipSupplierDetailsDao {
|
||||
@DS("oracle91")
|
||||
@Override
|
||||
public List<BipSupplierDetailsEntity> thirdInterfaceGetSupplierDetails(BipSupplierDetailsEntity bipSupplierDetailsEntity) {
|
||||
return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipSupplierDetailsDaoImpl.thirdInterfaceGetSupplierDetails",bipSupplierDetailsEntity);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dps.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
|
||||
public interface IPayMentService {
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 获取杭泰OA付款单传递CFS
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2023/10/16 11:59
|
||||
* **/
|
||||
String sendOAPayMentToCFS(JSONObject jsonObject,String type);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 获取CFS登录校验码
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2023/10/16 13:37
|
||||
* **/
|
||||
String sendCFSToken(String name,String password);
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 获取杭泰OA报销单传递CFS
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2023/10/16 16:17
|
||||
* **/
|
||||
String sendExpenseToCFS(JSONObject jsonObject);
|
||||
|
||||
}
|
|
@ -0,0 +1,389 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dps.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.bip.v3.v2207.dps.service.IPayMentService;
|
||||
import com.hzya.frame.dateutil.DateUtil;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.io.StringReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service(value = "payMentServiceImpl")
|
||||
public class PayMentServiceImpl implements IPayMentService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(PayMentServiceImpl.class);
|
||||
|
||||
private static final String NAME="admin";
|
||||
private static final String PASSWORD="aHRzejg4OA==";
|
||||
private static final String CFSURL="http://101.132.140.208:26883/erp/services/";//测试端口:26893,正式端口:26883
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 杭泰OA付款单传递CFS 注:付款单,资金归集,资金拨付,同名账户划转和借款单都用同一个接口
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2023/10/13 10:40
|
||||
* **/
|
||||
public String sendOAPayMentToCFS(JSONObject jsonStr,String type){
|
||||
logger.info("开始执行杭泰OA付款单传递CFS");
|
||||
try {
|
||||
String cfsToken = sendCFSToken(NAME, PASSWORD);
|
||||
if(null!=cfsToken) {
|
||||
String jsonStrObj = jsonStr.getString("jsonStr");
|
||||
JSONObject jsonObjectMain = JSON.parseObject(jsonStrObj);
|
||||
String erpVoucherNo = jsonObjectMain.getString("erpVoucherNo");//OA主键
|
||||
String purpose = jsonObjectMain.getString("purpose");//摘要
|
||||
String isForindividual = "0";//是否对私付款
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
String documentType=null;
|
||||
switch (type){
|
||||
case "pay"://付款单
|
||||
documentType="01";
|
||||
break;
|
||||
case "fundc"://资金归集
|
||||
documentType="02";
|
||||
break;
|
||||
case "funda"://资金拨付
|
||||
documentType="03";
|
||||
break;
|
||||
case "acc"://同名账户划转
|
||||
documentType="04";
|
||||
break;
|
||||
case "loan"://借款单
|
||||
documentType="05";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
JSONArray jsonStrList = jsonObjectMain.getJSONArray("details");
|
||||
if (null != jsonStrList && jsonStrList.size() > 0) {
|
||||
for (Object seeyonEntity : jsonStrList) {
|
||||
JSONObject jsonObjectFormson = JSON.parseObject(JSON.toJSONString(seeyonEntity));
|
||||
String payerAccName = jsonObjectFormson.getString("payerAccName");//转出方账户名(付款账户)
|
||||
String payerAccNo = jsonObjectFormson.getString("payerAccNo");//转出方账号(付款账号)
|
||||
String curCode = jsonObjectFormson.getString("curCode");//付款方币种
|
||||
String payeeAccName = jsonObjectFormson.getString("payeeAccName");//收款人帐户名称
|
||||
String payeeAccNo = jsonObjectFormson.getString("payeeAccNo");//收款方账户号
|
||||
BigDecimal amount = jsonObjectFormson.getBigDecimal("amount");//发生额
|
||||
String payeeBankCode = jsonObjectFormson.getString("payeeBankCode");//联行号
|
||||
String isQuick = jsonObjectFormson.getString("isQuick");//加急标志
|
||||
String payType = jsonObjectFormson.getString("payType");//结算方式
|
||||
String businessType = jsonObjectFormson.getString("businessType");//业务类别
|
||||
stringBuffer.append("<map>\n");
|
||||
stringBuffer.append("<documentType>" + nullConvert(documentType) + "</documentType>\n");
|
||||
stringBuffer.append("<erpVoucherNo>" + nullConvert(erpVoucherNo) + "</erpVoucherNo>\n");
|
||||
//stringBuffer.append("<payerAccName>"+"浙江杭泰数智能源开发有限公司"+"</payerAccName>\n");
|
||||
stringBuffer.append("<payerAccName>"+nullConvert(payerAccName)+"</payerAccName>\n");
|
||||
//stringBuffer.append("<payerAccNo>" +"71010122002702903"+ "</payerAccNo>\n");
|
||||
stringBuffer.append("<payerAccNo>" + nullConvert(payerAccNo) + "</payerAccNo>\n");
|
||||
stringBuffer.append("<curCode>" + nullConvert(curCode) + "</curCode>\n");
|
||||
stringBuffer.append("<payeeAccName>" + nullConvert(payeeAccName) + "</payeeAccName>\n");
|
||||
stringBuffer.append("<payeeAccNo>" + nullConvert(payeeAccNo) + "</payeeAccNo>\n");
|
||||
stringBuffer.append("<amount>" + nullConvert(String.valueOf(amount)) + "</amount>\n");
|
||||
//stringBuffer.append("<payeeBankCode>"+"301331000029"+"</payeeBankCode>\n");
|
||||
stringBuffer.append("<payeeBankCode>"+nullConvert(payeeBankCode)+"</payeeBankCode>\n");
|
||||
stringBuffer.append("<isQuick>" + nullConvert(isQuick) + "</isQuick>\n");
|
||||
stringBuffer.append("<isForindividual>" + nullConvert(isForindividual) + "</isForindividual>\n");
|
||||
stringBuffer.append("<payType>" + nullConvert(payType) + "</payType>\n");
|
||||
stringBuffer.append("<purpose>" + nullConvert(purpose) + "</purpose>\n");
|
||||
stringBuffer.append("<businessType>" + nullConvert(businessType) + "</businessType>\n");
|
||||
stringBuffer.append("<debitByCustomer>" + nullConvert(jsonObjectFormson.getString("debitByCustomer")) + "</debitByCustomer>\n");//借方客商辅助核算编码
|
||||
stringBuffer.append("<debitByBankAcc>" + nullConvert(payeeAccNo) + "</debitByBankAcc>\n");//借方银行账户辅助核算编码
|
||||
stringBuffer.append("<debitByPersonnel>" + nullConvert(jsonObjectFormson.getString("debitByPersonnel")) + "</debitByPersonnel>\n");//借方人员辅助核算编码
|
||||
stringBuffer.append("<creditByCustomer>" + nullConvert(jsonObjectFormson.getString("creditByCustomer")) + "</creditByCustomer>\n");//贷方客商辅助核算编码
|
||||
stringBuffer.append("<creditByBankAcc>" + nullConvert(payerAccNo) + "</creditByBankAcc>\n");//贷方银行辅助核算编码
|
||||
stringBuffer.append("</map>\n");
|
||||
}
|
||||
} else {
|
||||
stringBuffer.append("<map>\n");
|
||||
stringBuffer.append("<erpVoucherNo>" + nullConvert(erpVoucherNo) + "</erpVoucherNo>");
|
||||
stringBuffer.append("<purpose>" + nullConvert(purpose) + "</purpose>");
|
||||
stringBuffer.append("<isForindividual>" + nullConvert(isForindividual) + "</isForindividual>");
|
||||
stringBuffer.append("</map>\n");
|
||||
}
|
||||
String result=null;
|
||||
String xml= requestXML(cfsToken,"BkPaymentMainExchange",stringBuffer,"OA付款单同步发送");
|
||||
String url = "HTSZ_OA_BkPaymentMainWebService?wsdl";
|
||||
switch (type){
|
||||
case "pay"://付款单
|
||||
logger.info("OA付款单发送CFS的请求参数为:{}", xml);
|
||||
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
|
||||
logger.info("OA付款单发送CFS的返回参数为:{}", result);
|
||||
break;
|
||||
case "fundc"://资金归集
|
||||
logger.info("OA资金归集发送CFS的请求参数为:{}", xml);
|
||||
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
|
||||
logger.info("OA资金归集发送CFS的返回参数为:{}", result);
|
||||
break;
|
||||
case "funda"://资金调拨
|
||||
logger.info("OA资金拨付发送CFS的请求参数为:{}", xml);
|
||||
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
|
||||
logger.info("OA资金拨付发送CFS的返回参数为:{}", result);
|
||||
break;
|
||||
case "acc"://同名账户划转
|
||||
logger.info("OA同名账户划转发送CFS的请求参数为:{}", xml);
|
||||
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
|
||||
logger.info("OA同名账户划转发送CFS的返回参数为:{}", result);
|
||||
break;
|
||||
case "loan"://借款单
|
||||
logger.info("OA借还款发送CFS的请求参数为:{}", xml);
|
||||
result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
|
||||
logger.info("OA借还款发送CFS的返回参数为:{}", result);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return analyzeXML(result,"pay");
|
||||
}else{
|
||||
logger.info("请先登录CFS登录接口获取Token");
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("杭泰OA付款单传递CFS错误,原因为:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 获取CFS登录校验码
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2023/10/13 15:38
|
||||
* **/
|
||||
public String sendCFSToken(String name,String password) {
|
||||
try {
|
||||
String xml="<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:mdm=\"http://mdmData.server.webservice.banck.com\">\n" +
|
||||
" <soap:Header/>\n" +
|
||||
" <soap:Body>\n" +
|
||||
" <mdm:intoPaymentDataXml>\n" +
|
||||
" <!--Optional:-->\n" +
|
||||
" <mdm:xml>\n" +
|
||||
" <![CDATA[\n" +
|
||||
" <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
||||
"<message>\n" +
|
||||
"<head>\n" +
|
||||
"<transCode>LogOn</transCode>\n" +
|
||||
"<erpTimestamp>"+DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss")+"</erpTimestamp>\n" +
|
||||
"<sourcePlat>OA</sourcePlat>\n" +
|
||||
"<desPlat>CFS</desPlat>\n" +
|
||||
"<rmk>OA登录验证发送</rmk>\n" +
|
||||
"</head>\n" +
|
||||
"<body>\n" +
|
||||
"<user>"+name+"</user>\n" +
|
||||
"<password>"+password+"</password>\n" +
|
||||
"</body>\n" +
|
||||
"</message>\n" +
|
||||
" ]]>\n" +
|
||||
" </mdm:xml>\n" +
|
||||
" </mdm:intoPaymentDataXml>\n" +
|
||||
" </soap:Body>\n" +
|
||||
"</soap:Envelope>";
|
||||
logger.info("CFS登录的请求参数为:{}",xml);
|
||||
String url="HTSZ_OA_LogOnWebService?wsdl";
|
||||
String result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
|
||||
logger.info("CFS登录的返回参数为:{}",result);
|
||||
return analyzeXML(result,"login");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
logger.info("获取CFS登录失败,原因为:{}",e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 获取杭泰OA报销单传递CFS
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2023/10/16 16:17
|
||||
* **/
|
||||
@Override
|
||||
public String sendExpenseToCFS(JSONObject jsonStr) {
|
||||
logger.info("开始执行杭泰OA报销单传递CFS");
|
||||
try {
|
||||
String token = sendCFSToken(NAME, PASSWORD);
|
||||
if(null != token){
|
||||
String jsonStrObj = jsonStr.getString("jsonStr");
|
||||
JSONObject jsonObjectMain = JSON.parseObject(jsonStrObj);
|
||||
String erpVoucherNo = jsonObjectMain.getString("erpVoucherNo");//OA主键
|
||||
String purpose = jsonObjectMain.getString("purpose");//摘要
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
JSONArray jsonStrList = jsonObjectMain.getJSONArray("details");
|
||||
if(null != jsonStrList && jsonStrList.size()>0){
|
||||
for (Object o : jsonStrList) {
|
||||
JSONObject jsonObjectDetails = JSON.parseObject(JSON.toJSONString(o));
|
||||
String payerAccName = jsonObjectDetails.getString("payerAccName");//转出方账户名(付款账户)
|
||||
String payerAccNo = jsonObjectDetails.getString("payerAccNo");//转出方账号(付款账号)
|
||||
String curCode = jsonObjectDetails.getString("curCode");//付款方币种
|
||||
String payeeAccName = jsonObjectDetails.getString("payeeAccName");//收款人帐户名称
|
||||
String payeeAccNo = jsonObjectDetails.getString("payeeAccNo");//收款方账户号
|
||||
BigDecimal amount = jsonObjectDetails.getBigDecimal("amount");//发生额
|
||||
String payeeBankCode = jsonObjectDetails.getString("payeeBankCode");//联行号
|
||||
String isQuick = jsonObjectDetails.getString("isQuick");//加急标志
|
||||
String payType = jsonObjectDetails.getString("payType");//结算方式
|
||||
stringBuffer.append("<map>\n");
|
||||
stringBuffer.append("<erpVoucherNo>" + nullConvert(erpVoucherNo) + "</erpVoucherNo>\n");
|
||||
stringBuffer.append("<payerAccName>" + nullConvert(payerAccName) + "</payerAccName>\n");
|
||||
//stringBuffer.append("<payerAccName>"+"浙江杭泰数智能源开发有限公司"+"</payerAccName>\n");
|
||||
stringBuffer.append("<payerAccNo>" + nullConvert(payerAccNo) + "</payerAccNo>\n");
|
||||
//stringBuffer.append("<payerAccNo>" +"71010122002702903"+ "</payerAccNo>\n");
|
||||
stringBuffer.append("<curCode>" + nullConvert(curCode) + "</curCode>\n");
|
||||
stringBuffer.append("<payeeAccName>" + nullConvert(payeeAccName) + "</payeeAccName>\n");
|
||||
stringBuffer.append("<payeeAccNo>" + nullConvert(payeeAccNo) + "</payeeAccNo>\n");
|
||||
stringBuffer.append("<amount>" + nullConvert(String.valueOf(amount)) + "</amount>\n");
|
||||
stringBuffer.append("<payeeBankCode>" + nullConvert(payeeBankCode) + "</payeeBankCode>\n");
|
||||
//stringBuffer.append("<payeeBankCode>"+"301331000029"+"</payeeBankCode>\n");
|
||||
stringBuffer.append("<isQuick>" + nullConvert(isQuick) + "</isQuick>\n");
|
||||
stringBuffer.append("<payType>" + nullConvert(payType) + "</payType>\n");
|
||||
stringBuffer.append("<purpose>" + nullConvert(purpose) + "</purpose>\n");
|
||||
stringBuffer.append("</map>\n");
|
||||
}
|
||||
} else {
|
||||
stringBuffer.append("<map>\n");
|
||||
stringBuffer.append("<erpVoucherNo>" + erpVoucherNo + "</erpVoucherNo>\n");
|
||||
stringBuffer.append("<purpose>" + purpose + "</purpose>\n");
|
||||
stringBuffer.append("</map>\n");
|
||||
}
|
||||
String xml= requestXML(token,"BkExpenseExchange",stringBuffer,"OA费用报销单同步发送");
|
||||
logger.info("OA报销单发送CFS的请求参数为:{}", xml);
|
||||
String url = "HTSZ_OA_BkExpenseWebService?wsdl";
|
||||
String result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
|
||||
logger.info("OA报销单发送CFS的返回参数为:{}", result);
|
||||
return analyzeXML(result,"pay");
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("杭泰OA报销单传递CFS错误,原因为:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//null转成空字符串
|
||||
private static String nullConvert(String str){
|
||||
if (null == str){
|
||||
return "";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
private String requestXML(String token,String code,StringBuffer stringBuffer,String remark){
|
||||
String xml = "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:mdm=\"http://mdmData.server.webservice.banck.com\">\n" +
|
||||
" <soap:Header/>\n" +
|
||||
" <soap:Body>\n" +
|
||||
" <mdm:intoPaymentDataXml>\n" +
|
||||
" <!--Optional:-->\n" +
|
||||
" <mdm:xml>\n" +
|
||||
" <![CDATA[\n" +
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
||||
"<message>\n" +
|
||||
"<head>\n" +
|
||||
"<transCode>" + code + "</transCode>\n" +
|
||||
"<erpTimestamp>" + DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + "</erpTimestamp>\n" +
|
||||
"<sourcePlat>OA</sourcePlat>\n" +
|
||||
"<desPlat>CFS</desPlat>\n" +
|
||||
"<rmk>" + remark + "</rmk>\n" +
|
||||
"<sessionId>" + token + "</sessionId>\n" +
|
||||
"</head>\n" +
|
||||
"<body>\n" +
|
||||
"<list>\n";
|
||||
if (stringBuffer != null) {
|
||||
xml += stringBuffer.toString();
|
||||
xml += "</list>\n" +
|
||||
"</body>\n" +
|
||||
"</message>\n" +
|
||||
" ]]>\n" +
|
||||
" </mdm:xml>\n" +
|
||||
" </mdm:intoPaymentDataXml>\n" +
|
||||
" </soap:Body>\n" +
|
||||
"</soap:Envelope>";
|
||||
} else {
|
||||
xml += "</list>\n" +
|
||||
"</body>\n" +
|
||||
"</message>\n" +
|
||||
"]]>\n" +
|
||||
" </mdm:xml>\n" +
|
||||
" </mdm:intoPaymentDataXml>\n" +
|
||||
" </soap:Body>\n" +
|
||||
"</soap:Envelope>";
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @content 解析CFS返回的xml格式
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author hecan
|
||||
* @Date 2023/10/19 14:07
|
||||
* **/
|
||||
private static String analyzeXML(String result,String type){
|
||||
try {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
org.w3c.dom.Document document = builder.parse(new InputSource(new StringReader(result)));
|
||||
org.w3c.dom.Element bodyElement = (org.w3c.dom.Element) document.getElementsByTagName("ns:return").item(0);
|
||||
if (null!=bodyElement) {
|
||||
String textContent = bodyElement.getTextContent();
|
||||
Document documentContext = DocumentHelper.parseText(textContent);
|
||||
Element rootElement = documentContext.getRootElement();
|
||||
Element body = rootElement.element("body");
|
||||
if (null != body) {
|
||||
switch (type) {
|
||||
case "login"://登录
|
||||
Element sessionId = body.element("sessionId");
|
||||
if (null != sessionId) {
|
||||
logger.info("CFS登录的登录校验码为:{}", sessionId.getText());
|
||||
return sessionId.getText();
|
||||
} else {
|
||||
logger.info("CFS登录的登录校验码没有获取到,请重新获取");
|
||||
return null;
|
||||
}
|
||||
case "pay"://付款单和报销单
|
||||
Element list = body.element("list");
|
||||
List<Element> elements = list.elements();
|
||||
String serialNo = null;
|
||||
String statusMsg = null;
|
||||
String erpVoucherNoCfs = null;
|
||||
for (Element element : elements) {
|
||||
serialNo = element.element("serialNo").getText();
|
||||
statusMsg = element.element("statusMsg").getText();
|
||||
erpVoucherNoCfs = element.element("erpVoucherNo").getText();
|
||||
}
|
||||
JSONObject jsonObject=new JSONObject();
|
||||
jsonObject.put("erpVoucherNoCfs",erpVoucherNoCfs);
|
||||
jsonObject.put("statusMsg",statusMsg);
|
||||
jsonObject.put("serialNo",serialNo);
|
||||
//return "当前单据:" + erpVoucherNoCfs + ",传递CFS返回信息:" + statusMsg + ",流水号:" + serialNo;
|
||||
return jsonObject.toJSONString();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("解析CFS返回的xml格式错误:{}",e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,210 @@
|
|||
package com.hzya.frame.bip.v3.v2207.dps.task;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.bip.v3.v2207.dps.service.IPayMentService;
|
||||
import com.hzya.frame.dateutil.DateUtil;
|
||||
import com.hzya.frame.seeyon.dao.ICtpAttachmentDao;
|
||||
import com.hzya.frame.seeyon.dao.ISeeYonDao;
|
||||
import com.hzya.frame.seeyon.entity.CtpAttachmentEntity;
|
||||
import com.hzya.frame.seeyon.entity.SeeyonEntity;
|
||||
import com.hzya.frame.uuid.UUIDLong;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.io.File;
|
||||
import java.io.StringReader;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@EnableScheduling
|
||||
@Component
|
||||
public class ElectronicTask {
|
||||
static Logger logger= LoggerFactory.getLogger(ElectronicTask.class);
|
||||
|
||||
@Resource
|
||||
private IPayMentService payMentService;
|
||||
@Resource
|
||||
private ISeeYonDao seeYonDao;
|
||||
@Resource
|
||||
private ICtpAttachmentDao ctpAttachmentDao;
|
||||
|
||||
|
||||
//@Scheduled(cron = "0 20 10 * * ?")
|
||||
public void sendElectronicToCFS() {
|
||||
logger.info("CFS电子回单共享开始执行---------->");
|
||||
try {
|
||||
String token = payMentService.sendCFSToken("admin", "aHRzejg4OA==");
|
||||
if(null!=token) {
|
||||
List<SeeyonEntity> seeyonEntities = seeYonDao.selectOAListByTypeformmain_0327(new SeeyonEntity());
|
||||
if (seeyonEntities != null && seeyonEntities.size() > 0) {
|
||||
for (SeeyonEntity seeyonEntity : seeyonEntities) {
|
||||
String bankAcc = seeyonEntity.getField0137();//付款账号
|
||||
//String bankAcc="03005389347";
|
||||
String erpVoucherNo = seeyonEntity.getId();//OA付款单号
|
||||
String xml = "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:mdm=\"http://mdmData.server.webservice.banck.com\">\n" +
|
||||
" <soap:Header/>\n" +
|
||||
" <soap:Body>\n" +
|
||||
" <mdm:intoPaymentDataXml>\n" +
|
||||
" <!--Optional:-->\n" +
|
||||
" <mdm:xml>\n" +
|
||||
" <![CDATA[\n" +
|
||||
" <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
||||
"<message>\n" +
|
||||
"<head>\n" +
|
||||
"<transCode>BkReceiptQueryExchange</transCode>\n" +
|
||||
"<erpTimestamp>" + DateUtil.dateToString(new Date(), "yyyy-mm-dd hh:mm:ss") + "</erpTimestamp>\n" +
|
||||
"<sourcePlat>CFS</sourcePlat>\n" +
|
||||
"<desPlat>OA</desPlat>\n" +
|
||||
"<rmk>OA电子回单共享发送</rmk>\n" +
|
||||
"<sessionId>" + token + "</sessionId>\n" +
|
||||
"</head>\n" +
|
||||
"<body>\n" +
|
||||
"<bankAcc>" + bankAcc + "</bankAcc>\n" +
|
||||
"<erpVoucherNo>" + erpVoucherNo + "</erpVoucherNo>\n" +
|
||||
"</body>\n" +
|
||||
"</message>\n" +
|
||||
" ]]>\n" +
|
||||
" </mdm:xml>\n" +
|
||||
" </mdm:intoPaymentDataXml>\n" +
|
||||
" </soap:Body>\n" +
|
||||
"</soap:Envelope>";
|
||||
logger.info("CFS电子回单共享请求参数为:{}", xml);
|
||||
String url = "http://101.132.140.208:26893/erp/services/HTSZ_OA_BkReceiptQueryWebService?wsdl";
|
||||
String result = HttpRequest.post(url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
|
||||
logger.info("CFS电子回单共享请求参数为:{}", result);
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
org.w3c.dom.Document document = builder.parse(new InputSource(new StringReader(result)));
|
||||
org.w3c.dom.Element bodyElement = (org.w3c.dom.Element) document.getElementsByTagName("ns:return").item(0);
|
||||
if (null != bodyElement) {
|
||||
String textContent = bodyElement.getTextContent();
|
||||
Document documentContext = DocumentHelper.parseText(textContent);
|
||||
Element rootElement = documentContext.getRootElement();
|
||||
Element body = rootElement.element("body");
|
||||
if("0000".equalsIgnoreCase(rootElement.element("head").element("returnCode").getText())){
|
||||
if (null != body) {
|
||||
Element listElc = body.element("list");
|
||||
List<Element> elementsElc = listElc.elements();
|
||||
for (Element element : elementsElc) {
|
||||
String fielPath = element.element("filePath").getText();//电子回单附件路径
|
||||
if (fielPath != null && fielPath!="") {
|
||||
// String fielPath="C:\\Users\\笃曙\\Desktop\\15HZ000342CIBN2023091100066856211000001.pdf";
|
||||
File file = new File(fielPath);
|
||||
JSONObject jsonObject = fileUpload(file);
|
||||
logger.info("上传返回的附件id为:{}", jsonObject.getString("fileUrl"));
|
||||
if (jsonObject.getString("fileUrl") != null) {
|
||||
//表单的附件字段=ctpAttachment的Sub_reference,表单的Summary_id=ctpAttachment的att_reference
|
||||
String sub_reference = String.valueOf(UUIDLong.longUUID());
|
||||
seeyonEntity.setField0264(sub_reference);
|
||||
seeYonDao.updateFormformmain_0327(seeyonEntity);
|
||||
//根据附件id查询附件业务数据
|
||||
String file_url = jsonObject.getString("fileUrl");
|
||||
CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity();
|
||||
ctpAttachmentEntity.setFile_url(file_url);
|
||||
String att_reference = seeyonEntity.getSummary_id();//Summary_id
|
||||
ctpAttachmentEntity.setSub_reference(sub_reference);
|
||||
ctpAttachmentEntity.setAtt_reference(att_reference);
|
||||
List<CtpAttachmentEntity> ctpAttachmentEntities = ctpAttachmentDao.queryCtpAttachment(ctpAttachmentEntity);
|
||||
//如果没有查询到数据,就新增附件业务,否则更新
|
||||
if (ctpAttachmentEntities.size() == 0) {
|
||||
String category = jsonObject.getString("category");
|
||||
String type = jsonObject.getString("type");
|
||||
String filename = jsonObject.getString("filename");
|
||||
String mime_type = jsonObject.getString("mimeType");
|
||||
String attachment_size = jsonObject.getString("size");
|
||||
String id = String.valueOf(UUIDLong.longUUID());
|
||||
ctpAttachmentEntity.setCategory(category);
|
||||
ctpAttachmentEntity.setFilename(filename);
|
||||
ctpAttachmentEntity.setType(type);
|
||||
ctpAttachmentEntity.setMime_type(mime_type);
|
||||
ctpAttachmentEntity.setAttachment_size(attachment_size);
|
||||
ctpAttachmentEntity.setId(id);
|
||||
ctpAttachmentEntity.setCategory("66");
|
||||
ctpAttachmentEntity.setCreatedate(new Date());
|
||||
ctpAttachmentDao.saveCtpAttachment(ctpAttachmentEntity);
|
||||
} else {
|
||||
if (ctpAttachmentEntities.size() > 1) {
|
||||
throw new BaseSystemException("OA附件业务表中查到多条记录");
|
||||
}
|
||||
//更新数据到OA附件业务表中
|
||||
ctpAttachmentDao.updateCtpAttachment(ctpAttachmentEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.info("CFS电子回单返回得错误编码:{},以及返回的错误信息:{}",rootElement.element("head").element("returnCode").getText(),rootElement.element("head").element("returnMsg").getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("CFS电子回单共享错误:{}",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static JSONObject fileUpload(File file) {
|
||||
if (null != file) {
|
||||
try {
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("file", file);
|
||||
String url = "/seeyon/rest/attachment?token=@token@";//如果后面加上applicationCategory=1&extensions=&firstSave=true,附件业务自动生成一条记录
|
||||
url = url.replaceAll("@token@", getToken());
|
||||
String result = HttpUtil.post("http://60.204.152.210" + url, paramMap);
|
||||
if (StrUtil.isNotBlank(result)) {
|
||||
logger.info("附件上传结果"+result);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
String atts = jsonObject.get("atts").toString();
|
||||
if (StrUtil.isNotEmpty(atts)) {
|
||||
JSONArray jsonArray = JSONArray.parseArray(atts);
|
||||
JSONObject res = (JSONObject) jsonArray.get(0);
|
||||
/* String fileUrl = res.getString("fileUrl");
|
||||
logger.info("附件id:" + fileUrl);
|
||||
return fileUrl;*/
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("附件上传失败"+e.getMessage());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String getToken() {
|
||||
//获取oatoken
|
||||
HashMap<String, String> hashMap = new HashMap<>();
|
||||
hashMap.put("userName", "hzyaRest");
|
||||
hashMap.put("password", "a5ce21b8-91db-4cec-b3e3-3e44719655fd");
|
||||
hashMap.put("loginName","bdmanager");
|
||||
String result = HttpUtil.post("http://60.204.152.210" + "/seeyon/rest/token", JSON.toJSONString(hashMap));
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (null != jsonObject) {
|
||||
logger.info(result);
|
||||
logger.info("======token:{}======" + jsonObject.getString("id"));
|
||||
return jsonObject.getString("id");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.hzya.frame.bip.v3.v2207.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/****
|
||||
* BIP组织账户
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-10-24 10:03
|
||||
* @param
|
||||
* @return
|
||||
**/
|
||||
public class BipOrgsDetailsEntity extends BaseEntity {
|
||||
|
||||
/*开户行编码*/
|
||||
private String bankCode;
|
||||
/*开户行名称*/
|
||||
private String bankName;
|
||||
/*账户*/
|
||||
private String accnum;
|
||||
/*与组织关联的字段*/
|
||||
private String controlorg;
|
||||
/*联行号*/
|
||||
private String cnapsCode;
|
||||
|
||||
public String getCnapsCode() {
|
||||
return cnapsCode;
|
||||
}
|
||||
|
||||
public void setCnapsCode(String cnapsCode) {
|
||||
this.cnapsCode = cnapsCode;
|
||||
}
|
||||
|
||||
public String getControlorg() {
|
||||
return controlorg;
|
||||
}
|
||||
|
||||
public void setControlorg(String controlorg) {
|
||||
this.controlorg = controlorg;
|
||||
}
|
||||
|
||||
public String getBankCode() {
|
||||
return bankCode;
|
||||
}
|
||||
|
||||
public void setBankCode(String bankCode) {
|
||||
this.bankCode = bankCode;
|
||||
}
|
||||
|
||||
public String getBankName() {
|
||||
return bankName;
|
||||
}
|
||||
|
||||
public void setBankName(String bankName) {
|
||||
this.bankName = bankName;
|
||||
}
|
||||
|
||||
public String getAccnum() {
|
||||
return accnum;
|
||||
}
|
||||
|
||||
public void setAccnum(String accnum) {
|
||||
this.accnum = accnum;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
<?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.bip.v3.v2207.dao.impl.BipOrgsDetailsDaoImpl">
|
||||
<resultMap id="get-BipOrgsDetailsEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity">
|
||||
<result property="bankCode" column="bankCode" />
|
||||
<result property="bankName" column="bankName" />
|
||||
<result property="accnum" column="accnum" />
|
||||
<result property="controlorg" column="controlorg" />
|
||||
<result property="cnapsCode" column="cnapsCode" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="BipOrgsDetailsEntity_Base_Column_List">
|
||||
bankdoc.code as bankCode,bankdoc.name as bankName,bankaccbas.accnum,bankaccbas.controlorg,bankaccbas.combinenum as cnapsCode
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-BipOrgsDetailsEntity-result">
|
||||
select
|
||||
<include refid="BipOrgsDetailsEntity_Base_Column_List" />
|
||||
from bd_bankaccbas where pk_bankaccbas = #{pk_bankaccbas}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="thirdInterfaceGetOrgsDetails" resultMap="get-BipOrgsDetailsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity">
|
||||
select
|
||||
<include refid="BipOrgsDetailsEntity_Base_Column_List" />
|
||||
from bd_bankaccbas bankaccbas
|
||||
left join bd_bankdoc bankdoc on bankdoc.pk_bankdoc=bankaccbas.pk_bankdoc
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="bankCode != null and bankCode !=''">bankdoc.code=#{bankCode}</if>
|
||||
<if test="bankName != null and bankName !='' "> and bankdoc.name = #{bankName}</if>
|
||||
<if test="accnum != null and accnum !='' "> and bankaccbas.accnum = #{accnum}</if>
|
||||
and bankaccbas.dr='0' and bankdoc.dr='0' and bankaccbas.pk_banktype!='0001Z01000000000036S' and bankaccbas.controlorg = #{controlorg}
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.hzya.frame.bip.v3.v2207.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: BIP组织 entity
|
||||
* @tableName: org_orgs
|
||||
* @entityName: BipOrgsEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class BipOrgsEntity extends BaseEntity {
|
||||
/*单位编码*/
|
||||
private String code;
|
||||
/*开户单位*/
|
||||
private String name;
|
||||
/*BIPID*/
|
||||
private String tripartiteId;
|
||||
private String pk_financeorg;
|
||||
private String orgsts;
|
||||
|
||||
public String getOrgsts() {
|
||||
return orgsts;
|
||||
}
|
||||
|
||||
public void setOrgsts(String orgsts) {
|
||||
this.orgsts = orgsts;
|
||||
}
|
||||
|
||||
public String getPk_financeorg() {
|
||||
return pk_financeorg;
|
||||
}
|
||||
|
||||
public void setPk_financeorg(String pk_financeorg) {
|
||||
this.pk_financeorg = pk_financeorg;
|
||||
}
|
||||
|
||||
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 getTripartiteId() {
|
||||
return tripartiteId;
|
||||
}
|
||||
|
||||
public void setTripartiteId(String tripartiteId) {
|
||||
this.tripartiteId = tripartiteId;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
<?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.bip.v3.v2207.dao.impl.BipOrgsDaoImpl">
|
||||
<resultMap id="get-BipOrgsEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
|
||||
<result property="tripartiteId" column="tripartiteId" />
|
||||
<result property="code" column="code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="pk_financeorg" column="pk_financeorg"/>
|
||||
<result property="orgsts" column="orgsts"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="BipOrgsEntity_Base_Column_List">
|
||||
orgs.pk_financeorg as tripartiteId,
|
||||
orgs.name ,
|
||||
orgs.code,
|
||||
max(org_bank.ts)as ts
|
||||
|
||||
</sql>
|
||||
|
||||
<sql id="BipOrgsEntity_Base_Column_List_details">
|
||||
bankdoc.code as bankCode,bankdoc.name as bankName,bankaccbas.accnum,bankaccbas.controlorg
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-BipOrgsEntity-result">
|
||||
select
|
||||
<include refid="BipOrgsEntity_Base_Column_List" />
|
||||
from org_financeorg where pk_financeorg = #{pk_financeorg}
|
||||
</select>
|
||||
|
||||
<select id="thirdInterfaceGetOrgs" resultMap="get-BipOrgsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
|
||||
select
|
||||
<include refid="BipOrgsEntity_Base_Column_List" />
|
||||
FROM
|
||||
org_financeorg orgs
|
||||
left join v_hzya_org_bank org_bank on org_bank.controlorg = orgs.pk_financeorg
|
||||
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="code != null and code !=''"> orgs.code = #{code}</if>
|
||||
<if test="name != null and name !='' "> and orgs.name = #{name}</if>
|
||||
<if test="pk_financeorg != null and pk_financeorg !='' "> and orgs.pk_financeorg = #{tripartiteId}</if>
|
||||
<if test="orgsts != null and orgsts !='' "> and orgs.ts >'2023-09-30 14:18:39' and orgs.ts > #{orgsts}</if>
|
||||
and orgs.dr='0'
|
||||
</trim>
|
||||
GROUP BY orgs.pk_financeorg ,orgs.name,orgs.code
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="thirdInterfaceGetSupplierDetails" resultMap="get-BipOrgsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
|
||||
select
|
||||
<include refid="BipOrgsEntity_Base_Column_List_details" />
|
||||
from bd_bankaccbas bankaccbas
|
||||
left join bd_bankdoc bankdoc on bankdoc.pk_bankdoc=bankaccbas.pk_bankdoc
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="code != null and code !=''">bankdoc.code=#{code}</if>
|
||||
<if test="name != null and name !='' "> and bankdoc.name = #{name}</if>
|
||||
<if test="accnum != null and accnum !='' "> and bankaccbas.accnum = #{accnum}</if>
|
||||
<if test="controlorg != null and controlorg !='' "> and bankaccbas.controlorg = #{controlorg}</if>
|
||||
and bankaccbas.dr='0' and bankdoc.dr='0' and bankaccbas.pk_banktype!='0001Z01000000000036S'
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<!--<select id="BipOrgsEntity_list_base" resultMap="get-BipOrgsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
|
||||
select
|
||||
<include refid="BipOrgsEntity_Base_Column_List" />
|
||||
FROM bd_cust_supplier supplier
|
||||
left join db_customerbank bank ON supplier.code = bank.code
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="code != null and code !=''">supplier.code=#{code}</if>
|
||||
<if test="name != null and name !='' "> and supplier.name = #{name}</if>
|
||||
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayerid = #{taxpayerid}</if>
|
||||
<if test="def1 != null and def1 !='' "> and bank.def1 = #{def1}</if>
|
||||
<if test="def2 != null and def2 !='' "> and bank.def2 = #{def2}</if>
|
||||
<if test="def3 != null and def3 !='' "> and bank.def3 = #{def3}</if>
|
||||
</trim>
|
||||
</select>-->
|
||||
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<!--<select id="entity_list_like" resultMap="get-BipOrgsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity">
|
||||
select
|
||||
<include refid="BipOrgsEntity_Base_Column_List" />
|
||||
FROM bd_cust_supplier supplier
|
||||
left join db_customerbank bank ON supplier.code = bank.code
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="code != null and code !=''"> supplier.code like concat('%',#{code},'%')</if>
|
||||
<if test="name != null and name !='' "> and supplier.name like concat('%',#{name},'%')</if>
|
||||
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayeridlike concat('%',#{taxpayeridlike},'%')</if>
|
||||
<if test="def1 != null and def1 !='' "> and bank.def1 like concat('%',#{def1},'%')</if>
|
||||
<if test="def2 != null and def2 !='' "> and bank.def2 like concat('%',#{def2},'%')</if>
|
||||
<if test="def3 != null and def3 !='' "> and bank.def3 like concat('%',#{def3},'%')</if>
|
||||
</trim>
|
||||
</select>-->
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.hzya.frame.bip.v3.v2207.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
public class BipSupplierDetailsEntity extends BaseEntity {
|
||||
|
||||
private String code;
|
||||
private String name;
|
||||
/*开户行*/
|
||||
private String splitbank;
|
||||
/*银行账号*/
|
||||
private String bankaccno;
|
||||
/*是否默认*/
|
||||
private String isdefault;
|
||||
/*联行号*/
|
||||
private String combinno;
|
||||
|
||||
private String tripartiteId;
|
||||
|
||||
public String getCombinno() {
|
||||
return combinno;
|
||||
}
|
||||
|
||||
public void setCombinno(String combinno) {
|
||||
this.combinno = combinno;
|
||||
}
|
||||
|
||||
public String getTripartiteId() {
|
||||
return tripartiteId;
|
||||
}
|
||||
|
||||
public void setTripartiteId(String tripartiteId) {
|
||||
this.tripartiteId = tripartiteId;
|
||||
}
|
||||
|
||||
public String getIsdefault() {
|
||||
return isdefault;
|
||||
}
|
||||
|
||||
public void setIsdefault(String isdefault) {
|
||||
this.isdefault = isdefault;
|
||||
}
|
||||
|
||||
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 getSplitbank() {
|
||||
return splitbank;
|
||||
}
|
||||
|
||||
public void setSplitbank(String splitbank) {
|
||||
this.splitbank = splitbank;
|
||||
}
|
||||
|
||||
public String getBankaccno() {
|
||||
return bankaccno;
|
||||
}
|
||||
|
||||
public void setBankaccno(String bankaccno) {
|
||||
this.bankaccno = bankaccno;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
<?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.bip.v3.v2207.dao.impl.BipSupplierDetailsDaoImpl">
|
||||
<resultMap id="get-BipSupplierDetailsEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity">
|
||||
<result property="code" column="code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="splitbank" column="splitbank" />
|
||||
<result property="bankaccno" column="bankaccno" />
|
||||
<result property="tripartiteId" column="tripartiteId"></result>
|
||||
<result property="combinno" column="combinno"></result>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="BipSupplierDetailsEntity_Base_Column_List">
|
||||
splitbank,bankaccno,combinno,name,code
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-BipSupplierDetailsEntity-result">
|
||||
select
|
||||
<include refid="BipSupplierDetailsEntity_Base_Column_List" />
|
||||
from BD_SUPPLIER where pk_supplier = #{pk_supplier} and sdr='0'
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="thirdInterfaceGetSupplierDetails" resultMap="get-BipSupplierDetailsEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity">
|
||||
select
|
||||
<include refid="BipSupplierDetailsEntity_Base_Column_List" />
|
||||
FROM db_customerbank
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="code != null and code !=''">code=#{code}</if>
|
||||
<if test="name != null and name !='' "> and name = #{name}</if>
|
||||
<if test="bankaccno != null and bankaccno !='' "> and bankaccno = #{bankaccno}</if>
|
||||
<if test="splitbank != null and splitbank !='' "> and splitbank = #{splitbank}</if>
|
||||
<if test="combinno != null and combinno !='' "> and combinno = #{combinno}</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.hzya.frame.bip.v3.v2207.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @description: BIP供应商 entity
|
||||
* @tableName: BD_SUPPLIER
|
||||
* @entityName: BipSupplierEntity
|
||||
* @author: gjh
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class BipSupplierEntity extends BaseEntity {
|
||||
|
||||
private String code;
|
||||
private String name;
|
||||
/*税号*/
|
||||
private String taxpayerid;
|
||||
/*地址*/
|
||||
private String def1;
|
||||
/*电话*/
|
||||
private String def2;
|
||||
/*联系人*/
|
||||
private String def3;
|
||||
private String tripartiteId;
|
||||
|
||||
public String getTripartiteId() {
|
||||
return tripartiteId;
|
||||
}
|
||||
|
||||
public void setTripartiteId(String tripartiteId) {
|
||||
this.tripartiteId = tripartiteId;
|
||||
}
|
||||
|
||||
private String ts;
|
||||
|
||||
public String getTs() {
|
||||
return ts;
|
||||
}
|
||||
|
||||
public void setTs(String ts) {
|
||||
this.ts = ts;
|
||||
}
|
||||
|
||||
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 getTaxpayerid() {
|
||||
return taxpayerid;
|
||||
}
|
||||
|
||||
public void setTaxpayerid(String taxpayerid) {
|
||||
this.taxpayerid = taxpayerid;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
<?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.bip.v3.v2207.dao.impl.BipSupplierDaoImpl">
|
||||
<resultMap id="get-BipSupplierEntity-result" type="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
|
||||
<result property="taxpayerid" column="taxpayerid" />
|
||||
<result property="def1" column="def1" />
|
||||
<result property="def2" column="def2" />
|
||||
<result property="def3" column="def3" />
|
||||
<result property="code" column="code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="ts" column="ts" />
|
||||
<result property="tripartiteId" column="tripartiteId" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="BipSupplierEntity_Base_Column_List">
|
||||
supplier.code,supplier.name,supplier.taxpayerid,bank.def1,bank.def2,bank.def3,supplier.ts, supplier.pk_cust_sup as tripartiteId
|
||||
</sql>
|
||||
|
||||
<sql id="BipSupplierEntity_Base_Column_List_details">
|
||||
splitbank,bankaccno,name,code
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-BipSupplierEntity-result">
|
||||
select
|
||||
<include refid="BipSupplierEntity_Base_Column_List" />
|
||||
from BD_SUPPLIER where pk_supplier = #{pk_supplier} and sdr='0'
|
||||
</select>
|
||||
|
||||
<select id="thirdInterfaceGetSupplier" resultMap="get-BipSupplierEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
|
||||
select
|
||||
<include refid="BipSupplierEntity_Base_Column_List" />
|
||||
FROM bd_cust_supplier supplier
|
||||
left join db_customerbank bank ON supplier.code = bank.code
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="code != null and code !=''">supplier.code=#{code}</if>
|
||||
<if test="name != null and name !='' "> and supplier.name = #{name}</if>
|
||||
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayerid = #{taxpayerid}</if>
|
||||
<if test="def1 != null and def1 !='' "> and bank.def1 = #{def1}</if>
|
||||
<if test="def2 != null and def2 !='' "> and bank.def2 = #{def2}</if>
|
||||
<if test="def3 != null and def3 !='' "> and bank.def3 = #{def3}</if>
|
||||
<if test="tripartiteId != null and tripartiteId !='' "> and supplier.tripartiteId = #{tripartiteId}</if>
|
||||
<if test="ts != null and ts !='' "> and supplier.ts >'2023-09-30 14:18:39' and supplier.ts > #{ts} </if>
|
||||
</trim>
|
||||
group by supplier.code,supplier.name,supplier.taxpayerid,bank.def1,bank.def2,bank.def3,supplier.ts, supplier.pk_cust_sup
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="thirdInterfaceGetSupplierDetails" resultMap="get-BipSupplierEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
|
||||
select
|
||||
<include refid="BipSupplierEntity_Base_Column_List_details" />
|
||||
FROM db_customerbank
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="code != null and code !=''">code=#{code}</if>
|
||||
<if test="name != null and name !='' "> and name = #{name}</if>
|
||||
<if test="bankaccno != null and bankaccno !='' "> and bankaccno = #{bankaccno}</if>
|
||||
<if test="splitbank != null and splitbank !='' "> and splitbank = #{splitbank}</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="BipSupplierEntity_list_base" resultMap="get-BipSupplierEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
|
||||
select
|
||||
<include refid="BipSupplierEntity_Base_Column_List" />
|
||||
FROM bd_cust_supplier supplier
|
||||
left join db_customerbank bank ON supplier.code = bank.code
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="code != null and code !=''">supplier.code=#{code}</if>
|
||||
<if test="name != null and name !='' "> and supplier.name = #{name}</if>
|
||||
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayerid = #{taxpayerid}</if>
|
||||
<if test="def1 != null and def1 !='' "> and bank.def1 = #{def1}</if>
|
||||
<if test="def2 != null and def2 !='' "> and bank.def2 = #{def2}</if>
|
||||
<if test="def3 != null and def3 !='' "> and bank.def3 = #{def3}</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-BipSupplierEntity-result" parameterType="com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity">
|
||||
select
|
||||
<include refid="BipSupplierEntity_Base_Column_List" />
|
||||
FROM bd_cust_supplier supplier
|
||||
left join db_customerbank bank ON supplier.code = bank.code
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="code != null and code !=''"> supplier.code like concat('%',#{code},'%')</if>
|
||||
<if test="name != null and name !='' "> and supplier.name like concat('%',#{name},'%')</if>
|
||||
<if test="taxpayerid != null and taxpayerid !='' "> and supplier.taxpayeridlike concat('%',#{taxpayeridlike},'%')</if>
|
||||
<if test="def1 != null and def1 !='' "> and bank.def1 like concat('%',#{def1},'%')</if>
|
||||
<if test="def2 != null and def2 !='' "> and bank.def2 like concat('%',#{def2},'%')</if>
|
||||
<if test="def3 != null and def3 !='' "> and bank.def3 like concat('%',#{def3},'%')</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.hzya.frame.bip.v3.v2207.service;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
public interface IBipV32207Service extends IBaseService<BipSupplierEntity,String>{
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Description 获取token
|
||||
**/
|
||||
JsonResultEntity thirdInterfaceGetToken(JSONObject jsonObject);
|
||||
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Description 获取供应商
|
||||
**/
|
||||
@DS("oracle91")
|
||||
JsonResultEntity thirdInterfaceGetSupplier(JSONObject jsonObject);
|
||||
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Description 新增供应商
|
||||
**/
|
||||
JsonResultEntity thirdInterfaceSaveSupplier(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 供应商传递OA
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity thirdInterfaceSendOa(JSONObject jsonObject) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取BIP组织数据
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity thirdInterfaceGetOrgs(JSONObject jsonObject);
|
||||
}
|
|
@ -0,0 +1,484 @@
|
|||
package com.hzya.frame.bip.v3.v2207.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.google.gson.Gson;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDetailsDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
|
||||
import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDetailsDao;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity;
|
||||
import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
|
||||
import com.hzya.frame.bip.v3.v2207.service.IBipV32207Service;
|
||||
import com.hzya.frame.dateutil.DateUtil;
|
||||
import com.hzya.frame.seeyon.service.impl.SeeYonInterFaceImpl;
|
||||
import com.hzya.frame.sys.integrationtask.entity.IntegrationTaskEntity;
|
||||
import com.hzya.frame.util.PluginUtils;
|
||||
import com.hzya.frame.util.bipV3.Encryption;
|
||||
import com.hzya.frame.util.bipV3.SHA256Util;
|
||||
import com.hzya.frame.util.oldNcc.CompressUtil;
|
||||
import com.hzya.frame.util.oldNcc.Decryption;
|
||||
import com.hzya.frame.util.oldNcc.ResultMessageUtil;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service(value = "bipV32207Service")
|
||||
public class BipV32207ServiceImpl extends BaseService<BipSupplierEntity, String> implements IBipV32207Service {
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
//定义项目开始同步日期
|
||||
private String ts = "2023-09-30 15:47:08";
|
||||
//组织的同步日期
|
||||
private String orgsts = "2023-09-30 15:47:08";
|
||||
@Autowired
|
||||
private IBipSupplierDao bipSupplierDao;
|
||||
|
||||
@Autowired
|
||||
private IBipSupplierDetailsDao bipSupplierDetailsDao;
|
||||
|
||||
@Autowired
|
||||
private IBipOrgsDao bipOrgsDao;
|
||||
|
||||
@Autowired
|
||||
private IBipOrgsDetailsDao bipOrgsDetailsDao;
|
||||
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Description 获取token
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity thirdInterfaceGetToken(JSONObject object) {
|
||||
JSONObject jsonObject = getstrObj("jsonStr", object);
|
||||
String client_id = jsonObject.getString("client_id");
|
||||
String pubKey = jsonObject.getString("pubKey");
|
||||
String client_secret = jsonObject.getString("client_secret");
|
||||
String username = jsonObject.getString("username");
|
||||
String pwd = jsonObject.getString("pwd");
|
||||
String busi_center = jsonObject.getString("busi_center");
|
||||
String dsname = jsonObject.getString("dsname");
|
||||
String baseUrl = jsonObject.getString("baseUrl");
|
||||
Map<String, String> paramMap = new HashMap<String, String>();
|
||||
// 密码模式认证
|
||||
paramMap.put("grant_type", "password");
|
||||
// 第三方应用id
|
||||
paramMap.put("client_id", client_id);
|
||||
// 第三方应用secret 公钥加密
|
||||
try {
|
||||
paramMap.put("client_secret", URLEncoder.encode(Encryption.pubEncrypt(pubKey, client_secret), "utf-8"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// ncc用户名
|
||||
paramMap.put("username", username);
|
||||
// 密码 公钥加密
|
||||
try {
|
||||
paramMap.put("password", URLEncoder.encode(Encryption.pubEncrypt(pubKey, pwd), "utf-8"));
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity("获取token失败");
|
||||
}
|
||||
// 账套编码
|
||||
paramMap.put("biz_center", busi_center);
|
||||
// 签名
|
||||
String sign = SHA256Util.getSHA256(client_id + client_secret + username + pwd + pubKey, pubKey);
|
||||
paramMap.put("signature", sign);
|
||||
paramMap.put("dsname", dsname);
|
||||
String url = baseUrl + "/nccloud/opm/accesstoken";
|
||||
String mediaType = "application/x-www-form-urlencoded";
|
||||
String token = null;
|
||||
try {
|
||||
token = doPostHutool(url, paramMap, mediaType, null, "", "token");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity("获取token失败");
|
||||
}
|
||||
if (JSONUtil.isTypeJSON(token)) {
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(token);
|
||||
return BaseResult.getSuccessMessageEntity("获取token成功", jsonObject1);
|
||||
} else {
|
||||
return BaseResult.getSuccessMessageEntity("获取token成功", token);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送post请求
|
||||
*
|
||||
* @param baseUrl
|
||||
* @param paramMap
|
||||
* @param mediaType
|
||||
* @param headers
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
private String doPostHutool(String baseUrl, Map<String, String> paramMap, String mediaType, Map<String, String> headers, String json, String type) {
|
||||
String result = null;
|
||||
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(baseUrl);
|
||||
if (paramMap != null) {
|
||||
sb.append("?");
|
||||
for (Map.Entry<String, String> entry : paramMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
sb.append(key + "=" + value).append("&");
|
||||
}
|
||||
}
|
||||
if ("bill".equals(type)) {
|
||||
sb.append("?");
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
sb.append(key + "=" + value).append("&");
|
||||
}
|
||||
}
|
||||
baseUrl = sb.toString().substring(0, sb.toString().length() - 1);
|
||||
HttpRequest re = HttpRequest.post(baseUrl);
|
||||
re.addHeaders(headers);
|
||||
result = re.body(json)
|
||||
.timeout(2000000)//超时,毫秒
|
||||
.execute().body();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key
|
||||
* @param object
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
* @Author lvleigang
|
||||
* @Description 获取对象转换成jsonobj
|
||||
* @Date 11:51 下午 2023/7/10
|
||||
**/
|
||||
public JSONObject getstrObj(String key, JSONObject object) {
|
||||
if (checkStr(object.getString(key))) {
|
||||
return object.getJSONObject(key);
|
||||
}
|
||||
return new JSONObject();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param str
|
||||
* @return void
|
||||
* @Author lvleigang
|
||||
* @Description 校验字符串
|
||||
* @Date 11:41 上午 2022/12/7
|
||||
**/
|
||||
protected Boolean checkStr(String str) {
|
||||
Boolean flag = true;
|
||||
if (str == null || "".equals(str)) {
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Description 获取供应商
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity thirdInterfaceGetSupplier(JSONObject jsonObject) {
|
||||
BipSupplierEntity bipSupplierEntity = getData("jsonStr", jsonObject, BipSupplierEntity.class);
|
||||
//设置查询区间
|
||||
bipSupplierEntity.setTs(ts);
|
||||
logger.info("查询供应商数据,当前TS:"+ts);
|
||||
List<BipSupplierEntity> bipSupplierEntities = bipSupplierDao.thirdInterfaceGetSupplier(bipSupplierEntity);
|
||||
//更新TS时间
|
||||
ts = DateUtil.dateToString(new Date(),"yyyy-MM-dd HH:mm:ss");
|
||||
logger.info("TS已更新:"+ts);
|
||||
//System.out.println("查询供应商明细");
|
||||
logger.info("查询供应商明细"+JSON.toJSONString(bipSupplierEntities));
|
||||
List<JSONObject> jsonObjectList=new ArrayList<>();
|
||||
//[{"code":"SL20231101727","dataSourceCode":"master","name":"无锡恒君安管理咨询有限公司","taxpayerid":"91320205MAD2HAQN6Q","tripartiteId":"0001A31000000002M3TS","ts":"2023-11-16 14:05:10"}]
|
||||
|
||||
List<BipSupplierDetailsEntity> bipSupplierDetails = null;
|
||||
for (BipSupplierEntity supplierEntity : bipSupplierEntities) {
|
||||
List<JSONObject> list=new ArrayList<>();
|
||||
JSONObject jsonObjectResult=new JSONObject();
|
||||
jsonObjectResult.put("code",supplierEntity.getCode());
|
||||
jsonObjectResult.put("name",supplierEntity.getName());
|
||||
jsonObjectResult.put("taxpayerid",supplierEntity.getTaxpayerid());
|
||||
jsonObjectResult.put("def1",supplierEntity.getDef1());
|
||||
jsonObjectResult.put("def2",supplierEntity.getDef2());
|
||||
jsonObjectResult.put("def3",supplierEntity.getDef3());
|
||||
jsonObjectResult.put("tripartiteId",supplierEntity.getTripartiteId());
|
||||
//根据供应商编码和名称查询明细
|
||||
String code = supplierEntity.getCode();
|
||||
String name = supplierEntity.getName();
|
||||
//System.out.println("根据供应处名称,编码获取明细数据:code:"+code +"name:"+name);
|
||||
logger.info("根据供应处名称,编码获取明细数据:code:"+code +"name:"+name);
|
||||
BipSupplierDetailsEntity bipSupplierDetailsEntity = new BipSupplierDetailsEntity();
|
||||
bipSupplierDetailsEntity.setCode(code);
|
||||
bipSupplierDetailsEntity.setName(name);
|
||||
logger.info("根据供应商编码,名称查询银行档案 {}",JSON.toJSONString(bipSupplierDetailsEntity));
|
||||
List<BipSupplierDetailsEntity> bipSupplierDetailsEntities = queryBipSupplierDetails(bipSupplierDetailsEntity) ;
|
||||
// /bipSupplierDetails.stream().filter(that-> code.equalsIgnoreCase(that.getCode() ) && name.equalsIgnoreCase(that.getName() ) ).collect(Collectors.toList());
|
||||
logger.info("根据供应处名称,编码获取明细数据 bipSupplierDetailsEntities值:{}",JSON.toJSONString(bipSupplierDetailsEntities));
|
||||
if (bipSupplierDetailsEntities.size()>0 && null!=bipSupplierDetailsEntities){
|
||||
bipSupplierDetailsEntities.get(0).setIsdefault("-8073674727882144390");
|
||||
for (BipSupplierDetailsEntity supplierDetailsEntity : bipSupplierDetailsEntities) {
|
||||
JSONObject jsonObjectDetails=new JSONObject();
|
||||
jsonObjectDetails.put("splitbank",supplierDetailsEntity.getSplitbank());
|
||||
jsonObjectDetails.put("bankaccno",supplierDetailsEntity.getBankaccno());
|
||||
jsonObjectDetails.put("combinno",supplierDetailsEntity.getCombinno());
|
||||
jsonObjectDetails.put("isdefault",supplierDetailsEntity.getIsdefault());
|
||||
list.add(jsonObjectDetails);
|
||||
}
|
||||
}
|
||||
jsonObjectResult.put("details",list);
|
||||
jsonObjectList.add(jsonObjectResult);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("查询成功",jsonObjectList);
|
||||
}
|
||||
@DS("oracle91")
|
||||
private List<BipSupplierDetailsEntity> queryBipSupplierDetails(BipSupplierDetailsEntity bipSupplierDetailsEntity){
|
||||
// BipSupplierDetailsEntity bipSupplierDetailsEntity=new BipSupplierDetailsEntity();
|
||||
// bipSupplierDetailsEntity.setCode(supplierEntity.getCode());
|
||||
// bipSupplierDetailsEntity.setName(supplierEntity.getName());
|
||||
|
||||
List<BipSupplierDetailsEntity> bipSupplierDetailsEntities = bipSupplierDetailsDao.thirdInterfaceGetSupplierDetails(bipSupplierDetailsEntity);
|
||||
return bipSupplierDetailsEntities;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取BIP组织数据
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity thirdInterfaceGetOrgs(JSONObject jsonObject) {
|
||||
BipOrgsEntity bipOrgsEntity = getData("jsonStr", jsonObject, BipOrgsEntity.class);
|
||||
//设置查询区间
|
||||
bipOrgsEntity.setOrgsts(orgsts);
|
||||
logger.info("查询组织数据,当前TS:" + orgsts);
|
||||
List<BipOrgsEntity> bipOrgsEntities = bipOrgsDao.thirdInterfaceGetOrgs(bipOrgsEntity);
|
||||
//更新TS时间
|
||||
orgsts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
logger.info("组织TS已更新:" + orgsts);
|
||||
logger.info("查询组织明细" + JSON.toJSONString(bipOrgsEntities));
|
||||
List<JSONObject> jsonObjectList = new ArrayList<>();
|
||||
if (null != bipOrgsEntities && bipOrgsEntities.size() > 0) {
|
||||
for (BipOrgsEntity orgsEntity : bipOrgsEntities) {
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
JSONObject jsonObjectResult = new JSONObject();
|
||||
jsonObjectResult.put("code", orgsEntity.getCode());//单位编码
|
||||
jsonObjectResult.put("name", orgsEntity.getName());//单位名称
|
||||
jsonObjectResult.put("tripartiteId", orgsEntity.getTripartiteId());//BIPID
|
||||
//根据组织主键查询明细
|
||||
String tripartiteId = orgsEntity.getTripartiteId();
|
||||
//System.out.println("根据供应处名称,编码获取明细数据:code:"+code +"name:"+name);
|
||||
logger.info("根据组织主键获取明细数据:pk_financeorg:{}", tripartiteId);
|
||||
BipOrgsDetailsEntity bipOrgsDetailsEntity = new BipOrgsDetailsEntity();
|
||||
bipOrgsDetailsEntity.setControlorg(tripartiteId);
|
||||
List<BipOrgsDetailsEntity> bipOrgsDetailsEntities = queryBipOrgsDetails(bipOrgsDetailsEntity);
|
||||
if (bipOrgsDetailsEntities.size() > 0 && null != bipOrgsDetailsEntities) {
|
||||
for (BipOrgsDetailsEntity orgsDetailsEntity : bipOrgsDetailsEntities) {
|
||||
JSONObject jsonObjectDetails = new JSONObject();
|
||||
jsonObjectDetails.put("bankCode", orgsDetailsEntity.getBankCode());//开户行编码
|
||||
jsonObjectDetails.put("bankName", orgsDetailsEntity.getBankName());//开户行名称
|
||||
jsonObjectDetails.put("accnum", orgsDetailsEntity.getAccnum());//账户
|
||||
jsonObjectDetails.put("cnapsCode", orgsDetailsEntity.getCnapsCode());//联行号
|
||||
list.add(jsonObjectDetails);
|
||||
}
|
||||
}
|
||||
jsonObjectResult.put("details", list);
|
||||
jsonObjectList.add(jsonObjectResult);
|
||||
}
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("查询成功", jsonObjectList);
|
||||
}
|
||||
private List<BipOrgsDetailsEntity> queryBipOrgsDetails(BipOrgsDetailsEntity bipOrgsDetailsEntity){
|
||||
List<BipOrgsDetailsEntity> bipOrgsDetailsEntities = bipOrgsDetailsDao.thirdInterfaceGetOrgsDetails(bipOrgsDetailsEntity);
|
||||
return bipOrgsDetailsEntities;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Description 新增供应商
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity thirdInterfaceSaveSupplier(JSONObject object) {
|
||||
JSONObject jsonObject = getstrObj("jsonStr", object);
|
||||
//认证access_token
|
||||
String access_token = jsonObject.getString("access_token");
|
||||
//认证security_key
|
||||
String security_key = jsonObject.getString("security_key");
|
||||
//服务器ip:port
|
||||
String baseUrl = jsonObject.getString("baseUrl");
|
||||
//api方法
|
||||
String apiUrl = jsonObject.getString("apiUrl");
|
||||
//发送的数据
|
||||
String sendData =jsonObject.getString("sendData");
|
||||
//对应于在第三方应用注册当中的app_id
|
||||
String client_id = jsonObject.getString("client_id");
|
||||
//公钥
|
||||
String pubKey = jsonObject.getString("pubKey");
|
||||
//接口调用业务标识
|
||||
String busi_id = jsonObject.getString("busi_id");
|
||||
//重复调用检查
|
||||
String repeat_check = jsonObject.getString("repeat_check");
|
||||
//返回值压缩加密级别
|
||||
String secret_level = jsonObject.getString("secret_level") == null ? "L0": jsonObject.getString("secret_level") ;
|
||||
try {
|
||||
String returnStr = sendApi(access_token, security_key, baseUrl,apiUrl,sendData,client_id,pubKey,busi_id,repeat_check,secret_level);
|
||||
if(JSONUtil.isTypeJSON(returnStr)){
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(returnStr);
|
||||
return BaseResult.getSuccessMessageEntity("发送数据成功",jsonObject1);
|
||||
}else {
|
||||
return BaseResult.getSuccessMessageEntity("发送数据成功",returnStr);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity("发送数据错误");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 供应商传递OA
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity thirdInterfaceSendOa(JSONObject jsonObject) throws Exception {
|
||||
JSONObject jsonObjectStr = getstrObj("jsonStr", jsonObject);
|
||||
PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(jsonObjectStr.getString("plug_id"));
|
||||
String s = pluginBaseEntity.executeBusiness(jsonObjectStr);
|
||||
return BaseResult.getSuccessMessageEntity("传递成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param access_token 认证access_token
|
||||
* @param security_key 认证security_key
|
||||
* @param baseUrl 服务器ip:port
|
||||
* @param apiUrl api方法
|
||||
* @param putParameter 发送的数据
|
||||
* @param client_id 对应于在第三方应用注册当中的app_id
|
||||
* @param pubKey 公钥
|
||||
* @param busi_id 接口调用业务标识
|
||||
* @param repeat_check 重复调用检查
|
||||
* @param secret_level 返回值压缩加密级别
|
||||
* @return java.lang.String
|
||||
* @Author lvleigang
|
||||
* @Description 发起api接口
|
||||
* @Date 9:52 上午 2023/8/22
|
||||
**/
|
||||
private String sendApi(String access_token, String security_key, String baseUrl, String apiUrl, String putParameter, String client_id, String pubKey, String busi_id, String repeat_check, String secret_level) throws Exception{
|
||||
// header 参数
|
||||
Map<String, String> headermap = new HashMap<>();
|
||||
headermap.put("access_token", access_token);
|
||||
headermap.put("client_id", client_id);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(client_id);
|
||||
if (StringUtils.isNotBlank(putParameter)) {
|
||||
sb.append(putParameter);
|
||||
}
|
||||
sb.append(pubKey);
|
||||
String sign = SHA256Util.getSHA256(sb.toString(), pubKey);
|
||||
headermap.put("signature", sign);
|
||||
if (StringUtils.isNotBlank(busi_id)) {
|
||||
headermap.put("busi_id", busi_id);
|
||||
}
|
||||
if (StringUtils.isNotBlank(repeat_check)) {
|
||||
headermap.put("repeat_check", repeat_check);
|
||||
}
|
||||
String mediaType = "application/json;charset=utf-8";
|
||||
// 表体数据json
|
||||
// 根据安全级别选择加密或压缩请求表体参数
|
||||
String json = dealRequestBody(putParameter, security_key, secret_level);
|
||||
// 返回值
|
||||
String sendUrl = baseUrl + apiUrl;
|
||||
String result = doPostHutool(sendUrl, null, mediaType, headermap, json, "bill");
|
||||
String changeData = dealResponseBody(result, security_key, secret_level);
|
||||
return changeData;
|
||||
}
|
||||
|
||||
// 返回值进行过加密和压缩,对返回值进行解压和解密
|
||||
private static String dealResponseBody(String source, String security_key, String level) throws Exception {
|
||||
String result = null;
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(level) || SecretConst.LEVEL0.equals(level)) {
|
||||
result = source;
|
||||
} else if (SecretConst.LEVEL1.equals(level)) {
|
||||
result = Decryption.symDecrypt(security_key, source);
|
||||
} else if (SecretConst.LEVEL2.equals(level)) {
|
||||
result = CompressUtil.gzipDecompress(source);
|
||||
} else if (SecretConst.LEVEL3.equals(level)) {
|
||||
result = CompressUtil.gzipDecompress(Decryption.symDecrypt(security_key, source));
|
||||
} else if (SecretConst.LEVEL4.equals(level)) {
|
||||
result = Decryption.symDecrypt(security_key, CompressUtil.gzipDecompress(source));
|
||||
} else {
|
||||
throw new Exception("无效的安全等级");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 根据安全级别设置,表体是否加密或压缩
|
||||
private static String dealRequestBody(String source, String security_key, String level) throws Exception {
|
||||
String result = null;
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(level) || SecretConst.LEVEL0.equals(level)) {
|
||||
result = source;
|
||||
} else if (SecretConst.LEVEL1.equals(level)) {
|
||||
result = Encryption.symEncrypt(security_key, source);
|
||||
} else if (SecretConst.LEVEL2.equals(level)) {
|
||||
result = CompressUtil.gzipCompress(source);
|
||||
} else if (SecretConst.LEVEL3.equals(level)) {
|
||||
result = Encryption.symEncrypt(security_key, CompressUtil.gzipCompress(source));
|
||||
} else if (SecretConst.LEVEL4.equals(level)) {
|
||||
result = CompressUtil.gzipCompress(Encryption.symEncrypt(security_key, source));
|
||||
} else {
|
||||
throw new Exception("无效的安全等级");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
class SecretConst {
|
||||
/**
|
||||
* LEVEL0 不压缩、不加密
|
||||
*/
|
||||
public static final String LEVEL0 = "L0";
|
||||
/**
|
||||
* LEVEL1 只加密、不压缩
|
||||
*/
|
||||
public static final String LEVEL1 = "L1";
|
||||
/**
|
||||
* LEVEL2 只压缩、不加密
|
||||
*/
|
||||
public static final String LEVEL2 = "L2";
|
||||
/**
|
||||
* LEVEL3 先压缩、后加密
|
||||
*/
|
||||
public static final String LEVEL3 = "L3";
|
||||
/**
|
||||
* LEVEL4 先加密、后压缩
|
||||
*/
|
||||
public static final String LEVEL4 = "L4";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.hzya.frame.dd;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/***
|
||||
* 对接钉钉相关功能接口实现类,用于内部应用调用,返回指定格式数据
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-29 9:38
|
||||
* @param
|
||||
* @return
|
||||
**/
|
||||
|
||||
public interface IDDInterfaceService {
|
||||
|
||||
/***
|
||||
* 推送钉钉方法
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-29 9:46
|
||||
* @param
|
||||
* @return void
|
||||
**/
|
||||
String senddd(JSONObject requestJson);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,174 @@
|
|||
package com.hzya.frame.dd.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.hzya.frame.dd.IDDInterfaceService;
|
||||
import com.hzya.frame.seeyon.dao.ISeeYonDao;
|
||||
import com.hzya.frame.seeyon.entity.SeeyonEntity;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 👻👻👻👻👻👻👻👻👻👻 gjh
|
||||
* @version 1.0
|
||||
* @content
|
||||
* @date 2023-08-29 9:48
|
||||
*/
|
||||
@Service(value = "ddInterfaceService")
|
||||
public class DdInterfaceServiceImpl implements IDDInterfaceService {
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
//TODO 此处参数暂时使用变量使用!后续应该使用应用参数动态设置
|
||||
|
||||
private final String appSecret = "DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1";
|
||||
private final String appKey = "dingxewtjaserj292ggu";
|
||||
//TODO 此处参数暂时使用变量使用!后续应该使用应用参数动态设置
|
||||
@Autowired
|
||||
private ISeeYonDao seeYonDao;
|
||||
@Override
|
||||
public String senddd(JSONObject requestJson) {
|
||||
JSONObject jsonStrObj = requestJson.getJSONObject("jsonStr");
|
||||
|
||||
if(ObjectUtils.isEmpty(jsonStrObj)){
|
||||
throw new BaseSystemException("请传入jsonStr参数");
|
||||
}
|
||||
String code = jsonStrObj.getString("code");
|
||||
if(StringUtils.isEmpty(code)){
|
||||
throw new BaseSystemException("请传入接口编号参数:code");
|
||||
}
|
||||
String url = getDdUrlByType(code);
|
||||
String accessTokenCode = "0001";
|
||||
//如果请求的是token接口,不需要拼接access_token参数
|
||||
String result = null;
|
||||
//如果是单据接口,需要增加access_token参数,在此处定义变量赋值
|
||||
String access_token = getToken();
|
||||
if(accessTokenCode.equalsIgnoreCase(code)){
|
||||
url+= "?appkey="+appKey+"&appsecret="+appSecret;
|
||||
result = HttpUtil.get(url);
|
||||
JSONObject jsonObject = analysisDDResult(result);
|
||||
access_token = jsonObject.getString("access_token");
|
||||
}else{
|
||||
url+= "?access_token="+access_token;
|
||||
JSONObject data = jsonStrObj.getJSONObject("data");
|
||||
if("0004".equals(code) || "0003".equals(code)|| "0005".equals(code)){
|
||||
logger.info("调用钉钉请求前参数:{}",data.toString());
|
||||
if("0003".equals(code)){
|
||||
String formInstanceId = data.getString("formInstanceId");
|
||||
//如果表单ID不等于空走编辑动作
|
||||
if(StrUtil.isNotEmpty(formInstanceId)){
|
||||
result = HttpRequest.put(url).header("x-acs-dingtalk-access-token",access_token).body(data.toString()).execute().body();
|
||||
}else{
|
||||
result = HttpRequest.post(url).header("x-acs-dingtalk-access-token",access_token).body(data.toString()).execute().body();
|
||||
}
|
||||
}
|
||||
|
||||
logger.info("调用钉钉返回参数:{}",result);
|
||||
}else{
|
||||
result = HttpRequest.post(url).header("access_token",access_token).body(data.toJSONString()).execute().body();
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****
|
||||
* 暂时写个固定获取token方法
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-29 14:52
|
||||
* @param
|
||||
* @return java.lang.String
|
||||
**/
|
||||
private String getToken(){
|
||||
String url = getDdUrlByType("0001");
|
||||
url+= "?appkey="+appKey+"&appsecret="+appSecret;
|
||||
String result = HttpUtil.get(url);
|
||||
JSONObject jsonObject = analysisDDResult(result);
|
||||
String access_token = jsonObject.getString("access_token");
|
||||
return access_token;
|
||||
}
|
||||
/****
|
||||
* 解析钉钉接口返回的数据,转换成json对象
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-29 11:55
|
||||
* @param
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
**/
|
||||
private JSONObject analysisDDResult(String result){
|
||||
//解析result
|
||||
JSONObject jsonObject = JSON.parseObject(result);
|
||||
//定义钉钉返回成功的标记
|
||||
String okCode = "0";
|
||||
//钉钉返回的接口成功标记
|
||||
String errorCode = jsonObject.getString("errcode");
|
||||
//钉钉接口返回的提示信息
|
||||
String errmsg = jsonObject.getString("errmsg");
|
||||
//钉钉Result
|
||||
String ddResult = jsonObject.getString("result");
|
||||
//如果返回值是0,则表示调用成功了
|
||||
if(okCode.equalsIgnoreCase(errorCode)){
|
||||
return jsonObject;
|
||||
}else{
|
||||
throw new BaseSystemException("调用钉钉接口失败!错误代码:"+errorCode+"错误信息:"+errmsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*****
|
||||
* 把所有做过的钉钉接口在此处做备注,通过给外部系统的编号获取
|
||||
* @content:
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-29 9:54
|
||||
* @param
|
||||
* @return java.lang.String
|
||||
**/
|
||||
private String getDdUrlByType(String code){
|
||||
StringBuffer urlBuffer = null;
|
||||
if("0003".equals(code)|| "0004".equals(code)|| "0005".equals(code)){
|
||||
urlBuffer = new StringBuffer("https://api.dingtalk.com");
|
||||
}else{
|
||||
urlBuffer = new StringBuffer("https://oapi.dingtalk.com");
|
||||
}
|
||||
switch (code){
|
||||
case "0001":
|
||||
//获取钉钉tokenURL
|
||||
urlBuffer.append("/gettoken") ;
|
||||
break;
|
||||
//通知审批通过URL
|
||||
case "0002":
|
||||
urlBuffer.append("/topapi/attendance/approve/finish") ;
|
||||
break;
|
||||
//销售合同URL,无流程表单统一Url
|
||||
case "0003":
|
||||
urlBuffer.append("/v1.0/yida/forms/instances") ;
|
||||
break;
|
||||
case "0004":
|
||||
urlBuffer.append("/v1.0/yida/forms/instances/search") ;
|
||||
break;
|
||||
case "0005":
|
||||
urlBuffer.append("/v1.0/yida/forms/instances") ;
|
||||
// urlBuffer.append("/v1.0/yida/processes/instances/start") ;
|
||||
break;
|
||||
default:
|
||||
throw new BaseSystemException("获取钉钉URL错误!请确认URL编号");
|
||||
}
|
||||
return urlBuffer.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DbFiledsDto {
|
||||
|
||||
/**
|
||||
* 1\修改 2、新增
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 中文名
|
||||
*/
|
||||
private String chName;
|
||||
/**
|
||||
* 英文名
|
||||
*/
|
||||
private String enName;
|
||||
/**
|
||||
* 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME
|
||||
*/
|
||||
private String filedType;
|
||||
/**
|
||||
* 长度
|
||||
*/
|
||||
private String filedLength;
|
||||
|
||||
public DbFiledsDto() {
|
||||
}
|
||||
|
||||
public DbFiledsDto(String dataType,String chName, String enName, String filedType, String filedLength) {
|
||||
this.dataType = dataType;
|
||||
this.chName = chName;
|
||||
this.enName = enName;
|
||||
this.filedType = filedType;
|
||||
this.filedLength = filedLength;
|
||||
}
|
||||
|
||||
public String getChName() {
|
||||
return chName;
|
||||
}
|
||||
|
||||
public void setChName(String chName) {
|
||||
this.chName = chName;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getFiledType() {
|
||||
return filedType;
|
||||
}
|
||||
|
||||
public void setFiledType(String filedType) {
|
||||
this.filedType = filedType;
|
||||
}
|
||||
|
||||
public String getFiledLength() {
|
||||
return filedLength;
|
||||
}
|
||||
|
||||
public void setFiledLength(String filedLength) {
|
||||
this.filedLength = filedLength;
|
||||
}
|
||||
|
||||
public String getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(String dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmDataDto {
|
||||
|
||||
private String id;
|
||||
private String tableName;
|
||||
private String documentRule;
|
||||
private Integer documentRuleNum;
|
||||
/**
|
||||
* 类型 1、主表 2、明细
|
||||
*/
|
||||
private String dbType;
|
||||
|
||||
private List<MdmDataFiledDto> mdmDataFiledDtos;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public List<MdmDataFiledDto> getMdmDataFiledDtos() {
|
||||
return mdmDataFiledDtos;
|
||||
}
|
||||
|
||||
public void setMdmDataFiledDtos(List<MdmDataFiledDto> mdmDataFiledDtos) {
|
||||
this.mdmDataFiledDtos = mdmDataFiledDtos;
|
||||
}
|
||||
|
||||
public String getDocumentRule() {
|
||||
return documentRule;
|
||||
}
|
||||
|
||||
public void setDocumentRule(String documentRule) {
|
||||
this.documentRule = documentRule;
|
||||
}
|
||||
|
||||
public Integer getDocumentRuleNum() {
|
||||
return documentRuleNum;
|
||||
}
|
||||
|
||||
public void setDocumentRuleNum(Integer documentRuleNum) {
|
||||
this.documentRuleNum = documentRuleNum;
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmDataFiledDto {
|
||||
|
||||
private String filedsName;
|
||||
private String filedsValue;
|
||||
|
||||
public String getFiledsName() {
|
||||
return filedsName;
|
||||
}
|
||||
|
||||
public void setFiledsName(String filedsName) {
|
||||
this.filedsName = filedsName;
|
||||
}
|
||||
|
||||
public String getFiledsValue() {
|
||||
return filedsValue;
|
||||
}
|
||||
|
||||
public void setFiledsValue(String filedsValue) {
|
||||
this.filedsValue = filedsValue;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmDbFiledVo {
|
||||
private String id;
|
||||
private String name;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public MdmDbFiledVo() {
|
||||
}
|
||||
|
||||
public MdmDbFiledVo(String id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity;
|
||||
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class MdmDbVo {
|
||||
|
||||
//主数据主表
|
||||
private MdmModuleDbEntity mainMdmModuleDb;
|
||||
//主数据子表
|
||||
private List<MdmModuleDbEntity> sublistMdmModuleDb;
|
||||
//控件字段规则属性
|
||||
private List<MdmModuleDbFiledsRuleFilesEntity> moduleDbFiledsRuleFiles;
|
||||
//单据编码规则
|
||||
private List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList;
|
||||
|
||||
|
||||
public List<MdmTableCodeRuleEntity> getMdmTableCodeRuleEntityList() {
|
||||
return mdmTableCodeRuleEntityList;
|
||||
}
|
||||
|
||||
public void setMdmTableCodeRuleEntityList(List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList) {
|
||||
this.mdmTableCodeRuleEntityList = mdmTableCodeRuleEntityList;
|
||||
}
|
||||
|
||||
public List<MdmModuleDbFiledsRuleFilesEntity> getModuleDbFiledsRuleFiles() {
|
||||
return moduleDbFiledsRuleFiles;
|
||||
}
|
||||
|
||||
public void setModuleDbFiledsRuleFiles(List<MdmModuleDbFiledsRuleFilesEntity> moduleDbFiledsRuleFiles) {
|
||||
this.moduleDbFiledsRuleFiles = moduleDbFiledsRuleFiles;
|
||||
}
|
||||
|
||||
public MdmModuleDbEntity getMainMdmModuleDb() {
|
||||
return mainMdmModuleDb;
|
||||
}
|
||||
|
||||
public void setMainMdmModuleDb(MdmModuleDbEntity mainMdmModuleDb) {
|
||||
this.mainMdmModuleDb = mainMdmModuleDb;
|
||||
}
|
||||
|
||||
public List<MdmModuleDbEntity> getSublistMdmModuleDb() {
|
||||
return sublistMdmModuleDb;
|
||||
}
|
||||
|
||||
public void setSublistMdmModuleDb(List<MdmModuleDbEntity> sublistMdmModuleDb) {
|
||||
this.sublistMdmModuleDb = sublistMdmModuleDb;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmDetailViewVo {
|
||||
//模版信息
|
||||
private MdmModuleEntity mdmModuleEntity;
|
||||
//主数据主表
|
||||
private MdmModuleDbEntity mainMdmModuleDb;
|
||||
//主数据子表
|
||||
private List<MdmModuleDbEntity> sublistMdmModuleDb;
|
||||
|
||||
public MdmModuleEntity getMdmModuleEntity() {
|
||||
return mdmModuleEntity;
|
||||
}
|
||||
|
||||
public void setMdmModuleEntity(MdmModuleEntity mdmModuleEntity) {
|
||||
this.mdmModuleEntity = mdmModuleEntity;
|
||||
}
|
||||
|
||||
public MdmModuleDbEntity getMainMdmModuleDb() {
|
||||
return mainMdmModuleDb;
|
||||
}
|
||||
|
||||
public void setMainMdmModuleDb(MdmModuleDbEntity mainMdmModuleDb) {
|
||||
this.mainMdmModuleDb = mainMdmModuleDb;
|
||||
}
|
||||
|
||||
public List<MdmModuleDbEntity> getSublistMdmModuleDb() {
|
||||
return sublistMdmModuleDb;
|
||||
}
|
||||
|
||||
public void setSublistMdmModuleDb(List<MdmModuleDbEntity> sublistMdmModuleDb) {
|
||||
this.sublistMdmModuleDb = sublistMdmModuleDb;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmDistributeDto {
|
||||
|
||||
//id
|
||||
private String id;
|
||||
|
||||
|
||||
private List<MdmModuleDistributeEntity> mdmModuleDistributeEntities;
|
||||
|
||||
public List<MdmModuleDistributeEntity> getMdmModuleDistributeEntities() {
|
||||
return mdmModuleDistributeEntities;
|
||||
}
|
||||
|
||||
public void setMdmModuleDistributeEntities(List<MdmModuleDistributeEntity> mdmModuleDistributeEntities) {
|
||||
this.mdmModuleDistributeEntities = mdmModuleDistributeEntities;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
public class MdmDistributeVo {
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private String formmainId;
|
||||
|
||||
/**
|
||||
* 应用id
|
||||
*/
|
||||
private String appId;
|
||||
/**
|
||||
* 状态 1、发送成功 2、发送中 3、发送失败 4、未发送
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
*描述
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
public String getFormmainId() {
|
||||
return formmainId;
|
||||
}
|
||||
|
||||
public void setFormmainId(String formmainId) {
|
||||
this.formmainId = formmainId;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmDto {
|
||||
|
||||
//id
|
||||
private String id;
|
||||
//3、新增4、修改 5、查看
|
||||
private String showType;
|
||||
//分页
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
/**
|
||||
* 显示字段
|
||||
*/
|
||||
private String viewFiled;
|
||||
/**
|
||||
* 上级id字段
|
||||
*/
|
||||
private String upIdFiled;
|
||||
//主数据名称
|
||||
private String mdmName;
|
||||
//主数据编码
|
||||
private Integer mdmCode;
|
||||
//主数据类型
|
||||
private String mdmType;
|
||||
//描述
|
||||
private String remark;
|
||||
//描述
|
||||
private String[] ids;
|
||||
//单据编码规则
|
||||
private List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList;
|
||||
//主数据主表
|
||||
private MdmModuleDbEntity mainMdmModuleDb;
|
||||
//主数据子表
|
||||
private List<MdmModuleDbEntity> sublistMdmModuleDb;
|
||||
|
||||
private String tableName;
|
||||
private String value;
|
||||
|
||||
private String label;
|
||||
private String lableValue;
|
||||
|
||||
private String upId;
|
||||
|
||||
|
||||
public String getLableValue() {
|
||||
return lableValue;
|
||||
}
|
||||
|
||||
public void setLableValue(String lableValue) {
|
||||
this.lableValue = lableValue;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public MdmModuleDbEntity getMainMdmModuleDb() {
|
||||
return mainMdmModuleDb;
|
||||
}
|
||||
|
||||
public void setMainMdmModuleDb(MdmModuleDbEntity mainMdmModuleDb) {
|
||||
this.mainMdmModuleDb = mainMdmModuleDb;
|
||||
}
|
||||
|
||||
public List<MdmModuleDbEntity> getSublistMdmModuleDb() {
|
||||
return sublistMdmModuleDb;
|
||||
}
|
||||
|
||||
public void setSublistMdmModuleDb(List<MdmModuleDbEntity> sublistMdmModuleDb) {
|
||||
this.sublistMdmModuleDb = sublistMdmModuleDb;
|
||||
}
|
||||
|
||||
public String getMdmName() {
|
||||
return mdmName;
|
||||
}
|
||||
|
||||
public void setMdmName(String mdmName) {
|
||||
this.mdmName = mdmName;
|
||||
}
|
||||
|
||||
public Integer getMdmCode() {
|
||||
return mdmCode;
|
||||
}
|
||||
|
||||
public void setMdmCode(Integer mdmCode) {
|
||||
this.mdmCode = mdmCode;
|
||||
}
|
||||
|
||||
public String getMdmType() {
|
||||
return mdmType;
|
||||
}
|
||||
|
||||
public void setMdmType(String mdmType) {
|
||||
this.mdmType = mdmType;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getShowType() {
|
||||
return showType;
|
||||
}
|
||||
|
||||
public void setShowType(String showType) {
|
||||
this.showType = showType;
|
||||
}
|
||||
|
||||
public List<MdmTableCodeRuleEntity> getMdmTableCodeRuleEntityList() {
|
||||
return mdmTableCodeRuleEntityList;
|
||||
}
|
||||
|
||||
public void setMdmTableCodeRuleEntityList(List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList) {
|
||||
this.mdmTableCodeRuleEntityList = mdmTableCodeRuleEntityList;
|
||||
}
|
||||
|
||||
public String getViewFiled() {
|
||||
return viewFiled;
|
||||
}
|
||||
|
||||
public void setViewFiled(String viewFiled) {
|
||||
this.viewFiled = viewFiled;
|
||||
}
|
||||
|
||||
public String getUpIdFiled() {
|
||||
return upIdFiled;
|
||||
}
|
||||
|
||||
public void setUpIdFiled(String upIdFiled) {
|
||||
this.upIdFiled = upIdFiled;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getUpId() {
|
||||
return upId;
|
||||
}
|
||||
|
||||
public void setUpId(String upId) {
|
||||
this.upId = upId;
|
||||
}
|
||||
|
||||
public String[] getIds() {
|
||||
return ids;
|
||||
}
|
||||
|
||||
public void setIds(String[] ids) {
|
||||
this.ids = ids;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmModuleViewDto {
|
||||
|
||||
//id
|
||||
private String id;
|
||||
//模版
|
||||
private MdmModuleViewEntity mdmModuleViewEntity;
|
||||
//新增
|
||||
private List<MdmDbFiledVo> addFiled;
|
||||
//修改
|
||||
private List<MdmDbFiledVo> editFiled;
|
||||
//查看
|
||||
private List<MdmDbFiledVo> showFiled;
|
||||
//查询
|
||||
private List<MdmDbFiledVo> queryFiled;
|
||||
//列表
|
||||
private List<MdmDbFiledVo> listFiled;
|
||||
|
||||
public MdmModuleViewEntity getMdmModuleViewEntity() {
|
||||
return mdmModuleViewEntity;
|
||||
}
|
||||
|
||||
public void setMdmModuleViewEntity(MdmModuleViewEntity mdmModuleViewEntity) {
|
||||
this.mdmModuleViewEntity = mdmModuleViewEntity;
|
||||
}
|
||||
|
||||
public List<MdmDbFiledVo> getAddFiled() {
|
||||
return addFiled;
|
||||
}
|
||||
|
||||
public void setAddFiled(List<MdmDbFiledVo> addFiled) {
|
||||
this.addFiled = addFiled;
|
||||
}
|
||||
|
||||
public List<MdmDbFiledVo> getEditFiled() {
|
||||
return editFiled;
|
||||
}
|
||||
|
||||
public void setEditFiled(List<MdmDbFiledVo> editFiled) {
|
||||
this.editFiled = editFiled;
|
||||
}
|
||||
|
||||
public List<MdmDbFiledVo> getShowFiled() {
|
||||
return showFiled;
|
||||
}
|
||||
|
||||
public void setShowFiled(List<MdmDbFiledVo> showFiled) {
|
||||
this.showFiled = showFiled;
|
||||
}
|
||||
|
||||
public List<MdmDbFiledVo> getQueryFiled() {
|
||||
return queryFiled;
|
||||
}
|
||||
|
||||
public void setQueryFiled(List<MdmDbFiledVo> queryFiled) {
|
||||
this.queryFiled = queryFiled;
|
||||
}
|
||||
|
||||
public List<MdmDbFiledVo> getListFiled() {
|
||||
return listFiled;
|
||||
}
|
||||
|
||||
public void setListFiled(List<MdmDbFiledVo> listFiled) {
|
||||
this.listFiled = listFiled;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmModuleViewVo {
|
||||
|
||||
|
||||
//模版
|
||||
private MdmModuleViewEntity mdmModuleViewEntity;
|
||||
//新增
|
||||
private List<MdmDbFiledVo> addFiled;
|
||||
//修改
|
||||
private List<MdmDbFiledVo> editFiled;
|
||||
//查看
|
||||
private List<MdmDbFiledVo> showFiled;
|
||||
//查询
|
||||
private List<MdmDbFiledVo> queryFiled;
|
||||
//列表
|
||||
private List<MdmDbFiledVo> listFiled;
|
||||
|
||||
//新增
|
||||
private List<MdmModuleViewDetailEntity> dbAddFiled;
|
||||
//修改
|
||||
private List<MdmModuleViewDetailEntity> dbEditFiled;
|
||||
//查看
|
||||
private List<MdmModuleViewDetailEntity> dbShowFiled;
|
||||
//查询
|
||||
private List<MdmModuleViewDetailEntity> dbQueryFiled;
|
||||
//列表
|
||||
private List<MdmModuleViewDetailEntity> dbListFiled;
|
||||
|
||||
public List<MdmDbFiledVo> getAddFiled() {
|
||||
return addFiled;
|
||||
}
|
||||
|
||||
public void setAddFiled(List<MdmDbFiledVo> addFiled) {
|
||||
this.addFiled = addFiled;
|
||||
}
|
||||
|
||||
public List<MdmDbFiledVo> getEditFiled() {
|
||||
return editFiled;
|
||||
}
|
||||
|
||||
public void setEditFiled(List<MdmDbFiledVo> editFiled) {
|
||||
this.editFiled = editFiled;
|
||||
}
|
||||
|
||||
public List<MdmDbFiledVo> getShowFiled() {
|
||||
return showFiled;
|
||||
}
|
||||
|
||||
public void setShowFiled(List<MdmDbFiledVo> showFiled) {
|
||||
this.showFiled = showFiled;
|
||||
}
|
||||
|
||||
public List<MdmDbFiledVo> getQueryFiled() {
|
||||
return queryFiled;
|
||||
}
|
||||
|
||||
public void setQueryFiled(List<MdmDbFiledVo> queryFiled) {
|
||||
this.queryFiled = queryFiled;
|
||||
}
|
||||
|
||||
public List<MdmDbFiledVo> getListFiled() {
|
||||
return listFiled;
|
||||
}
|
||||
|
||||
public void setListFiled(List<MdmDbFiledVo> listFiled) {
|
||||
this.listFiled = listFiled;
|
||||
}
|
||||
|
||||
public MdmModuleViewEntity getMdmModuleViewEntity() {
|
||||
return mdmModuleViewEntity;
|
||||
}
|
||||
|
||||
public void setMdmModuleViewEntity(MdmModuleViewEntity mdmModuleViewEntity) {
|
||||
this.mdmModuleViewEntity = mdmModuleViewEntity;
|
||||
}
|
||||
|
||||
public List<MdmModuleViewDetailEntity> getDbAddFiled() {
|
||||
return dbAddFiled;
|
||||
}
|
||||
|
||||
public void setDbAddFiled(List<MdmModuleViewDetailEntity> dbAddFiled) {
|
||||
this.dbAddFiled = dbAddFiled;
|
||||
}
|
||||
|
||||
public List<MdmModuleViewDetailEntity> getDbEditFiled() {
|
||||
return dbEditFiled;
|
||||
}
|
||||
|
||||
public void setDbEditFiled(List<MdmModuleViewDetailEntity> dbEditFiled) {
|
||||
this.dbEditFiled = dbEditFiled;
|
||||
}
|
||||
|
||||
public List<MdmModuleViewDetailEntity> getDbShowFiled() {
|
||||
return dbShowFiled;
|
||||
}
|
||||
|
||||
public void setDbShowFiled(List<MdmModuleViewDetailEntity> dbShowFiled) {
|
||||
this.dbShowFiled = dbShowFiled;
|
||||
}
|
||||
|
||||
public List<MdmModuleViewDetailEntity> getDbQueryFiled() {
|
||||
return dbQueryFiled;
|
||||
}
|
||||
|
||||
public void setDbQueryFiled(List<MdmModuleViewDetailEntity> dbQueryFiled) {
|
||||
this.dbQueryFiled = dbQueryFiled;
|
||||
}
|
||||
|
||||
public List<MdmModuleViewDetailEntity> getDbListFiled() {
|
||||
return dbListFiled;
|
||||
}
|
||||
|
||||
public void setDbListFiled(List<MdmModuleViewDetailEntity> dbListFiled) {
|
||||
this.dbListFiled = dbListFiled;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
|
||||
import com.hzya.frame.sys.entity.TemplateKeyValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmQuery {
|
||||
|
||||
//分页
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
//表名
|
||||
private String tableName;
|
||||
//查询条件
|
||||
private List<TemplateKeyValue> queryCondition;
|
||||
//返回字段
|
||||
private List<String> returnField;
|
||||
//明细表查询条件
|
||||
private List<MdmQuery> detailQueryCondition;
|
||||
|
||||
public Integer getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public List<TemplateKeyValue> getQueryCondition() {
|
||||
return queryCondition;
|
||||
}
|
||||
|
||||
public void setQueryCondition(List<TemplateKeyValue> queryCondition) {
|
||||
this.queryCondition = queryCondition;
|
||||
}
|
||||
|
||||
public List<String> getReturnField() {
|
||||
return returnField;
|
||||
}
|
||||
|
||||
public void setReturnField(List<String> returnField) {
|
||||
this.returnField = returnField;
|
||||
}
|
||||
|
||||
public List<MdmQuery> getDetailQueryCondition() {
|
||||
return detailQueryCondition;
|
||||
}
|
||||
|
||||
public void setDetailQueryCondition(List<MdmQuery> detailQueryCondition) {
|
||||
this.detailQueryCondition = detailQueryCondition;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmRoleDto {
|
||||
|
||||
//id
|
||||
private String id;
|
||||
|
||||
|
||||
private List<MdmModuleRoleEntity> mdmModuleRoleEntities;
|
||||
|
||||
public List<MdmModuleRoleEntity> getMdmModuleRoleEntities() {
|
||||
return mdmModuleRoleEntities;
|
||||
}
|
||||
|
||||
public void setMdmModuleRoleEntities(List<MdmModuleRoleEntity> mdmModuleRoleEntities) {
|
||||
this.mdmModuleRoleEntities = mdmModuleRoleEntities;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
public class MdmViewButtonVo {
|
||||
|
||||
//按钮类型
|
||||
private String buttonType;
|
||||
//按钮名
|
||||
private String buttonName;
|
||||
|
||||
public String getButtonType() {
|
||||
return buttonType;
|
||||
}
|
||||
|
||||
public void setButtonType(String buttonType) {
|
||||
this.buttonType = buttonType;
|
||||
}
|
||||
|
||||
public String getButtonName() {
|
||||
return buttonName;
|
||||
}
|
||||
|
||||
public void setButtonName(String buttonName) {
|
||||
this.buttonName = buttonName;
|
||||
}
|
||||
|
||||
public MdmViewButtonVo() {
|
||||
}
|
||||
|
||||
public MdmViewButtonVo(String buttonType, String buttonName) {
|
||||
this.buttonType = buttonType;
|
||||
this.buttonName = buttonName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MdmViewFiledVo {
|
||||
|
||||
//字段id
|
||||
private String id;
|
||||
//表名
|
||||
private String dbName;
|
||||
//类型 1、主表 2、明细
|
||||
private String dbType;
|
||||
//主数据模版ID
|
||||
private String mdmId;
|
||||
//模版数据库id
|
||||
private String dbId;
|
||||
//中文名
|
||||
private String chName;
|
||||
//英文名
|
||||
private String enName;
|
||||
//排序
|
||||
private Integer sorts;
|
||||
/**
|
||||
* 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME
|
||||
*/
|
||||
private String filedType;
|
||||
//字段规则
|
||||
private List<MdmModuleDbFiledsRuleEntity> ruleList;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDbName() {
|
||||
return dbName;
|
||||
}
|
||||
|
||||
public void setDbName(String dbName) {
|
||||
this.dbName = dbName;
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
|
||||
public String getDbId() {
|
||||
return dbId;
|
||||
}
|
||||
|
||||
public void setDbId(String dbId) {
|
||||
this.dbId = dbId;
|
||||
}
|
||||
|
||||
public String getChName() {
|
||||
return chName;
|
||||
}
|
||||
|
||||
public void setChName(String chName) {
|
||||
this.chName = chName;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public List<MdmModuleDbFiledsRuleEntity> getRuleList() {
|
||||
return ruleList;
|
||||
}
|
||||
|
||||
public void setRuleList(List<MdmModuleDbFiledsRuleEntity> ruleList) {
|
||||
this.ruleList = ruleList;
|
||||
}
|
||||
|
||||
public Integer getSorts() {
|
||||
return sorts;
|
||||
}
|
||||
|
||||
public void setSorts(Integer sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
public String getFiledType() {
|
||||
return filedType;
|
||||
}
|
||||
|
||||
public void setFiledType(String filedType) {
|
||||
this.filedType = filedType;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class MdmViewVo {
|
||||
|
||||
private String id;
|
||||
//模版信息
|
||||
private MdmModuleEntity mdmModuleEntity;
|
||||
//模版展示信息
|
||||
private MdmModuleViewEntity mdmModuleViewEntity;
|
||||
//查询条件
|
||||
private List<MdmViewFiledVo> queryList;
|
||||
//列表
|
||||
private List<MdmViewFiledVo> listList;
|
||||
//按钮
|
||||
private List<MdmViewButtonVo> buttonList;
|
||||
|
||||
public List<MdmViewFiledVo> getQueryList() {
|
||||
return queryList;
|
||||
}
|
||||
|
||||
public void setQueryList(List<MdmViewFiledVo> queryList) {
|
||||
this.queryList = queryList;
|
||||
}
|
||||
|
||||
public List<MdmViewFiledVo> getListList() {
|
||||
return listList;
|
||||
}
|
||||
|
||||
public void setListList(List<MdmViewFiledVo> listList) {
|
||||
this.listList = listList;
|
||||
}
|
||||
|
||||
public List<MdmViewButtonVo> getButtonList() {
|
||||
return buttonList;
|
||||
}
|
||||
|
||||
public void setButtonList(List<MdmViewButtonVo> buttonList) {
|
||||
this.buttonList = buttonList;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public MdmModuleEntity getMdmModuleEntity() {
|
||||
return mdmModuleEntity;
|
||||
}
|
||||
|
||||
public void setMdmModuleEntity(MdmModuleEntity mdmModuleEntity) {
|
||||
this.mdmModuleEntity = mdmModuleEntity;
|
||||
}
|
||||
|
||||
public MdmModuleViewEntity getMdmModuleViewEntity() {
|
||||
return mdmModuleViewEntity;
|
||||
}
|
||||
|
||||
public void setMdmModuleViewEntity(MdmModuleViewEntity mdmModuleViewEntity) {
|
||||
this.mdmModuleViewEntity = mdmModuleViewEntity;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
package com.hzya.frame.mdm.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class MdmVo {
|
||||
|
||||
//id
|
||||
private String id;
|
||||
//主数据名称
|
||||
private String mdmName;
|
||||
//主数据编码
|
||||
private String mdmCode;
|
||||
//主数据类型 1、档案 2、单据
|
||||
private String mdmType;
|
||||
//主数据类型 1、档案 2、单据
|
||||
private String mdmTypeName;
|
||||
//描述
|
||||
private String remark;
|
||||
|
||||
/** logo(地址或者id) */
|
||||
private String mdmLogo;
|
||||
private String createUserId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
private String modifyUserId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMdmName() {
|
||||
return mdmName;
|
||||
}
|
||||
|
||||
public void setMdmName(String mdmName) {
|
||||
this.mdmName = mdmName;
|
||||
}
|
||||
|
||||
public String getMdmCode() {
|
||||
return mdmCode;
|
||||
}
|
||||
|
||||
public void setMdmCode(String mdmCode) {
|
||||
this.mdmCode = mdmCode;
|
||||
}
|
||||
|
||||
public String getMdmType() {
|
||||
return mdmType;
|
||||
}
|
||||
|
||||
public void setMdmType(String mdmType) {
|
||||
this.mdmType = mdmType;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getMdmTypeName() {
|
||||
return mdmTypeName;
|
||||
}
|
||||
|
||||
public void setMdmTypeName(String mdmTypeName) {
|
||||
this.mdmTypeName = mdmTypeName;
|
||||
}
|
||||
|
||||
public String getCreateUserId() {
|
||||
return createUserId;
|
||||
}
|
||||
|
||||
public void setCreateUserId(String createUserId) {
|
||||
this.createUserId = createUserId;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getModifyUserId() {
|
||||
return modifyUserId;
|
||||
}
|
||||
|
||||
public void setModifyUserId(String modifyUserId) {
|
||||
this.modifyUserId = modifyUserId;
|
||||
}
|
||||
|
||||
public Date getModifyTime() {
|
||||
return modifyTime;
|
||||
}
|
||||
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
public String getMdmLogo() {
|
||||
return mdmLogo;
|
||||
}
|
||||
|
||||
public void setMdmLogo(String mdmLogo) {
|
||||
this.mdmLogo = mdmLogo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.hzya.frame.mdm.mdmModule.dao;
|
||||
|
||||
import com.hzya.frame.mdm.entity.MdmDataDto;
|
||||
import com.hzya.frame.mdm.entity.MdmDto;
|
||||
import com.hzya.frame.mdm.entity.MdmQuery;
|
||||
import com.hzya.frame.mdm.entity.MdmVo;
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.entity.FormmainDeleteDto;
|
||||
import com.hzya.frame.sys.entity.ModuleDto;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 主数据模版(mdm_module: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:25:41
|
||||
*/
|
||||
public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
|
||||
|
||||
List<MdmVo> queryMdm(MdmDto entity);
|
||||
|
||||
Integer checkTable(Map<String, String> maps);
|
||||
|
||||
Integer createTable(Map<String, Object> maps);
|
||||
Integer createTableDistribute(Map<String, Object> maps);
|
||||
Integer alterTable(Map<String, Object> maps);
|
||||
Integer alterTableName(Map<String, String> maps);
|
||||
|
||||
List<HashMap<String, Object>> queryMdmShowData(MdmQuery entity);
|
||||
|
||||
Integer checkData(Map<String, String> map);
|
||||
|
||||
Integer updateForm(MdmDataDto mdmDataDto);
|
||||
Integer saveForm(MdmDataDto mdmDataDto);
|
||||
|
||||
Integer deleteTemplateById(FormmainDeleteDto formmainDeleteDto);
|
||||
|
||||
List<HashMap<String, Object>> queryDataAll(MdmDto entity);
|
||||
|
||||
List<HashMap<String, Object>> queryTemplateData(ModuleDto entity);
|
||||
|
||||
HashMap<String, Object> queryTemplateDataOne(MdmDto entity);
|
||||
|
||||
List<HashMap<String, Object>> queryTemplateDataMore(MdmDto entity);
|
||||
List<HashMap<String, Object>> querySelectData(MdmDto entity);
|
||||
|
||||
Integer deleteChilder(FormmainDeleteDto formmainDeleteDto);
|
||||
}
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
package com.hzya.frame.mdm.mdmModule.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.entity.MdmDataDto;
|
||||
import com.hzya.frame.mdm.entity.MdmDto;
|
||||
import com.hzya.frame.mdm.entity.MdmQuery;
|
||||
import com.hzya.frame.mdm.entity.MdmVo;
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
||||
import com.hzya.frame.sys.application.api.entity.SysApplicationApiDto;
|
||||
import com.hzya.frame.sys.application.api.entity.SysApplicationApiVo;
|
||||
import com.hzya.frame.sys.entity.FormmainDeleteDto;
|
||||
import com.hzya.frame.sys.entity.FormmainDto;
|
||||
import com.hzya.frame.sys.entity.ModuleDto;
|
||||
import com.hzya.frame.sys.entity.TemplateQuery;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 主数据模版(MdmModule)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:25:42
|
||||
*/
|
||||
@Repository(value = "MdmModuleDaoImpl")
|
||||
public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String> implements IMdmModuleDao {
|
||||
|
||||
@Override
|
||||
public List<MdmVo> queryMdm(MdmDto entity) {
|
||||
List<MdmVo> o = (List<MdmVo>) super.selectList(getSqlIdPrifx() + "queryMdm", entity);
|
||||
return o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer checkTable(Map<String, String> maps) {
|
||||
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkTable", maps);
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer createTable(Map<String, Object> maps) {
|
||||
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTable", maps);
|
||||
return o;
|
||||
}
|
||||
@Override
|
||||
public Integer createTableDistribute(Map<String, Object> maps) {
|
||||
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTableDistribute", maps);
|
||||
return o;
|
||||
}
|
||||
@Override
|
||||
public Integer alterTable(Map<String, Object> maps) {
|
||||
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTable", maps);
|
||||
return o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer alterTableName(Map<String, String> maps) {
|
||||
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTableName", maps);
|
||||
return o;
|
||||
|
||||
}
|
||||
@Override
|
||||
public Integer checkData(Map<String, String> maps) {
|
||||
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkData", maps);
|
||||
return o;
|
||||
|
||||
}
|
||||
@Override
|
||||
public List<HashMap<String, Object>> querySelectData(MdmDto entity) {
|
||||
List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "querySelectData", entity);
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> queryTemplateDataMore(MdmDto entity) {
|
||||
List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "queryTemplateDataMore", entity);
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> queryMdmShowData(MdmQuery entity) {
|
||||
List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "queryMdmShowData", entity);
|
||||
return o;
|
||||
}
|
||||
@Override
|
||||
public List<HashMap<String, Object>> queryDataAll(MdmDto entity) {
|
||||
List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "queryDataAll", entity);
|
||||
return o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> queryTemplateData(ModuleDto entity) {
|
||||
List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "queryTemplateData", entity);
|
||||
return o;
|
||||
|
||||
}
|
||||
@Override
|
||||
public Integer updateForm(MdmDataDto mdmDataDto) {
|
||||
Integer o = super.update(getSqlIdPrifx() + "updateForm", mdmDataDto);
|
||||
return o;
|
||||
|
||||
}
|
||||
@Override
|
||||
public Integer saveForm(MdmDataDto mdmDataDto) {
|
||||
Integer o = super.update(getSqlIdPrifx() + "saveForm", mdmDataDto);
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteTemplateById(FormmainDeleteDto entity) {
|
||||
Integer o = super.delete(getSqlIdPrifx() + "deleteTemplateById", entity);
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer deleteChilder(FormmainDeleteDto entity) {
|
||||
Integer o = super.delete(getSqlIdPrifx() + "deleteChilder", entity);
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, Object> queryTemplateDataOne(MdmDto entity) {
|
||||
HashMap<String, Object> o = (HashMap<String, Object>) super.selectOne(getSqlIdPrifx() + "queryTemplateDataOne", entity);
|
||||
return o;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.hzya.frame.mdm.mdmModule.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 主数据模版(MdmModule)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:25:42
|
||||
*/
|
||||
public class MdmModuleEntity extends BaseEntity {
|
||||
|
||||
|
||||
/** logo(地址或者id) */
|
||||
private String mdmLogo;
|
||||
/**
|
||||
* 主数据名称
|
||||
*/
|
||||
private String mdmName;
|
||||
/**
|
||||
* 主数据编码
|
||||
*/
|
||||
private Integer mdmCode;
|
||||
/**
|
||||
* 主数据类型 1、档案 2、单据
|
||||
*/
|
||||
private String mdmType;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
public String getMdmName() {
|
||||
return mdmName;
|
||||
}
|
||||
|
||||
public void setMdmName(String mdmName) {
|
||||
this.mdmName = mdmName;
|
||||
}
|
||||
|
||||
public Integer getMdmCode() {
|
||||
return mdmCode;
|
||||
}
|
||||
|
||||
public void setMdmCode(Integer mdmCode) {
|
||||
this.mdmCode = mdmCode;
|
||||
}
|
||||
|
||||
public String getMdmType() {
|
||||
return mdmType;
|
||||
}
|
||||
|
||||
public void setMdmType(String mdmType) {
|
||||
this.mdmType = mdmType;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getMdmLogo() {
|
||||
return mdmLogo;
|
||||
}
|
||||
|
||||
public void setMdmLogo(String mdmLogo) {
|
||||
this.mdmLogo = mdmLogo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,699 @@
|
|||
<?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.mdm.mdmModule.dao.impl.MdmModuleDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleEntity-result" type="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmName" column="mdm_name" jdbcType="VARCHAR"/>
|
||||
<result property="mdmLogo" column="mdm_logo" jdbcType="VARCHAR"/>
|
||||
<result property="mdmCode" column="mdm_code" jdbcType="INTEGER"/>
|
||||
<result property="mdmType" column="mdm_type" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" 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"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="MdmModuleEntity_Base_Column_List">
|
||||
id
|
||||
,mdm_name
|
||||
,mdm_logo
|
||||
,mdm_code
|
||||
,mdm_type
|
||||
,remark
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-MdmModuleEntity-result">
|
||||
select
|
||||
<include refid="MdmModuleEntity_Base_Column_List" />
|
||||
from mdm_module where sts = 'Y' and id = #{id}
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
|
||||
select
|
||||
<include refid="MdmModuleEntity_Base_Column_List"/>
|
||||
from mdm_module
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmName != null and mdmName != ''">and mdm_name = #{mdmName}</if>
|
||||
<if test="mdmLogo != null and mdmLogo != ''">and mdm_logo = #{mdmLogo}</if>
|
||||
<if test="mdmCode != null ">and mdm_code = #{mdmCode}</if>
|
||||
<if test="mdmType != null and mdmType != ''">and mdm_type = #{mdmType}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</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>
|
||||
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.mdm.mdmModule.entity.MdmModuleEntity">
|
||||
select count(1) from mdm_module
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmName != null and mdmName != ''">and mdm_name = #{mdmName}</if>
|
||||
<if test="mdmLogo != null and mdmLogo != ''">and mdm_logo = #{mdmLogo}</if>
|
||||
<if test="mdmCode != null ">and mdm_code = #{mdmCode}</if>
|
||||
<if test="mdmType != null and mdmType != ''">and mdm_type = #{mdmType}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</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>
|
||||
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-MdmModuleEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
|
||||
select
|
||||
<include refid="MdmModuleEntity_Base_Column_List"/>
|
||||
from mdm_module
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="mdmName != null and mdmName != ''">and mdm_name like concat('%',#{mdmName},'%')</if>
|
||||
<if test="mdmLogo != null and mdmLogo != ''">and mdm_logo like concat('%',#{mdmLogo},'%')</if>
|
||||
<if test="mdmCode != null ">and mdm_code like concat('%',#{mdmCode},'%')</if>
|
||||
<if test="mdmType != null and mdmType != ''">and mdm_type like concat('%',#{mdmType},'%')</if>
|
||||
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</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>
|
||||
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="MdmModuleentity_list_or" resultMap="get-MdmModuleEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
|
||||
select
|
||||
<include refid="MdmModuleEntity_Base_Column_List"/>
|
||||
from mdm_module
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="mdmName != null and mdmName != ''">or mdm_name = #{mdmName}</if>
|
||||
<if test="mdmLogo != null and mdmLogo != ''">or mdm_logo = #{mdmLogo}</if>
|
||||
<if test="mdmCode != null ">or mdm_code = #{mdmCode}</if>
|
||||
<if test="mdmType != null and mdmType != ''">or mdm_type = #{mdmType}</if>
|
||||
<if test="remark != null and remark != ''">or remark = #{remark}</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>
|
||||
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.mdm.mdmModule.entity.MdmModuleEntity" keyProperty="id"
|
||||
useGeneratedKeys="true">
|
||||
insert into mdm_module(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="mdmName != null and mdmName != ''">mdm_name ,</if>
|
||||
<if test="mdmLogo != null and mdmLogo != ''">mdm_logo ,</if>
|
||||
<if test="mdmCode != null ">mdm_code ,</if>
|
||||
<if test="mdmCode == null ">mdm_code ,</if>
|
||||
<if test="mdmType != null and mdmType != ''">mdm_type ,</if>
|
||||
<if test="remark != null and remark != ''">remark ,</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="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="mdmName != null and mdmName != ''">#{mdmName} ,</if>
|
||||
<if test="mdmLogo != null and mdmLogo != ''">#{mdmLogo} ,</if>
|
||||
<if test="mdmCode != null ">#{mdmCode} ,</if>
|
||||
<if test="mdmCode == null ">(SELECT IFNULL(MAX(b.mdm_code)+1,10001) AS mdmCode FROM mdm_module b ),</if>
|
||||
<if test="mdmType != null and mdmType != ''">#{mdmType} ,</if>
|
||||
<if test="remark != null and remark != ''">#{remark} ,</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="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module(mdm_name,mdm_logo, mdm_code, mdm_type, remark, sorts, create_user_id, create_time, modify_user_id,
|
||||
modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, sorts, create_user_id, create_time, modify_user_id,
|
||||
modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
mdm_name = values(mdm_name),
|
||||
mdm_logo = values(mdm_logo),
|
||||
mdm_code = values(mdm_code),
|
||||
mdm_type = values(mdm_type),
|
||||
remark = values(remark),
|
||||
sorts = values(sorts),
|
||||
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)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
|
||||
update mdm_module set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmName != null and mdmName != ''">mdm_name = #{mdmName},</if>
|
||||
<if test="mdmLogo != null and mdmLogo != ''">mdm_logo = #{mdmLogo},</if>
|
||||
<if test="mdmCode != null ">mdm_code = #{mdmCode},</if>
|
||||
<if test="mdmType != null and mdmType != ''">mdm_type = #{mdmType},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
|
||||
update mdm_module 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.mdm.mdmModule.entity.MdmModuleEntity">
|
||||
update mdm_module 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="mdmName != null and mdmName != ''">and mdm_name = #{mdmName}</if>
|
||||
<if test="mdmLogo != null and mdmLogo != ''">and mdm_logo = #{mdmLogo}</if>
|
||||
<if test="mdmCode != null ">and mdm_code = #{mdmCode}</if>
|
||||
<if test="mdmType != null and mdmType != ''">and mdm_type = #{mdmType}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryMdm" resultType="com.hzya.frame.mdm.entity.MdmVo" parameterType="com.hzya.frame.mdm.entity.MdmDto">
|
||||
select
|
||||
a.id as id,
|
||||
a.mdm_name as mdmName,
|
||||
a.mdm_logo as mdmLogo,
|
||||
a.mdm_code as mdmCode,
|
||||
a.mdm_type as mdmType,
|
||||
sd.column_content as mdmTypeName,
|
||||
a.remark as remark,
|
||||
a.create_time as createTime,
|
||||
a.modify_time as modifyTime,
|
||||
c.view_name as createUserId,
|
||||
m.view_name as modifyUserId
|
||||
from
|
||||
mdm_module a
|
||||
LEFT JOIN sys_dictionaryshop_new sd on sd.column_value = a.mdm_type and sd.tab_name = 'mdm' and sd.column_name = 'mdm_type' and sd.used_sts = '1'
|
||||
LEFT JOIN sys_user c on c.id = a.create_user_id and c.sts = 'Y'
|
||||
LEFT JOIN sys_user m on m.id = a.modify_user_id and m.sts = 'Y'
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and a.id like concat('%',#{id},'%')</if>
|
||||
<if test="mdmName != null and mdmName != ''">and a.mdm_name like concat('%',#{mdmName},'%')</if>
|
||||
<if test="mdmCode != null ">and a.mdm_code like concat('%',#{mdmCode},'%')</if>
|
||||
<if test="mdmType != null and mdmType != ''">and a.mdm_type = #{mdmType}</if>
|
||||
<if test="remark != null and remark != ''">and a.remark like concat('%',#{remark},'%')</if>
|
||||
and a.sts='Y'
|
||||
</trim>
|
||||
order by a.sorts asc
|
||||
</select>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="checkTable" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
information_schema.TABLES
|
||||
WHERE
|
||||
TABLE_SCHEMA = 'businesscenter'
|
||||
and TABLE_NAME = #{tableName}
|
||||
</select>
|
||||
|
||||
<select id="createTable" resultType="java.lang.Integer">
|
||||
CREATE TABLE ${tableName} (
|
||||
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
|
||||
<if test="dbType == '1'.toString()">
|
||||
`document_rule` varchar(50) DEFAULT NULL COMMENT '单据规则',
|
||||
`document_rule_num` bigint(50) DEFAULT NULL COMMENT '单据规则流水号',
|
||||
</if>
|
||||
<foreach collection="databaseFields" item="item" index="index">
|
||||
<choose>
|
||||
<when test="item.filedType == '1'.toString()">
|
||||
${item.enName} bigint(${item.filedLength}) DEFAULT NULL COMMENT #{item.chName},
|
||||
</when>
|
||||
<when test="item.filedType == '2'.toString()">
|
||||
${item.enName} decimal(${item.filedLength}) DEFAULT NULL COMMENT #{item.chName},
|
||||
</when>
|
||||
<when test="item.filedType == '3'.toString()">
|
||||
${item.enName} varchar(${item.filedLength}) DEFAULT NULL COMMENT #{item.chName},
|
||||
</when>
|
||||
<when test="item.filedType == '4'.toString()">
|
||||
${item.enName} datetime DEFAULT NULL COMMENT #{item.chName},
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
`sorts` bigint(20) DEFAULT NULL COMMENT '排序',
|
||||
`create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
|
||||
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`sts` char(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
|
||||
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = INNODB DEFAULT CHARSET = utf8 COMMENT = #{tableRemark}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="createTableDistribute" resultType="java.lang.Integer">
|
||||
CREATE TABLE ${tableName} (
|
||||
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
|
||||
`formmain_id` varchar(50) DEFAULT NULL COMMENT '数据id',
|
||||
`app_id` varchar(50) DEFAULT NULL COMMENT '应用id',
|
||||
`status` varchar(50) DEFAULT NULL COMMENT '状态',
|
||||
`msg` varchar(50) DEFAULT NULL COMMENT '描述',
|
||||
`sorts` bigint(20) DEFAULT NULL COMMENT '排序',
|
||||
`create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
|
||||
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`sts` char(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
|
||||
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = INNODB DEFAULT CHARSET = utf8 COMMENT = #{tableRemark}
|
||||
</select>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="alterTable" resultType="java.lang.Integer">
|
||||
ALTER TABLE ${tableName}
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<foreach collection="databaseFields" item="item" index="index">
|
||||
<choose>
|
||||
<when test="item.filedType == '3'.toString()">
|
||||
<choose>
|
||||
<when test="item.dataType == '1'.toString()">
|
||||
MODIFY COLUMN ${item.enName} varchar(${item.filedLength}) DEFAULT NULL
|
||||
COMMENT #{item.chName},
|
||||
</when>
|
||||
<otherwise>
|
||||
add COLUMN ${item.enName} varchar(${item.filedLength}) DEFAULT NULL COMMENT
|
||||
#{item.chName},
|
||||
</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
<when test="item.filedType == '1'.toString()">
|
||||
<choose>
|
||||
<when test="item.dataType == '1'.toString()">
|
||||
MODIFY COLUMN ${item.enName} bigint(${item.filedLength}) DEFAULT NULL COMMENT
|
||||
#{item.chName},
|
||||
</when>
|
||||
<otherwise>
|
||||
add COLUMN ${item.enName} bigint(${item.filedLength}) DEFAULT NULL COMMENT
|
||||
#{item.chName},
|
||||
</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
<when test="item.filedType == '2'.toString()">
|
||||
<choose>
|
||||
<when test="item.dataType == '1'.toString()">
|
||||
MODIFY COLUMN ${item.enName} decimal(${item.filedLength}) DEFAULT NULL COMMENT
|
||||
#{item.chName},
|
||||
</when>
|
||||
<otherwise>
|
||||
add COLUMN ${item.enName} decimal(${item.filedLength}) DEFAULT NULL COMMENT
|
||||
#{item.chName},
|
||||
</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
<when test="item.filedType == '4'.toString()">
|
||||
<choose>
|
||||
<when test="item.dataType == '1'.toString()">
|
||||
MODIFY COLUMN ${item.enName} datetime DEFAULT NULL COMMENT #{item.chName},
|
||||
</when>
|
||||
<otherwise>
|
||||
add COLUMN ${item.enName} datetime DEFAULT NULL COMMENT #{item.chName},
|
||||
</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="alterTableName" resultType="java.lang.Integer">
|
||||
ALTER TABLE ${tableName} COMMENT = #{tableRemark}
|
||||
</select>
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="checkData" resultType="Integer" >
|
||||
SELECT
|
||||
count(*)
|
||||
from
|
||||
${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="filedName != null and filedName !='' and filedValue != null and filedValue !='' ">
|
||||
and ${filedName} = #{filedValue}
|
||||
</if>
|
||||
|
||||
<if test="id != null and id !='' ">and id != #{id}</if>
|
||||
and sts = 'Y'
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryMdmShowData" resultType="java.util.HashMap"
|
||||
parameterType="com.hzya.frame.mdm.entity.MdmQuery">
|
||||
select
|
||||
<if test="returnField != null and returnField.size>0">
|
||||
(SELECT count(*) from ${tableName}_distribute WHERE sts = 'Y' and status = '1' and formmain_id = a.id) as qwqwasdasdzxasda,
|
||||
<trim suffixOverrides=",">
|
||||
<foreach collection="returnField" item="returnField">
|
||||
a.${returnField} as ${returnField} ,
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<if test="returnField == null or returnField.size == 0">
|
||||
(SELECT count(*) from ${tableName}_distribute WHERE sts = 'Y' and status = '1' and formmain_id = a.id) as qwqwasdasdzxasda,
|
||||
a.*
|
||||
</if>
|
||||
from ${tableName} a
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="queryCondition != null and queryCondition.size>0">
|
||||
<foreach collection="queryCondition" item="item" index="index">
|
||||
${item.getValueByType('a.')}
|
||||
</foreach>
|
||||
</if>
|
||||
and a.sts='Y'
|
||||
<if test="detailQueryCondition != null and detailQueryCondition.size>0">
|
||||
<foreach collection="detailQueryCondition" item="item" index="index">
|
||||
AND a.id IN (
|
||||
SELECT
|
||||
formmain_id
|
||||
FROM
|
||||
${item.tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
sts = 'Y'
|
||||
<if test="item.queryCondition != null and item.queryCondition.size>0">
|
||||
<foreach collection="item.queryCondition" item="itema" index="index">
|
||||
${itema.getValueByType('')}
|
||||
</foreach>
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
</foreach>
|
||||
</if>
|
||||
</trim>
|
||||
order by a.sorts asc
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="saveForm" parameterType="com.hzya.frame.mdm.entity.MdmDataDto">
|
||||
insert into ${tableName}(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmDataFiledDtos != null and mdmDataFiledDtos.size>0">
|
||||
<foreach collection="mdmDataFiledDtos" item="item" index="index">
|
||||
<if test="item.filedsName != 'logid'.toString() ">
|
||||
${item.filedsName},
|
||||
</if>
|
||||
<if test="item.filedsName == 'logid'.toString() ">
|
||||
create_user_id,
|
||||
modify_user_id,
|
||||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
sorts,
|
||||
create_time,
|
||||
modify_time,
|
||||
sts,
|
||||
<if test="dbType == '1'.toString()">
|
||||
document_rule,
|
||||
document_rule_num,
|
||||
</if>
|
||||
</trim>
|
||||
)values
|
||||
(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmDataFiledDtos != null and mdmDataFiledDtos.size>0">
|
||||
<foreach collection="mdmDataFiledDtos" item="item" index="index">
|
||||
<if test="item.filedsName != 'logid'.toString() ">
|
||||
#{item.filedsValue},
|
||||
</if>
|
||||
<if test="item.filedsName == 'logid'.toString() ">
|
||||
#{item.filedsValue},
|
||||
#{item.filedsValue},
|
||||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from ${tableName} a WHERE
|
||||
a.sts = 'Y' ),
|
||||
now(),
|
||||
now(),
|
||||
'Y',
|
||||
<if test="dbType == '1'.toString()">
|
||||
( concat(#{documentRule},
|
||||
(SELECT
|
||||
IF
|
||||
(
|
||||
LENGTH( (SELECT
|
||||
IFNULL(MAX(b.document_rule_num),0)+1
|
||||
FROM
|
||||
${tableName} b
|
||||
WHERE
|
||||
DATE_FORMAT( b.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) ) <= ${documentRuleNum},
|
||||
LPAD( (SELECT
|
||||
IFNULL(MAX(c.document_rule_num),0)+1
|
||||
FROM
|
||||
${tableName} c
|
||||
WHERE
|
||||
DATE_FORMAT( c.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )), ${documentRuleNum}, '0' ),
|
||||
(SELECT
|
||||
IFNULL(MAX(d.document_rule_num),0)+1
|
||||
FROM
|
||||
${tableName} d
|
||||
WHERE
|
||||
DATE_FORMAT( d.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' ))
|
||||
)
|
||||
)
|
||||
)),
|
||||
(SELECT
|
||||
IF
|
||||
(
|
||||
LENGTH( (SELECT
|
||||
IFNULL(MAX(e.document_rule_num),0)+1
|
||||
FROM
|
||||
${tableName} e
|
||||
WHERE
|
||||
DATE_FORMAT( e.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) ) <= ${documentRuleNum},
|
||||
LPAD( (SELECT
|
||||
IFNULL(MAX(f.document_rule_num),0)+1
|
||||
FROM
|
||||
${tableName} f
|
||||
WHERE
|
||||
DATE_FORMAT( f.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )), ${documentRuleNum}, '0' ),
|
||||
(SELECT
|
||||
IFNULL(MAX(g.document_rule_num),0)+1
|
||||
FROM
|
||||
${tableName} g
|
||||
WHERE
|
||||
DATE_FORMAT( g.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' ))
|
||||
)
|
||||
)
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<update id="updateForm" parameterType="com.hzya.frame.mdm.entity.MdmDataDto">
|
||||
update ${tableName} set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmDataFiledDtos != null and mdmDataFiledDtos.size>0">
|
||||
<foreach collection="mdmDataFiledDtos" item="item" index="index">
|
||||
<if test="item.filedsName != 'logid'.toString() ">
|
||||
${item.filedsName} = #{item.filedsValue},
|
||||
</if>
|
||||
<if test="item.filedsName == 'logid'.toString() ">
|
||||
modify_user_id = #{item.filedsValue},
|
||||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
modify_time = now(),
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteTemplateById" parameterType="com.hzya.frame.sys.entity.FormmainDeleteDto">
|
||||
update ${tableName} set
|
||||
sts='N',modify_time = now(),modify_user_id = #{loginId}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id !='' ">and id = #{id}</if>
|
||||
<if test="formmain_id != null and formmain_id !='' ">and formmain_id = #{formmain_id}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteChilder" parameterType="com.hzya.frame.sys.entity.FormmainDeleteDto">
|
||||
update ${tableName} set
|
||||
sts='N',modify_time = now(),modify_user_id = #{loginId}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="upIdFiled != null and upIdFiled !='' and upIdFiledValue != null and upIdFiledValue !=''">
|
||||
and ${upIdFiled} like concat(#{upIdFiledValue},'%')
|
||||
</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryDataAll" resultType="java.util.HashMap"
|
||||
parameterType="com.hzya.frame.mdm.entity.MdmDto">
|
||||
select
|
||||
id as qsdfg,
|
||||
${label},
|
||||
${upId}
|
||||
from ${tableName}
|
||||
where sts = 'Y'
|
||||
order by sorts asc
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryTemplateData" resultType="java.util.HashMap" parameterType="com.hzya.frame.sys.entity.ModuleDto">
|
||||
select
|
||||
${value},
|
||||
${label}
|
||||
from ${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id !='' ">and ${value} = #{id}</if>
|
||||
<if test="lableValue != null and lableValue !='' ">and ${label} like concat('%',#{lableValue},'%')</if>
|
||||
and sts = 'Y'
|
||||
</trim>
|
||||
order by sorts asc
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryTemplateDataOne" resultType="java.util.HashMap"
|
||||
parameterType="com.hzya.frame.mdm.entity.MdmDto">
|
||||
select
|
||||
${value} as id,
|
||||
${label} as label,
|
||||
${upId} as upID
|
||||
from ${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id !='' ">and id = #{id}</if>
|
||||
and sts = 'Y'
|
||||
</trim>
|
||||
order by sorts asc
|
||||
</select>
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryTemplateDataMore" resultType="java.util.HashMap"
|
||||
parameterType="com.hzya.frame.mdm.entity.MdmDto">
|
||||
select
|
||||
${value} as id,
|
||||
${label} as label,
|
||||
${upId} as upID
|
||||
from ${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="ids != null and ids.length >0">
|
||||
and id in (
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<foreach collection="ids" item="item" index="index">
|
||||
#{item},
|
||||
</foreach>
|
||||
</trim>
|
||||
)
|
||||
</if>
|
||||
and sts = 'Y'
|
||||
</trim>
|
||||
order by sorts asc
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="querySelectData" resultType="java.util.HashMap" parameterType="com.hzya.frame.mdm.entity.MdmDto">
|
||||
select
|
||||
${value},
|
||||
${label}
|
||||
from ${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id !='' ">and ${value} = #{id}</if>
|
||||
<if test="lableValue != null and lableValue !='' ">and ${label} like concat('%',#{lableValue},'%')</if>
|
||||
and sts = 'Y'
|
||||
and ${label} is not null
|
||||
</trim>
|
||||
order by sorts asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.mdm.mdmModule.service;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 主数据模版(MdmModule)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:25:44
|
||||
*/
|
||||
public interface IMdmModuleService extends IBaseService<MdmModuleEntity, String> {
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.mdm.mdmModule.service.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
||||
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 主数据模版(MdmModule)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:25:44
|
||||
*/
|
||||
@Service(value = "mdmModuleService")
|
||||
public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> implements IMdmModuleService {
|
||||
|
||||
private IMdmModuleDao mdmModuleDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmModuleDao(IMdmModuleDao dao) {
|
||||
this.mdmModuleDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDb.dao;
|
||||
|
||||
import com.hzya.frame.mdm.entity.MdmDistributeVo;
|
||||
import com.hzya.frame.mdm.entity.MdmDto;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.sys.entity.ModuleDto;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 模版数据库表(mdm_module_db: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:26:49
|
||||
*/
|
||||
public interface IMdmModuleDbDao extends IBaseDao<MdmModuleDbEntity, String> {
|
||||
|
||||
HashMap<String, Object> getServiceDataById(Map<String, Object> queryData);
|
||||
|
||||
List<HashMap<String, Object>> getServiceByFormmainId(Map<String, Object> queryData);
|
||||
List<HashMap<String, Object>> getServiceByDistributeId(Map<String, Object> queryData);
|
||||
List<MdmDistributeVo> getServiceByDistributeIdNoCase(Map<String, Object> queryData);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDb.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.entity.MdmDistributeVo;
|
||||
import com.hzya.frame.mdm.entity.MdmDto;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
|
||||
import com.hzya.frame.sys.entity.ModuleDto;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 模版数据库表(MdmModuleDb)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:26:49
|
||||
*/
|
||||
@Repository(value = "MdmModuleDbDaoImpl")
|
||||
public class MdmModuleDbDaoImpl extends MybatisGenericDao<MdmModuleDbEntity, String> implements IMdmModuleDbDao {
|
||||
|
||||
@Override
|
||||
public HashMap<String, Object> getServiceDataById(Map<String, Object> maps) {
|
||||
HashMap<String, Object> o = (HashMap<String, Object>) super.selectOne(getSqlIdPrifx() + "getServiceDataById", maps);
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getServiceByFormmainId(Map<String, Object> maps) {
|
||||
List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "getServiceByFormmainId", maps);
|
||||
return o;
|
||||
|
||||
}
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getServiceByDistributeId(Map<String, Object> maps) {
|
||||
List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "getServiceByDistributeId", maps);
|
||||
return o;
|
||||
|
||||
}
|
||||
@Override
|
||||
public List<MdmDistributeVo> getServiceByDistributeIdNoCase(Map<String, Object> maps) {
|
||||
List<MdmDistributeVo> o = (List<MdmDistributeVo>) super.selectList(getSqlIdPrifx() + "getServiceByDistributeIdNoCase", maps);
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDb.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 模版数据库表(MdmModuleDb)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:26:49
|
||||
*/
|
||||
public class MdmModuleDbEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主数据模版ID
|
||||
*/
|
||||
private String mdmId;
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String dbName;
|
||||
/**
|
||||
* 类型 1、主表 2、明细
|
||||
*/
|
||||
private String dbType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
//主数据子表字段
|
||||
private List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds;
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
|
||||
public String getDbName() {
|
||||
return dbName;
|
||||
}
|
||||
|
||||
public void setDbName(String dbName) {
|
||||
this.dbName = dbName;
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public List<MdmModuleDbFiledsEntity> getSublistMdmModuleDbFileds() {
|
||||
return sublistMdmModuleDbFileds;
|
||||
}
|
||||
|
||||
public void setSublistMdmModuleDbFileds(List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds) {
|
||||
this.sublistMdmModuleDbFileds = sublistMdmModuleDbFileds;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,326 @@
|
|||
<?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.mdm.mdmModuleDb.dao.impl.MdmModuleDbDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleDbEntity-result" type="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="dbName" column="db_name" jdbcType="VARCHAR"/>
|
||||
<result property="dbType" column="db_type" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" 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"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="MdmModuleDbEntity_Base_Column_List">
|
||||
id
|
||||
,mdm_id
|
||||
,db_name
|
||||
,db_type
|
||||
,remark
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleDbEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbEntity_Base_Column_List"/>
|
||||
from mdm_module_db
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
|
||||
<if test="dbType != null and dbType != ''">and db_type = #{dbType}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</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>
|
||||
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.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
||||
select count(1) from mdm_module_db
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
|
||||
<if test="dbType != null and dbType != ''">and db_type = #{dbType}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</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>
|
||||
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-MdmModuleDbEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbEntity_Base_Column_List"/>
|
||||
from mdm_module_db
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
|
||||
<if test="dbName != null and dbName != ''">and db_name like concat('%',#{dbName},'%')</if>
|
||||
<if test="dbType != null and dbType != ''">and db_type like concat('%',#{dbType},'%')</if>
|
||||
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</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>
|
||||
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="MdmModuleDbentity_list_or" resultMap="get-MdmModuleDbEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbEntity_Base_Column_List"/>
|
||||
from mdm_module_db
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
|
||||
<if test="dbName != null and dbName != ''">or db_name = #{dbName}</if>
|
||||
<if test="dbType != null and dbType != ''">or db_type = #{dbType}</if>
|
||||
<if test="remark != null and remark != ''">or remark = #{remark}</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>
|
||||
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.mdm.mdmModuleDb.entity.MdmModuleDbEntity" keyProperty="id"
|
||||
useGeneratedKeys="true">
|
||||
insert into mdm_module_db(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
|
||||
<if test="dbName != null and dbName != ''">db_name ,</if>
|
||||
<if test="dbType != null and dbType != ''">db_type ,</if>
|
||||
<if test="remark != null and remark != ''">remark ,</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="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="mdmId != null and mdmId != ''">#{mdmId} ,</if>
|
||||
<if test="dbName != null and dbName != ''">#{dbName} ,</if>
|
||||
<if test="dbType != null and dbType != ''">#{dbType} ,</if>
|
||||
<if test="remark != null and remark != ''">#{remark} ,</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="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db a WHERE a.sts =
|
||||
'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db(mdm_id, db_name, db_type, remark, sorts, create_user_id, create_time, modify_user_id,
|
||||
modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db(mdm_id, db_name, db_type, remark, sorts, create_user_id, create_time, modify_user_id,
|
||||
modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
mdm_id = values(mdm_id),
|
||||
db_name = values(db_name),
|
||||
db_type = values(db_type),
|
||||
remark = values(remark),
|
||||
sorts = values(sorts),
|
||||
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)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
||||
update mdm_module_db set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
||||
<if test="dbName != null and dbName != ''">db_name = #{dbName},</if>
|
||||
<if test="dbType != null and dbType != ''">db_type = #{dbType},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
||||
update mdm_module_db 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.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
||||
update mdm_module_db 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="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
|
||||
<if test="dbType != null and dbType != ''">and db_type = #{dbType}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_db where id = #{id}
|
||||
</delete>
|
||||
<select id="getServiceDataById" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
||||
select
|
||||
*
|
||||
from ${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="detailFlag">
|
||||
and formmain_id = #{id}
|
||||
</if>
|
||||
<if test="!detailFlag">
|
||||
and id = #{id}
|
||||
</if>
|
||||
and sts = 'Y'
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="getServiceByFormmainId" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
||||
select
|
||||
*
|
||||
from ${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="detailFlag">
|
||||
and formmain_id = #{id}
|
||||
</if>
|
||||
<if test="!detailFlag">
|
||||
and id = #{id}
|
||||
</if>
|
||||
and sts = 'Y'
|
||||
</trim>
|
||||
order by sorts asc
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="getServiceByDistributeId" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
||||
select
|
||||
id,
|
||||
formmain_id,
|
||||
app_id,
|
||||
CASE
|
||||
status
|
||||
WHEN '1' THEN '发送成功'
|
||||
WHEN '2' THEN '发送中'
|
||||
WHEN '3' THEN '发送失败'
|
||||
ELSE ''
|
||||
END status,
|
||||
msg,
|
||||
sorts,
|
||||
create_user_id,
|
||||
create_time,
|
||||
modify_user_id,
|
||||
modify_time,
|
||||
sts,
|
||||
org_id
|
||||
from ${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
and formmain_id = #{id}
|
||||
and sts = 'Y'
|
||||
</trim>
|
||||
order by sorts asc
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="getServiceByDistributeIdNoCase" resultType="com.hzya.frame.mdm.entity.MdmDistributeVo" parameterType="java.util.HashMap">
|
||||
select
|
||||
formmain_id as formmainId,
|
||||
app_id as appId,
|
||||
status,
|
||||
msg
|
||||
from ${tableName}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
and formmain_id = #{id}
|
||||
and sts = 'Y'
|
||||
</trim>
|
||||
order by sorts asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDb.service;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 模版数据库表(MdmModuleDb)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:26:51
|
||||
*/
|
||||
public interface IMdmModuleDbService extends IBaseService<MdmModuleDbEntity, String> {
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDb.service.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDb.service.IMdmModuleDbService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 模版数据库表(MdmModuleDb)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:26:51
|
||||
*/
|
||||
@Service(value = "mdmModuleDbService")
|
||||
public class MdmModuleDbServiceImpl extends BaseService<MdmModuleDbEntity, String> implements IMdmModuleDbService {
|
||||
|
||||
private IMdmModuleDbDao mdmModuleDbDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmModuleDbDao(IMdmModuleDbDao dao) {
|
||||
this.mdmModuleDbDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFileds.dao;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 模版数据库字段表(mdm_module_db_fileds: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:28:06
|
||||
*/
|
||||
public interface IMdmModuleDbFiledsDao extends IBaseDao<MdmModuleDbFiledsEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFileds.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* 模版数据库字段表(MdmModuleDbFileds)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:28:07
|
||||
*/
|
||||
@Repository(value = "MdmModuleDbFiledsDaoImpl")
|
||||
public class MdmModuleDbFiledsDaoImpl extends MybatisGenericDao<MdmModuleDbFiledsEntity, String> implements IMdmModuleDbFiledsDao {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFileds.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 模版数据库字段表(MdmModuleDbFileds)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:28:07
|
||||
*/
|
||||
public class MdmModuleDbFiledsEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主数据模版ID
|
||||
*/
|
||||
private String mdmId;
|
||||
/**
|
||||
* 模版数据库id
|
||||
*/
|
||||
private String dbId;
|
||||
/**
|
||||
* 中文名
|
||||
*/
|
||||
private String chName;
|
||||
/**
|
||||
* 英文名
|
||||
*/
|
||||
private String enName;
|
||||
/**
|
||||
* 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME
|
||||
*/
|
||||
private String filedType;
|
||||
/**
|
||||
* 长度
|
||||
*/
|
||||
private String filedLength;
|
||||
/**
|
||||
* roletype
|
||||
*/
|
||||
private String roletype;
|
||||
/**
|
||||
* roletype
|
||||
*/
|
||||
private String roleValue;
|
||||
//字段规则
|
||||
private List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRules;
|
||||
|
||||
public List<MdmModuleDbFiledsRuleEntity> getMdmModuleDbFiledsRules() {
|
||||
return mdmModuleDbFiledsRules;
|
||||
}
|
||||
|
||||
public void setMdmModuleDbFiledsRules(List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRules) {
|
||||
this.mdmModuleDbFiledsRules = mdmModuleDbFiledsRules;
|
||||
}
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
|
||||
public String getDbId() {
|
||||
return dbId;
|
||||
}
|
||||
|
||||
public void setDbId(String dbId) {
|
||||
this.dbId = dbId;
|
||||
}
|
||||
|
||||
public String getChName() {
|
||||
return chName;
|
||||
}
|
||||
|
||||
public void setChName(String chName) {
|
||||
this.chName = chName;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getFiledType() {
|
||||
return filedType;
|
||||
}
|
||||
|
||||
public void setFiledType(String filedType) {
|
||||
this.filedType = filedType;
|
||||
}
|
||||
|
||||
public String getFiledLength() {
|
||||
return filedLength;
|
||||
}
|
||||
|
||||
public void setFiledLength(String filedLength) {
|
||||
this.filedLength = filedLength;
|
||||
}
|
||||
|
||||
public String getRoletype() {
|
||||
return roletype;
|
||||
}
|
||||
|
||||
public void setRoletype(String roletype) {
|
||||
this.roletype = roletype;
|
||||
}
|
||||
|
||||
public String getRoleValue() {
|
||||
return roleValue;
|
||||
}
|
||||
|
||||
public void setRoleValue(String roleValue) {
|
||||
this.roleValue = roleValue;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,284 @@
|
|||
<?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.mdm.mdmModuleDbFileds.dao.impl.MdmModuleDbFiledsDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleDbFiledsEntity-result"
|
||||
type="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
|
||||
<result property="chName" column="ch_name" jdbcType="VARCHAR"/>
|
||||
<result property="enName" column="en_name" jdbcType="VARCHAR"/>
|
||||
<result property="filedType" column="filed_type" jdbcType="VARCHAR"/>
|
||||
<result property="filedLength" column="filed_length" 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"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="MdmModuleDbFiledsEntity_Base_Column_List">
|
||||
id
|
||||
,mdm_id
|
||||
,db_id
|
||||
,ch_name
|
||||
,en_name
|
||||
,filed_type
|
||||
,filed_length
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
|
||||
from mdm_module_db_fileds
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
|
||||
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
|
||||
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
|
||||
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
|
||||
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</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="roletype != null and roletype != ''">
|
||||
and id in (
|
||||
select
|
||||
filed_id
|
||||
from mdm_module_db_fileds_rule
|
||||
where sts='Y' and rule_code = #{roletype} and rule_value = #{roleValue}
|
||||
)
|
||||
</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.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||
select count(1) from mdm_module_db_fileds
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
|
||||
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
|
||||
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
|
||||
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
|
||||
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</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>
|
||||
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-MdmModuleDbFiledsEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
|
||||
from mdm_module_db_fileds
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
|
||||
<if test="dbId != null and dbId != ''">and db_id like concat('%',#{dbId},'%')</if>
|
||||
<if test="chName != null and chName != ''">and ch_name like concat('%',#{chName},'%')</if>
|
||||
<if test="enName != null and enName != ''">and en_name like concat('%',#{enName},'%')</if>
|
||||
<if test="filedType != null and filedType != ''">and filed_type like concat('%',#{filedType},'%')</if>
|
||||
<if test="filedLength != null and filedLength != ''">and filed_length like concat('%',#{filedLength},'%')
|
||||
</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>
|
||||
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="MdmModuleDbFiledsentity_list_or" resultMap="get-MdmModuleDbFiledsEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
|
||||
from mdm_module_db_fileds
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
|
||||
<if test="dbId != null and dbId != ''">or db_id = #{dbId}</if>
|
||||
<if test="chName != null and chName != ''">or ch_name = #{chName}</if>
|
||||
<if test="enName != null and enName != ''">or en_name = #{enName}</if>
|
||||
<if test="filedType != null and filedType != ''">or filed_type = #{filedType}</if>
|
||||
<if test="filedLength != null and filedLength != ''">or filed_length = #{filedLength}</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>
|
||||
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.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db_fileds(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
|
||||
<if test="dbId != null and dbId != ''">db_id ,</if>
|
||||
<if test="chName != null and chName != ''">ch_name ,</if>
|
||||
<if test="enName != null and enName != ''">en_name ,</if>
|
||||
<if test="filedType != null and filedType != ''">filed_type ,</if>
|
||||
<if test="filedLength != null and filedLength != ''">filed_length ,</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="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="mdmId != null and mdmId != ''">#{mdmId} ,</if>
|
||||
<if test="dbId != null and dbId != ''">#{dbId} ,</if>
|
||||
<if test="chName != null and chName != ''">#{chName} ,</if>
|
||||
<if test="enName != null and enName != ''">#{enName} ,</if>
|
||||
<if test="filedType != null and filedType != ''">#{filedType} ,</if>
|
||||
<if test="filedLength != null and filedLength != ''">#{filedLength} ,</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="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db_fileds a WHERE
|
||||
a.sts = 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, filed_length, sorts,
|
||||
create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.filedLength},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, filed_length, sorts,
|
||||
create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.filedLength},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
mdm_id = values(mdm_id),
|
||||
db_id = values(db_id),
|
||||
ch_name = values(ch_name),
|
||||
en_name = values(en_name),
|
||||
filed_type = values(filed_type),
|
||||
filed_length = values(filed_length),
|
||||
sorts = values(sorts),
|
||||
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)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||
update mdm_module_db_fileds set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
||||
<if test="dbId != null and dbId != ''">db_id = #{dbId},</if>
|
||||
<if test="chName != null and chName != ''">ch_name = #{chName},</if>
|
||||
<if test="enName != null and enName != ''">en_name = #{enName},</if>
|
||||
<if test="filedType != null and filedType != ''">filed_type = #{filedType},</if>
|
||||
<if test="filedLength != null and filedLength != ''">filed_length = #{filedLength},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||
update mdm_module_db_fileds 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.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||
update mdm_module_db_fileds 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="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
|
||||
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
|
||||
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
|
||||
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
|
||||
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_db_fileds where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFileds.service;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 模版数据库字段表(MdmModuleDbFileds)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:28:09
|
||||
*/
|
||||
public interface IMdmModuleDbFiledsService extends IBaseService<MdmModuleDbFiledsEntity, String> {
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFileds.service.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFileds.service.IMdmModuleDbFiledsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 模版数据库字段表(MdmModuleDbFileds)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:28:09
|
||||
*/
|
||||
@Service(value = "mdmModuleDbFiledsService")
|
||||
public class MdmModuleDbFiledsServiceImpl extends BaseService<MdmModuleDbFiledsEntity, String> implements IMdmModuleDbFiledsService {
|
||||
|
||||
private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmModuleDbFiledsDao(IMdmModuleDbFiledsDao dao) {
|
||||
this.mdmModuleDbFiledsDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 模版数据库字段规则表(mdm_module_db_fileds_rule: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-04 11:16:44
|
||||
*/
|
||||
public interface IMdmModuleDbFiledsRuleDao extends IBaseDao<MdmModuleDbFiledsRuleEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
/**
|
||||
* 模版数据库字段规则表(MdmModuleDbFiledsRule)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-04 11:16:44
|
||||
*/
|
||||
@Repository(value = "MdmModuleDbFiledsRuleDaoImpl")
|
||||
public class MdmModuleDbFiledsRuleDaoImpl extends MybatisGenericDao<MdmModuleDbFiledsRuleEntity, String> implements IMdmModuleDbFiledsRuleDao{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 模版数据库字段规则表(MdmModuleDbFiledsRule)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-04 11:16:44
|
||||
*/
|
||||
public class MdmModuleDbFiledsRuleEntity extends BaseEntity {
|
||||
|
||||
/** 主数据模版ID */
|
||||
private String mdmId;
|
||||
/** 前端分拣用 */
|
||||
private String formName;
|
||||
/** 模版数据库id */
|
||||
private String dbId;
|
||||
/** 模版数据库字段id */
|
||||
private String filedId;
|
||||
/** 规则名称 */
|
||||
private String ruleName;
|
||||
/** 规则编码 */
|
||||
private String ruleCode;
|
||||
/** 规则值 */
|
||||
private String ruleValue;
|
||||
/** 规则类型1、表单属性 2、控件属性 */
|
||||
private String ruleType;
|
||||
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
|
||||
public String getFormName() {
|
||||
return formName;
|
||||
}
|
||||
|
||||
public void setFormName(String formName) {
|
||||
this.formName = formName;
|
||||
}
|
||||
|
||||
public String getDbId() {
|
||||
return dbId;
|
||||
}
|
||||
|
||||
public void setDbId(String dbId) {
|
||||
this.dbId = dbId;
|
||||
}
|
||||
|
||||
public String getFiledId() {
|
||||
return filedId;
|
||||
}
|
||||
|
||||
public void setFiledId(String filedId) {
|
||||
this.filedId = filedId;
|
||||
}
|
||||
|
||||
public String getRuleName() {
|
||||
return ruleName;
|
||||
}
|
||||
|
||||
public void setRuleName(String ruleName) {
|
||||
this.ruleName = ruleName;
|
||||
}
|
||||
|
||||
public String getRuleCode() {
|
||||
return ruleCode;
|
||||
}
|
||||
|
||||
public void setRuleCode(String ruleCode) {
|
||||
this.ruleCode = ruleCode;
|
||||
}
|
||||
|
||||
public String getRuleValue() {
|
||||
return ruleValue;
|
||||
}
|
||||
|
||||
public void setRuleValue(String ruleValue) {
|
||||
this.ruleValue = ruleValue;
|
||||
}
|
||||
|
||||
public String getRuleType() {
|
||||
return ruleType;
|
||||
}
|
||||
|
||||
public void setRuleType(String ruleType) {
|
||||
this.ruleType = ruleType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,280 @@
|
|||
<?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.mdm.mdmModuleDbFiledsRule.dao.impl.MdmModuleDbFiledsRuleDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleDbFiledsRuleEntity-result" type="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="formName" column="form_name" jdbcType="VARCHAR"/>
|
||||
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
|
||||
<result property="filedId" column="filed_id" jdbcType="VARCHAR"/>
|
||||
<result property="ruleName" column="rule_name" jdbcType="VARCHAR"/>
|
||||
<result property="ruleCode" column="rule_code" jdbcType="VARCHAR"/>
|
||||
<result property="ruleValue" column="rule_value" jdbcType="VARCHAR"/>
|
||||
<result property="ruleType" column="rule_type" 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"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "MdmModuleDbFiledsRuleEntity_Base_Column_List">
|
||||
id
|
||||
,mdm_id
|
||||
,form_name
|
||||
,db_id
|
||||
,filed_id
|
||||
,rule_name
|
||||
,rule_code
|
||||
,rule_value
|
||||
,rule_type
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsRuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsRuleEntity_Base_Column_List" />
|
||||
from mdm_module_db_fileds_rule
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="formName != null and formName != ''"> and form_name = #{formName} </if>
|
||||
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
|
||||
<if test="filedId != null and filedId != ''"> and filed_id = #{filedId} </if>
|
||||
<if test="ruleName != null and ruleName != ''"> and rule_name = #{ruleName} </if>
|
||||
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode} </if>
|
||||
<if test="ruleValue != null and ruleValue != ''"> and rule_value = #{ruleValue} </if>
|
||||
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType} </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>
|
||||
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.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
select count(1) from mdm_module_db_fileds_rule
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="formName != null and formName != ''"> and form_name = #{formName} </if>
|
||||
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
|
||||
<if test="filedId != null and filedId != ''"> and filed_id = #{filedId} </if>
|
||||
<if test="ruleName != null and ruleName != ''"> and rule_name = #{ruleName} </if>
|
||||
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode} </if>
|
||||
<if test="ruleValue != null and ruleValue != ''"> and rule_value = #{ruleValue} </if>
|
||||
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType} </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>
|
||||
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-MdmModuleDbFiledsRuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsRuleEntity_Base_Column_List" />
|
||||
from mdm_module_db_fileds_rule
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
|
||||
<if test="formName != null and formName != ''"> and form_name like concat('%',#{formName},'%') </if>
|
||||
<if test="dbId != null and dbId != ''"> and db_id like concat('%',#{dbId},'%') </if>
|
||||
<if test="filedId != null and filedId != ''"> and filed_id like concat('%',#{filedId},'%') </if>
|
||||
<if test="ruleName != null and ruleName != ''"> and rule_name like concat('%',#{ruleName},'%') </if>
|
||||
<if test="ruleCode != null and ruleCode != ''"> and rule_code like concat('%',#{ruleCode},'%') </if>
|
||||
<if test="ruleValue != null and ruleValue != ''"> and rule_value like concat('%',#{ruleValue},'%') </if>
|
||||
<if test="ruleType != null and ruleType != ''"> and rule_type like concat('%',#{ruleType},'%') </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>
|
||||
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="MdmModuleDbFiledsRuleentity_list_or" resultMap="get-MdmModuleDbFiledsRuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsRuleEntity_Base_Column_List" />
|
||||
from mdm_module_db_fileds_rule
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
|
||||
<if test="formName != null and formName != ''"> or form_name = #{formName} </if>
|
||||
<if test="dbId != null and dbId != ''"> or db_id = #{dbId} </if>
|
||||
<if test="filedId != null and filedId != ''"> or filed_id = #{filedId} </if>
|
||||
<if test="ruleName != null and ruleName != ''"> or rule_name = #{ruleName} </if>
|
||||
<if test="ruleCode != null and ruleCode != ''"> or rule_code = #{ruleCode} </if>
|
||||
<if test="ruleValue != null and ruleValue != ''"> or rule_value = #{ruleValue} </if>
|
||||
<if test="ruleType != null and ruleType != ''"> or rule_type = #{ruleType} </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>
|
||||
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.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db_fileds_rule(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
|
||||
<if test="formName != null and formName != ''"> form_name , </if>
|
||||
<if test="dbId != null and dbId != ''"> db_id , </if>
|
||||
<if test="filedId != null and filedId != ''"> filed_id , </if>
|
||||
<if test="ruleName != null and ruleName != ''"> rule_name , </if>
|
||||
<if test="ruleCode != null and ruleCode != ''"> rule_code , </if>
|
||||
<if test="ruleValue != null and ruleValue != ''"> rule_value , </if>
|
||||
<if test="ruleType != null and ruleType != ''"> rule_type , </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="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="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
|
||||
<if test="formName != null and formName != ''"> #{formName} ,</if>
|
||||
<if test="dbId != null and dbId != ''"> #{dbId} ,</if>
|
||||
<if test="filedId != null and filedId != ''"> #{filedId} ,</if>
|
||||
<if test="ruleName != null and ruleName != ''"> #{ruleName} ,</if>
|
||||
<if test="ruleCode != null and ruleCode != ''"> #{ruleCode} ,</if>
|
||||
<if test="ruleValue != null and ruleValue != ''"> #{ruleValue} ,</if>
|
||||
<if test="ruleType != null and ruleType != ''"> #{ruleType} ,</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="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_db_fileds_rule a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.formName},#{entity.dbId},#{entity.filedId},#{entity.ruleName},#{entity.ruleCode},#{entity.ruleValue},#{entity.ruleType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.formName},#{entity.dbId},#{entity.filedId},#{entity.ruleName},#{entity.ruleCode},#{entity.ruleValue},#{entity.ruleType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
mdm_id = values(mdm_id),
|
||||
form_name = values(form_name),
|
||||
db_id = values(db_id),
|
||||
filed_id = values(filed_id),
|
||||
rule_name = values(rule_name),
|
||||
rule_code = values(rule_code),
|
||||
rule_value = values(rule_value),
|
||||
rule_type = values(rule_type),
|
||||
sorts = values(sorts),
|
||||
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)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
|
||||
update mdm_module_db_fileds_rule set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
|
||||
<if test="formName != null and formName != ''"> form_name = #{formName},</if>
|
||||
<if test="dbId != null and dbId != ''"> db_id = #{dbId},</if>
|
||||
<if test="filedId != null and filedId != ''"> filed_id = #{filedId},</if>
|
||||
<if test="ruleName != null and ruleName != ''"> rule_name = #{ruleName},</if>
|
||||
<if test="ruleCode != null and ruleCode != ''"> rule_code = #{ruleCode},</if>
|
||||
<if test="ruleValue != null and ruleValue != ''"> rule_value = #{ruleValue},</if>
|
||||
<if test="ruleType != null and ruleType != ''"> rule_type = #{ruleType},</if>
|
||||
<if test="sorts != null"> sorts = #{sorts},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
|
||||
update mdm_module_db_fileds_rule 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.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
|
||||
update mdm_module_db_fileds_rule 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="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="formName != null and formName != ''"> and form_name = #{formName} </if>
|
||||
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
|
||||
<if test="filedId != null and filedId != ''"> and filed_id = #{filedId} </if>
|
||||
<if test="ruleName != null and ruleName != ''"> and rule_name = #{ruleName} </if>
|
||||
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode} </if>
|
||||
<if test="ruleValue != null and ruleValue != ''"> and rule_value = #{ruleValue} </if>
|
||||
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_db_fileds_rule where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRule.service;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
/**
|
||||
* 模版数据库字段规则表(MdmModuleDbFiledsRule)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-04 11:16:44
|
||||
*/
|
||||
public interface IMdmModuleDbFiledsRuleService extends IBaseService<MdmModuleDbFiledsRuleEntity, String>{
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRule.service.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.service.IMdmModuleDbFiledsRuleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
/**
|
||||
* 模版数据库字段规则表(MdmModuleDbFiledsRule)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-04 11:16:44
|
||||
*/
|
||||
@Service(value = "mdmModuleDbFiledsRuleService")
|
||||
public class MdmModuleDbFiledsRuleServiceImpl extends BaseService<MdmModuleDbFiledsRuleEntity, String> implements IMdmModuleDbFiledsRuleService {
|
||||
|
||||
private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmModuleDbFiledsRuleDao(IMdmModuleDbFiledsRuleDao dao) {
|
||||
this.mdmModuleDbFiledsRuleDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.dao;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 模版数据库字段规则档案表(mdm_module_db_fileds_rule_files: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:30:12
|
||||
*/
|
||||
public interface IMdmModuleDbFiledsRuleFilesDao extends IBaseDao<MdmModuleDbFiledsRuleFilesEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.dao.IMdmModuleDbFiledsRuleFilesDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* 模版数据库字段规则档案表(MdmModuleDbFiledsRuleFiles)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:30:12
|
||||
*/
|
||||
@Repository(value = "MdmModuleDbFiledsRuleFilesDaoImpl")
|
||||
public class MdmModuleDbFiledsRuleFilesDaoImpl extends MybatisGenericDao<MdmModuleDbFiledsRuleFilesEntity, String> implements IMdmModuleDbFiledsRuleFilesDao {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 模版数据库字段规则档案表(MdmModuleDbFiledsRuleFiles)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:30:13
|
||||
*/
|
||||
public class MdmModuleDbFiledsRuleFilesEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
private String ruleName;
|
||||
/**
|
||||
* 规则编码
|
||||
*/
|
||||
private String ruleCode;
|
||||
/**
|
||||
* 规则类型 1、表单属性 2、控件属性
|
||||
*/
|
||||
private String ruleType;
|
||||
/**
|
||||
* 规则值
|
||||
*/
|
||||
private String ruleValue;
|
||||
|
||||
|
||||
public String getRuleName() {
|
||||
return ruleName;
|
||||
}
|
||||
|
||||
public void setRuleName(String ruleName) {
|
||||
this.ruleName = ruleName;
|
||||
}
|
||||
|
||||
public String getRuleCode() {
|
||||
return ruleCode;
|
||||
}
|
||||
|
||||
public void setRuleCode(String ruleCode) {
|
||||
this.ruleCode = ruleCode;
|
||||
}
|
||||
|
||||
public String getRuleType() {
|
||||
return ruleType;
|
||||
}
|
||||
|
||||
public void setRuleType(String ruleType) {
|
||||
this.ruleType = ruleType;
|
||||
}
|
||||
|
||||
public String getRuleValue() {
|
||||
return ruleValue;
|
||||
}
|
||||
|
||||
public void setRuleValue(String ruleValue) {
|
||||
this.ruleValue = ruleValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
<?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.mdm.mdmModuleDbFiledsRuleFiles.dao.impl.MdmModuleDbFiledsRuleFilesDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleDbFiledsRuleFilesEntity-result"
|
||||
type="com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="ruleName" column="rule_name" jdbcType="VARCHAR"/>
|
||||
<result property="ruleCode" column="rule_code" jdbcType="VARCHAR"/>
|
||||
<result property="ruleType" column="rule_type" jdbcType="VARCHAR"/>
|
||||
<result property="ruleValue" column="rule_value" 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"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="MdmModuleDbFiledsRuleFilesEntity_Base_Column_List">
|
||||
id
|
||||
,rule_name
|
||||
,rule_code
|
||||
,rule_type
|
||||
,rule_value
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsRuleFilesEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsRuleFilesEntity_Base_Column_List"/>
|
||||
from mdm_module_db_fileds_rule_files
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="ruleName != null and ruleName != ''">and rule_name = #{ruleName}</if>
|
||||
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
|
||||
<if test="ruleType != null and ruleType != ''">and rule_type = #{ruleType}</if>
|
||||
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</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>
|
||||
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.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity">
|
||||
select count(1) from mdm_module_db_fileds_rule_files
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="ruleName != null and ruleName != ''">and rule_name = #{ruleName}</if>
|
||||
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
|
||||
<if test="ruleType != null and ruleType != ''">and rule_type = #{ruleType}</if>
|
||||
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</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>
|
||||
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-MdmModuleDbFiledsRuleFilesEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsRuleFilesEntity_Base_Column_List"/>
|
||||
from mdm_module_db_fileds_rule_files
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="ruleName != null and ruleName != ''">and rule_name like concat('%',#{ruleName},'%')</if>
|
||||
<if test="ruleCode != null and ruleCode != ''">and rule_code like concat('%',#{ruleCode},'%')</if>
|
||||
<if test="ruleType != null and ruleType != ''">and rule_type like concat('%',#{ruleType},'%')</if>
|
||||
<if test="ruleValue != null and ruleValue != ''">and rule_value like concat('%',#{ruleValue},'%')</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>
|
||||
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="MdmModuleDbFiledsRuleFilesentity_list_or" resultMap="get-MdmModuleDbFiledsRuleFilesEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity">
|
||||
select
|
||||
<include refid="MdmModuleDbFiledsRuleFilesEntity_Base_Column_List"/>
|
||||
from mdm_module_db_fileds_rule_files
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="ruleName != null and ruleName != ''">or rule_name = #{ruleName}</if>
|
||||
<if test="ruleCode != null and ruleCode != ''">or rule_code = #{ruleCode}</if>
|
||||
<if test="ruleType != null and ruleType != ''">or rule_type = #{ruleType}</if>
|
||||
<if test="ruleValue != null and ruleValue != ''">or rule_value = #{ruleValue}</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>
|
||||
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.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db_fileds_rule_files(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="ruleName != null and ruleName != ''">rule_name ,</if>
|
||||
<if test="ruleCode != null and ruleCode != ''">rule_code ,</if>
|
||||
<if test="ruleType != null and ruleType != ''">rule_type ,</if>
|
||||
<if test="ruleValue != null and ruleValue != ''">rule_value ,</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="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="ruleName != null and ruleName != ''">#{ruleName} ,</if>
|
||||
<if test="ruleCode != null and ruleCode != ''">#{ruleCode} ,</if>
|
||||
<if test="ruleType != null and ruleType != ''">#{ruleType} ,</if>
|
||||
<if test="ruleValue != null and ruleValue != ''">#{ruleValue} ,</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="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from
|
||||
mdm_module_db_fileds_rule_files a WHERE a.sts = 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db_fileds_rule_files(rule_name, rule_code, rule_type, rule_value, sorts, create_user_id,
|
||||
create_time, modify_user_id, modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.ruleName},#{entity.ruleCode},#{entity.ruleType},#{entity.ruleValue},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_db_fileds_rule_files(rule_name, rule_code, rule_type, rule_value, sorts, create_user_id,
|
||||
create_time, modify_user_id, modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.ruleName},#{entity.ruleCode},#{entity.ruleType},#{entity.ruleValue},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
rule_name = values(rule_name),
|
||||
rule_code = values(rule_code),
|
||||
rule_type = values(rule_type),
|
||||
rule_value = values(rule_value),
|
||||
sorts = values(sorts),
|
||||
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)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity">
|
||||
update mdm_module_db_fileds_rule_files set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="ruleName != null and ruleName != ''">rule_name = #{ruleName},</if>
|
||||
<if test="ruleCode != null and ruleCode != ''">rule_code = #{ruleCode},</if>
|
||||
<if test="ruleType != null and ruleType != ''">rule_type = #{ruleType},</if>
|
||||
<if test="ruleValue != null and ruleValue != ''">rule_value = #{ruleValue},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity">
|
||||
update mdm_module_db_fileds_rule_files 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.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity">
|
||||
update mdm_module_db_fileds_rule_files 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="ruleName != null and ruleName != ''">and rule_name = #{ruleName}</if>
|
||||
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
|
||||
<if test="ruleType != null and ruleType != ''">and rule_type = #{ruleType}</if>
|
||||
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_db_fileds_rule_files where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.service;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 模版数据库字段规则档案表(MdmModuleDbFiledsRuleFiles)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:30:14
|
||||
*/
|
||||
public interface IMdmModuleDbFiledsRuleFilesService extends IBaseService<MdmModuleDbFiledsRuleFilesEntity, String> {
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.service.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.entity.MdmModuleDbFiledsRuleFilesEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.dao.IMdmModuleDbFiledsRuleFilesDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRuleFiles.service.IMdmModuleDbFiledsRuleFilesService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 模版数据库字段规则档案表(MdmModuleDbFiledsRuleFiles)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:30:15
|
||||
*/
|
||||
@Service(value = "mdmModuleDbFiledsRuleFilesService")
|
||||
public class MdmModuleDbFiledsRuleFilesServiceImpl extends BaseService<MdmModuleDbFiledsRuleFilesEntity, String> implements IMdmModuleDbFiledsRuleFilesService {
|
||||
|
||||
private IMdmModuleDbFiledsRuleFilesDao mdmModuleDbFiledsRuleFilesDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmModuleDbFiledsRuleFilesDao(IMdmModuleDbFiledsRuleFilesDao dao) {
|
||||
this.mdmModuleDbFiledsRuleFilesDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistribute.dao;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 主数据功能应用分发表(mdm_module_distribute: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-06 15:27:41
|
||||
*/
|
||||
public interface IMdmModuleDistributeDao extends IBaseDao<MdmModuleDistributeEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistribute.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
/**
|
||||
* 主数据功能应用分发表(MdmModuleDistribute)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-06 15:27:42
|
||||
*/
|
||||
@Repository(value = "MdmModuleDistributeDaoImpl")
|
||||
public class MdmModuleDistributeDaoImpl extends MybatisGenericDao<MdmModuleDistributeEntity, String> implements IMdmModuleDistributeDao{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistribute.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 主数据功能应用分发表(MdmModuleDistribute)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-06 15:27:42
|
||||
*/
|
||||
public class MdmModuleDistributeEntity extends BaseEntity {
|
||||
|
||||
/** 主数据模版ID */
|
||||
private String mdmId;
|
||||
/** 应用id */
|
||||
private String appId;
|
||||
/** 新增接口 */
|
||||
private String addApi;
|
||||
/** 删除接口 */
|
||||
private String deleteApi;
|
||||
/** 新增使用类型 */
|
||||
private String addType;
|
||||
/** 删除使用类型 */
|
||||
private String deleteType;
|
||||
/** 新增插件 */
|
||||
private String addPlug;
|
||||
/** 删除插件 */
|
||||
private String deletePlug;
|
||||
private List<MdmModuleDistributeDetailEntity> addList;
|
||||
private List<MdmModuleDistributeDetailEntity> deleteList;
|
||||
|
||||
public List<MdmModuleDistributeDetailEntity> getAddList() {
|
||||
return addList;
|
||||
}
|
||||
|
||||
public void setAddList(List<MdmModuleDistributeDetailEntity> addList) {
|
||||
this.addList = addList;
|
||||
}
|
||||
|
||||
public List<MdmModuleDistributeDetailEntity> getDeleteList() {
|
||||
return deleteList;
|
||||
}
|
||||
|
||||
public void setDeleteList(List<MdmModuleDistributeDetailEntity> deleteList) {
|
||||
this.deleteList = deleteList;
|
||||
}
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public String getAddApi() {
|
||||
return addApi;
|
||||
}
|
||||
|
||||
public void setAddApi(String addApi) {
|
||||
this.addApi = addApi;
|
||||
}
|
||||
|
||||
public String getDeleteApi() {
|
||||
return deleteApi;
|
||||
}
|
||||
|
||||
public void setDeleteApi(String deleteApi) {
|
||||
this.deleteApi = deleteApi;
|
||||
}
|
||||
|
||||
public String getAddType() {
|
||||
return addType;
|
||||
}
|
||||
|
||||
public void setAddType(String addType) {
|
||||
this.addType = addType;
|
||||
}
|
||||
|
||||
public String getDeleteType() {
|
||||
return deleteType;
|
||||
}
|
||||
|
||||
public void setDeleteType(String deleteType) {
|
||||
this.deleteType = deleteType;
|
||||
}
|
||||
|
||||
public String getAddPlug() {
|
||||
return addPlug;
|
||||
}
|
||||
|
||||
public void setAddPlug(String addPlug) {
|
||||
this.addPlug = addPlug;
|
||||
}
|
||||
|
||||
public String getDeletePlug() {
|
||||
return deletePlug;
|
||||
}
|
||||
|
||||
public void setDeletePlug(String deletePlug) {
|
||||
this.deletePlug = deletePlug;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,280 @@
|
|||
<?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.mdm.mdmModuleDistribute.dao.impl.MdmModuleDistributeDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleDistributeEntity-result" type="com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
|
||||
<result property="addApi" column="add_api" jdbcType="VARCHAR"/>
|
||||
<result property="deleteApi" column="delete_api" jdbcType="VARCHAR"/>
|
||||
<result property="addType" column="add_type" jdbcType="VARCHAR"/>
|
||||
<result property="deleteType" column="delete_type" 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="addPlug" column="add_plug" jdbcType="VARCHAR"/>
|
||||
<result property="deletePlug" column="delete_plug" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "MdmModuleDistributeEntity_Base_Column_List">
|
||||
id
|
||||
,mdm_id
|
||||
,app_id
|
||||
,add_api
|
||||
,delete_api
|
||||
,add_type
|
||||
,delete_type
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
,add_plug
|
||||
,delete_plug
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleDistributeEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity">
|
||||
select
|
||||
<include refid="MdmModuleDistributeEntity_Base_Column_List" />
|
||||
from mdm_module_distribute
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="addApi != null and addApi != ''"> and add_api = #{addApi} </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> and delete_api = #{deleteApi} </if>
|
||||
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
|
||||
<if test="deleteType != null and deleteType != ''"> and delete_type = #{deleteType} </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="addPlug != null and addPlug != ''"> and add_plug = #{addPlug} </if>
|
||||
<if test="deletePlug != null and deletePlug != ''"> and delete_plug = #{deletePlug} </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.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity">
|
||||
select count(1) from mdm_module_distribute
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="addApi != null and addApi != ''"> and add_api = #{addApi} </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> and delete_api = #{deleteApi} </if>
|
||||
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
|
||||
<if test="deleteType != null and deleteType != ''"> and delete_type = #{deleteType} </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="addPlug != null and addPlug != ''"> and add_plug = #{addPlug} </if>
|
||||
<if test="deletePlug != null and deletePlug != ''"> and delete_plug = #{deletePlug} </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-MdmModuleDistributeEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity">
|
||||
select
|
||||
<include refid="MdmModuleDistributeEntity_Base_Column_List" />
|
||||
from mdm_module_distribute
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
|
||||
<if test="appId != null and appId != ''"> and app_id like concat('%',#{appId},'%') </if>
|
||||
<if test="addApi != null and addApi != ''"> and add_api like concat('%',#{addApi},'%') </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> and delete_api like concat('%',#{deleteApi},'%') </if>
|
||||
<if test="addType != null and addType != ''"> and add_type like concat('%',#{addType},'%') </if>
|
||||
<if test="deleteType != null and deleteType != ''"> and delete_type like concat('%',#{deleteType},'%') </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="addPlug != null and addPlug != ''"> and add_plug like concat('%',#{addPlug},'%') </if>
|
||||
<if test="deletePlug != null and deletePlug != ''"> and delete_plug like concat('%',#{deletePlug},'%') </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="MdmModuleDistributeentity_list_or" resultMap="get-MdmModuleDistributeEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity">
|
||||
select
|
||||
<include refid="MdmModuleDistributeEntity_Base_Column_List" />
|
||||
from mdm_module_distribute
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
|
||||
<if test="appId != null and appId != ''"> or app_id = #{appId} </if>
|
||||
<if test="addApi != null and addApi != ''"> or add_api = #{addApi} </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> or delete_api = #{deleteApi} </if>
|
||||
<if test="addType != null and addType != ''"> or add_type = #{addType} </if>
|
||||
<if test="deleteType != null and deleteType != ''"> or delete_type = #{deleteType} </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="addPlug != null and addPlug != ''"> or add_plug = #{addPlug} </if>
|
||||
<if test="deletePlug != null and deletePlug != ''"> or delete_plug = #{deletePlug} </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.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_distribute(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
|
||||
<if test="appId != null and appId != ''"> app_id , </if>
|
||||
<if test="addApi != null and addApi != ''"> add_api , </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> delete_api , </if>
|
||||
<if test="addType != null and addType != ''"> add_type , </if>
|
||||
<if test="deleteType != null and deleteType != ''"> delete_type , </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="addPlug != null and addPlug != ''"> add_plug , </if>
|
||||
<if test="deletePlug != null and deletePlug != ''"> delete_plug , </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="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
|
||||
<if test="appId != null and appId != ''"> #{appId} ,</if>
|
||||
<if test="addApi != null and addApi != ''"> #{addApi} ,</if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> #{deleteApi} ,</if>
|
||||
<if test="addType != null and addType != ''"> #{addType} ,</if>
|
||||
<if test="deleteType != null and deleteType != ''"> #{deleteType} ,</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="addPlug != null and addPlug != ''"> #{addPlug} ,</if>
|
||||
<if test="deletePlug != null and deletePlug != ''"> #{deletePlug} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_distribute(mdm_id, app_id, add_api, delete_api, add_type, delete_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, add_plug, delete_plug, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.appId},#{entity.addApi},#{entity.deleteApi},#{entity.addType},#{entity.deleteType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.addPlug},#{entity.deletePlug}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_distribute(mdm_id, app_id, add_api, delete_api, add_type, delete_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, add_plug, delete_plug)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.appId},#{entity.addApi},#{entity.deleteApi},#{entity.addType},#{entity.deleteType},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.addPlug},#{entity.deletePlug})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
mdm_id = values(mdm_id),
|
||||
app_id = values(app_id),
|
||||
add_api = values(add_api),
|
||||
delete_api = values(delete_api),
|
||||
add_type = values(add_type),
|
||||
delete_type = values(delete_type),
|
||||
sorts = values(sorts),
|
||||
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),
|
||||
add_plug = values(add_plug),
|
||||
delete_plug = values(delete_plug)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" >
|
||||
update mdm_module_distribute set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
|
||||
<if test="appId != null and appId != ''"> app_id = #{appId},</if>
|
||||
<if test="addApi != null and addApi != ''"> add_api = #{addApi},</if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> delete_api = #{deleteApi},</if>
|
||||
<if test="addType != null and addType != ''"> add_type = #{addType},</if>
|
||||
<if test="deleteType != null and deleteType != ''"> delete_type = #{deleteType},</if>
|
||||
<if test="sorts != null"> sorts = #{sorts},</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="addPlug != null and addPlug != ''"> add_plug = #{addPlug},</if>
|
||||
<if test="deletePlug != null and deletePlug != ''"> delete_plug = #{deletePlug},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" >
|
||||
update mdm_module_distribute 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.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" >
|
||||
update mdm_module_distribute 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="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="addApi != null and addApi != ''"> and add_api = #{addApi} </if>
|
||||
<if test="deleteApi != null and deleteApi != ''"> and delete_api = #{deleteApi} </if>
|
||||
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
|
||||
<if test="deleteType != null and deleteType != ''"> and delete_type = #{deleteType} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="addPlug != null and addPlug != ''"> and add_plug = #{addPlug} </if>
|
||||
<if test="deletePlug != null and deletePlug != ''"> and delete_plug = #{deletePlug} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_distribute where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistribute.service;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
/**
|
||||
* 主数据功能应用分发表(MdmModuleDistribute)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-06 15:27:42
|
||||
*/
|
||||
public interface IMdmModuleDistributeService extends IBaseService<MdmModuleDistributeEntity, String>{
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistribute.service.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDistribute.service.IMdmModuleDistributeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
/**
|
||||
* 主数据功能应用分发表(MdmModuleDistribute)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-06 15:27:42
|
||||
*/
|
||||
@Service(value = "mdmModuleDistributeService")
|
||||
public class MdmModuleDistributeServiceImpl extends BaseService<MdmModuleDistributeEntity, String> implements IMdmModuleDistributeService {
|
||||
|
||||
private IMdmModuleDistributeDao mdmModuleDistributeDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmModuleDistributeDao(IMdmModuleDistributeDao dao) {
|
||||
this.mdmModuleDistributeDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistributeDetail.dao;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 主数据功能应用分发明细表(mdm_module_distribute_detail: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 09:11:31
|
||||
*/
|
||||
public interface IMdmModuleDistributeDetailDao extends IBaseDao<MdmModuleDistributeDetailEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
/**
|
||||
* 主数据功能应用分发明细表(MdmModuleDistributeDetail)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 09:11:31
|
||||
*/
|
||||
@Repository(value = "MdmModuleDistributeDetailDaoImpl")
|
||||
public class MdmModuleDistributeDetailDaoImpl extends MybatisGenericDao<MdmModuleDistributeDetailEntity, String> implements IMdmModuleDistributeDetailDao{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistributeDetail.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 主数据功能应用分发明细表(MdmModuleDistributeDetail)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 09:11:31
|
||||
*/
|
||||
public class MdmModuleDistributeDetailEntity extends BaseEntity {
|
||||
|
||||
/** 主数据模版ID */
|
||||
private String mdmId;
|
||||
/** 应用分发id */
|
||||
private String distributeId;
|
||||
/** 接口id */
|
||||
private String apiId;
|
||||
/** 源API字段 */
|
||||
private String sourceField;
|
||||
/** 源API字段名 */
|
||||
private String sourceName;
|
||||
/** 目标API字段 */
|
||||
private String targetField;
|
||||
/** 目标API字段名 */
|
||||
private String targetName;
|
||||
/** 目标API字段默认值 */
|
||||
private String defaultVaule;
|
||||
/** 源字段层级 */
|
||||
private String sourceFieldPath;
|
||||
/** 目标字段层级 */
|
||||
private String targetFieldPath;
|
||||
private String targetPath;
|
||||
private String sourcePath;
|
||||
/** 连线信息 */
|
||||
private String coordinate;
|
||||
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
|
||||
public String getDistributeId() {
|
||||
return distributeId;
|
||||
}
|
||||
|
||||
public void setDistributeId(String distributeId) {
|
||||
this.distributeId = distributeId;
|
||||
}
|
||||
|
||||
public String getApiId() {
|
||||
return apiId;
|
||||
}
|
||||
|
||||
public void setApiId(String apiId) {
|
||||
this.apiId = apiId;
|
||||
}
|
||||
|
||||
public String getSourceField() {
|
||||
return sourceField;
|
||||
}
|
||||
|
||||
public void setSourceField(String sourceField) {
|
||||
this.sourceField = sourceField;
|
||||
}
|
||||
|
||||
public String getSourceName() {
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
public void setSourceName(String sourceName) {
|
||||
this.sourceName = sourceName;
|
||||
}
|
||||
|
||||
public String getTargetField() {
|
||||
return targetField;
|
||||
}
|
||||
|
||||
public void setTargetField(String targetField) {
|
||||
this.targetField = targetField;
|
||||
}
|
||||
|
||||
public String getTargetName() {
|
||||
return targetName;
|
||||
}
|
||||
|
||||
public void setTargetName(String targetName) {
|
||||
this.targetName = targetName;
|
||||
}
|
||||
|
||||
public String getDefaultVaule() {
|
||||
return defaultVaule;
|
||||
}
|
||||
|
||||
public void setDefaultVaule(String defaultVaule) {
|
||||
this.defaultVaule = defaultVaule;
|
||||
}
|
||||
|
||||
public String getSourceFieldPath() {
|
||||
return sourceFieldPath;
|
||||
}
|
||||
|
||||
public void setSourceFieldPath(String sourceFieldPath) {
|
||||
this.sourceFieldPath = sourceFieldPath;
|
||||
}
|
||||
|
||||
public String getTargetFieldPath() {
|
||||
return targetFieldPath;
|
||||
}
|
||||
|
||||
public void setTargetFieldPath(String targetFieldPath) {
|
||||
this.targetFieldPath = targetFieldPath;
|
||||
}
|
||||
|
||||
public String getTargetPath() {
|
||||
return targetPath;
|
||||
}
|
||||
|
||||
public void setTargetPath(String targetPath) {
|
||||
this.targetPath = targetPath;
|
||||
}
|
||||
|
||||
public String getSourcePath() {
|
||||
return sourcePath;
|
||||
}
|
||||
|
||||
public void setSourcePath(String sourcePath) {
|
||||
this.sourcePath = sourcePath;
|
||||
}
|
||||
|
||||
public String getCoordinate() {
|
||||
return coordinate;
|
||||
}
|
||||
|
||||
public void setCoordinate(String coordinate) {
|
||||
this.coordinate = coordinate;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,335 @@
|
|||
<?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.mdm.mdmModuleDistributeDetail.dao.impl.MdmModuleDistributeDetailDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleDistributeDetailEntity-result" type="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="distributeId" column="distribute_id" jdbcType="VARCHAR"/>
|
||||
<result property="apiId" column="api_id" jdbcType="VARCHAR"/>
|
||||
<result property="sourceField" column="source_field" jdbcType="VARCHAR"/>
|
||||
<result property="sourceName" column="source_name" jdbcType="VARCHAR"/>
|
||||
<result property="targetField" column="target_field" jdbcType="VARCHAR"/>
|
||||
<result property="targetName" column="target_name" jdbcType="VARCHAR"/>
|
||||
<result property="defaultVaule" column="default_vaule" jdbcType="VARCHAR"/>
|
||||
<result property="sourceFieldPath" column="source_field_path" jdbcType="VARCHAR"/>
|
||||
<result property="targetFieldPath" column="target_field_path" jdbcType="VARCHAR"/>
|
||||
<result property="targetPath" column="target_path" jdbcType="VARCHAR"/>
|
||||
<result property="sourcePath" column="source_path" 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="coordinate" column="coordinate" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id = "MdmModuleDistributeDetailEntity_Base_Column_List">
|
||||
id
|
||||
,mdm_id
|
||||
,distribute_id
|
||||
,api_id
|
||||
,source_field
|
||||
,source_name
|
||||
,target_field
|
||||
,target_name
|
||||
,default_vaule
|
||||
,source_field_path
|
||||
,target_field_path
|
||||
,target_path
|
||||
,source_path
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
,coordinate
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleDistributeDetailEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||
select
|
||||
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List" />
|
||||
from mdm_module_distribute_detail
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="distributeId != null and distributeId != ''"> and distribute_id = #{distributeId} </if>
|
||||
<if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if>
|
||||
<if test="sourceField != null and sourceField != ''"> and source_field = #{sourceField} </if>
|
||||
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
|
||||
<if test="targetField != null and targetField != ''"> and target_field = #{targetField} </if>
|
||||
<if test="targetName != null and targetName != ''"> and target_name = #{targetName} </if>
|
||||
<if test="defaultVaule != null and defaultVaule != ''"> and default_vaule = #{defaultVaule} </if>
|
||||
<if test="sourceFieldPath != null and sourceFieldPath != ''"> and source_field_path = #{sourceFieldPath} </if>
|
||||
<if test="targetFieldPath != null and targetFieldPath != ''"> and target_field_path = #{targetFieldPath} </if>
|
||||
<if test="targetPath != null and targetPath != ''"> and target_path = #{targetPath} </if>
|
||||
<if test="sourcePath != null and sourcePath != ''"> and source_path = #{sourcePath} </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="coordinate != null and coordinate != ''"> and coordinate = #{coordinate} </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.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||
select count(1) from mdm_module_distribute_detail
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="distributeId != null and distributeId != ''"> and distribute_id = #{distributeId} </if>
|
||||
<if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if>
|
||||
<if test="sourceField != null and sourceField != ''"> and source_field = #{sourceField} </if>
|
||||
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
|
||||
<if test="targetField != null and targetField != ''"> and target_field = #{targetField} </if>
|
||||
<if test="targetName != null and targetName != ''"> and target_name = #{targetName} </if>
|
||||
<if test="defaultVaule != null and defaultVaule != ''"> and default_vaule = #{defaultVaule} </if>
|
||||
<if test="sourceFieldPath != null and sourceFieldPath != ''"> and source_field_path = #{sourceFieldPath} </if>
|
||||
<if test="targetFieldPath != null and targetFieldPath != ''"> and target_field_path = #{targetFieldPath} </if>
|
||||
<if test="targetPath != null and targetPath != ''"> and target_path = #{targetPath} </if>
|
||||
<if test="sourcePath != null and sourcePath != ''"> and source_path = #{sourcePath} </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="coordinate != null and coordinate != ''"> and coordinate = #{coordinate} </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-MdmModuleDistributeDetailEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||
select
|
||||
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List" />
|
||||
from mdm_module_distribute_detail
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
|
||||
<if test="distributeId != null and distributeId != ''"> and distribute_id like concat('%',#{distributeId},'%') </if>
|
||||
<if test="apiId != null and apiId != ''"> and api_id like concat('%',#{apiId},'%') </if>
|
||||
<if test="sourceField != null and sourceField != ''"> and source_field like concat('%',#{sourceField},'%') </if>
|
||||
<if test="sourceName != null and sourceName != ''"> and source_name like concat('%',#{sourceName},'%') </if>
|
||||
<if test="targetField != null and targetField != ''"> and target_field like concat('%',#{targetField},'%') </if>
|
||||
<if test="targetName != null and targetName != ''"> and target_name like concat('%',#{targetName},'%') </if>
|
||||
<if test="defaultVaule != null and defaultVaule != ''"> and default_vaule like concat('%',#{defaultVaule},'%') </if>
|
||||
<if test="sourceFieldPath != null and sourceFieldPath != ''"> and source_field_path like concat('%',#{sourceFieldPath},'%') </if>
|
||||
<if test="targetFieldPath != null and targetFieldPath != ''"> and target_field_path like concat('%',#{targetFieldPath},'%') </if>
|
||||
<if test="targetPath != null and targetPath != ''"> and target_path like concat('%',#{targetPath},'%') </if>
|
||||
<if test="sourcePath != null and sourcePath != ''"> and source_path like concat('%',#{sourcePath},'%') </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="coordinate != null and coordinate != ''"> and coordinate like concat('%',#{coordinate},'%') </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="MdmModuleDistributeDetailentity_list_or" resultMap="get-MdmModuleDistributeDetailEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||
select
|
||||
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List" />
|
||||
from mdm_module_distribute_detail
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
|
||||
<if test="distributeId != null and distributeId != ''"> or distribute_id = #{distributeId} </if>
|
||||
<if test="apiId != null and apiId != ''"> or api_id = #{apiId} </if>
|
||||
<if test="sourceField != null and sourceField != ''"> or source_field = #{sourceField} </if>
|
||||
<if test="sourceName != null and sourceName != ''"> or source_name = #{sourceName} </if>
|
||||
<if test="targetField != null and targetField != ''"> or target_field = #{targetField} </if>
|
||||
<if test="targetName != null and targetName != ''"> or target_name = #{targetName} </if>
|
||||
<if test="defaultVaule != null and defaultVaule != ''"> or default_vaule = #{defaultVaule} </if>
|
||||
<if test="sourceFieldPath != null and sourceFieldPath != ''"> or source_field_path = #{sourceFieldPath} </if>
|
||||
<if test="targetFieldPath != null and targetFieldPath != ''"> or target_field_path = #{targetFieldPath} </if>
|
||||
<if test="targetPath != null and targetPath != ''"> or target_path = #{targetPath} </if>
|
||||
<if test="sourcePath != null and sourcePath != ''"> or source_path = #{sourcePath} </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="coordinate != null and coordinate != ''"> or coordinate = #{coordinate} </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.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_distribute_detail(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
|
||||
<if test="distributeId != null and distributeId != ''"> distribute_id , </if>
|
||||
<if test="apiId != null and apiId != ''"> api_id , </if>
|
||||
<if test="sourceField != null and sourceField != ''"> source_field , </if>
|
||||
<if test="sourceName != null and sourceName != ''"> source_name , </if>
|
||||
<if test="targetField != null and targetField != ''"> target_field , </if>
|
||||
<if test="targetName != null and targetName != ''"> target_name , </if>
|
||||
<if test="defaultVaule != null and defaultVaule != ''"> default_vaule , </if>
|
||||
<if test="sourceFieldPath != null and sourceFieldPath != ''"> source_field_path , </if>
|
||||
<if test="targetFieldPath != null and targetFieldPath != ''"> target_field_path , </if>
|
||||
<if test="targetPath != null and targetPath != ''"> target_path , </if>
|
||||
<if test="sourcePath != null and sourcePath != ''"> source_path , </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="coordinate != null and coordinate != ''"> coordinate , </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="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
|
||||
<if test="distributeId != null and distributeId != ''"> #{distributeId} ,</if>
|
||||
<if test="apiId != null and apiId != ''"> #{apiId} ,</if>
|
||||
<if test="sourceField != null and sourceField != ''"> #{sourceField} ,</if>
|
||||
<if test="sourceName != null and sourceName != ''"> #{sourceName} ,</if>
|
||||
<if test="targetField != null and targetField != ''"> #{targetField} ,</if>
|
||||
<if test="targetName != null and targetName != ''"> #{targetName} ,</if>
|
||||
<if test="defaultVaule != null and defaultVaule != ''"> #{defaultVaule} ,</if>
|
||||
<if test="sourceFieldPath != null and sourceFieldPath != ''"> #{sourceFieldPath} ,</if>
|
||||
<if test="targetFieldPath != null and targetFieldPath != ''"> #{targetFieldPath} ,</if>
|
||||
<if test="targetPath != null and targetPath != ''"> #{targetPath} ,</if>
|
||||
<if test="sourcePath != null and sourcePath != ''"> #{sourcePath} ,</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="coordinate != null and coordinate != ''"> #{coordinate} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute_detail a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, source_field, source_name, target_field, target_name, default_vaule, source_field_path, target_field_path, target_path, source_path, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, coordinate, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.sourceField},#{entity.sourceName},#{entity.targetField},#{entity.targetName},#{entity.defaultVaule},#{entity.sourceFieldPath},#{entity.targetFieldPath},#{entity.targetPath},#{entity.sourcePath},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.coordinate}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, source_field, source_name, target_field, target_name, default_vaule, source_field_path, target_field_path, target_path, source_path, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, coordinate)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.sourceField},#{entity.sourceName},#{entity.targetField},#{entity.targetName},#{entity.defaultVaule},#{entity.sourceFieldPath},#{entity.targetFieldPath},#{entity.targetPath},#{entity.sourcePath},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.coordinate})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
mdm_id = values(mdm_id),
|
||||
distribute_id = values(distribute_id),
|
||||
api_id = values(api_id),
|
||||
source_field = values(source_field),
|
||||
source_name = values(source_name),
|
||||
target_field = values(target_field),
|
||||
target_name = values(target_name),
|
||||
default_vaule = values(default_vaule),
|
||||
source_field_path = values(source_field_path),
|
||||
target_field_path = values(target_field_path),
|
||||
target_path = values(target_path),
|
||||
source_path = values(source_path),
|
||||
sorts = values(sorts),
|
||||
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),
|
||||
coordinate = values(coordinate)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
|
||||
update mdm_module_distribute_detail set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
|
||||
<if test="distributeId != null and distributeId != ''"> distribute_id = #{distributeId},</if>
|
||||
<if test="apiId != null and apiId != ''"> api_id = #{apiId},</if>
|
||||
<if test="sourceField != null and sourceField != ''"> source_field = #{sourceField},</if>
|
||||
<if test="sourceName != null and sourceName != ''"> source_name = #{sourceName},</if>
|
||||
<if test="targetField != null and targetField != ''"> target_field = #{targetField},</if>
|
||||
<if test="targetName != null and targetName != ''"> target_name = #{targetName},</if>
|
||||
<if test="defaultVaule != null and defaultVaule != ''"> default_vaule = #{defaultVaule},</if>
|
||||
<if test="sourceFieldPath != null and sourceFieldPath != ''"> source_field_path = #{sourceFieldPath},</if>
|
||||
<if test="targetFieldPath != null and targetFieldPath != ''"> target_field_path = #{targetFieldPath},</if>
|
||||
<if test="targetPath != null and targetPath != ''"> target_path = #{targetPath},</if>
|
||||
<if test="sourcePath != null and sourcePath != ''"> source_path = #{sourcePath},</if>
|
||||
<if test="sorts != null"> sorts = #{sorts},</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="coordinate != null and coordinate != ''"> coordinate = #{coordinate},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
|
||||
update mdm_module_distribute_detail 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.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
|
||||
update mdm_module_distribute_detail 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="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||
<if test="distributeId != null and distributeId != ''"> and distribute_id = #{distributeId} </if>
|
||||
<if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if>
|
||||
<if test="sourceField != null and sourceField != ''"> and source_field = #{sourceField} </if>
|
||||
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
|
||||
<if test="targetField != null and targetField != ''"> and target_field = #{targetField} </if>
|
||||
<if test="targetName != null and targetName != ''"> and target_name = #{targetName} </if>
|
||||
<if test="defaultVaule != null and defaultVaule != ''"> and default_vaule = #{defaultVaule} </if>
|
||||
<if test="sourceFieldPath != null and sourceFieldPath != ''"> and source_field_path = #{sourceFieldPath} </if>
|
||||
<if test="targetFieldPath != null and targetFieldPath != ''"> and target_field_path = #{targetFieldPath} </if>
|
||||
<if test="targetPath != null and targetPath != ''"> and target_path = #{targetPath} </if>
|
||||
<if test="sourcePath != null and sourcePath != ''"> and source_path = #{sourcePath} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="coordinate != null and coordinate != ''"> and coordinate = #{coordinate} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_distribute_detail where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistributeDetail.service;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
/**
|
||||
* 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 09:11:31
|
||||
*/
|
||||
public interface IMdmModuleDistributeDetailService extends IBaseService<MdmModuleDistributeDetailEntity, String>{
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.hzya.frame.mdm.mdmModuleDistributeDetail.service.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao;
|
||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.service.IMdmModuleDistributeDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
/**
|
||||
* 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 09:11:31
|
||||
*/
|
||||
@Service(value = "mdmModuleDistributeDetailService")
|
||||
public class MdmModuleDistributeDetailServiceImpl extends BaseService<MdmModuleDistributeDetailEntity, String> implements IMdmModuleDistributeDetailService {
|
||||
|
||||
private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmModuleDistributeDetailDao(IMdmModuleDistributeDetailDao dao) {
|
||||
this.mdmModuleDistributeDetailDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRole.dao;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 主数据功能角色表(mdm_module_role: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:32:25
|
||||
*/
|
||||
public interface IMdmModuleRoleDao extends IBaseDao<MdmModuleRoleEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRole.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleRole.dao.IMdmModuleRoleDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* 主数据功能角色表(MdmModuleRole)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:32:25
|
||||
*/
|
||||
@Repository(value = "MdmModuleRoleDaoImpl")
|
||||
public class MdmModuleRoleDaoImpl extends MybatisGenericDao<MdmModuleRoleEntity, String> implements IMdmModuleRoleDao {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRole.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 主数据功能角色表(MdmModuleRole)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:32:25
|
||||
*/
|
||||
public class MdmModuleRoleEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主数据模版ID
|
||||
*/
|
||||
private String mdmId;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
//角色按钮
|
||||
private List<MdmModuleRoleButtonEntity> mdmModuleRoleButtonEntities;
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public List<MdmModuleRoleButtonEntity> getMdmModuleRoleButtonEntities() {
|
||||
return mdmModuleRoleButtonEntities;
|
||||
}
|
||||
|
||||
public void setMdmModuleRoleButtonEntities(List<MdmModuleRoleButtonEntity> mdmModuleRoleButtonEntities) {
|
||||
this.mdmModuleRoleButtonEntities = mdmModuleRoleButtonEntities;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,230 @@
|
|||
<?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.mdm.mdmModuleRole.dao.impl.MdmModuleRoleDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleRoleEntity-result" type="com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="roleId" column="role_id" 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"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="MdmModuleRoleEntity_Base_Column_List">
|
||||
id
|
||||
,mdm_id
|
||||
,role_id
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleRoleEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity">
|
||||
select
|
||||
<include refid="MdmModuleRoleEntity_Base_Column_List"/>
|
||||
from mdm_module_role
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="roleId != null and roleId != ''">and role_id = #{roleId}</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>
|
||||
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.mdm.mdmModuleRole.entity.MdmModuleRoleEntity">
|
||||
select count(1) from mdm_module_role
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="roleId != null and roleId != ''">and role_id = #{roleId}</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>
|
||||
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-MdmModuleRoleEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity">
|
||||
select
|
||||
<include refid="MdmModuleRoleEntity_Base_Column_List"/>
|
||||
from mdm_module_role
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
|
||||
<if test="roleId != null and roleId != ''">and role_id like concat('%',#{roleId},'%')</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>
|
||||
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="MdmModuleRoleentity_list_or" resultMap="get-MdmModuleRoleEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity">
|
||||
select
|
||||
<include refid="MdmModuleRoleEntity_Base_Column_List"/>
|
||||
from mdm_module_role
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
|
||||
<if test="roleId != null and roleId != ''">or role_id = #{roleId}</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>
|
||||
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.mdm.mdmModuleRole.entity.MdmModuleRoleEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_role(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
|
||||
<if test="roleId != null and roleId != ''">role_id ,</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="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="mdmId != null and mdmId != ''">#{mdmId} ,</if>
|
||||
<if test="roleId != null and roleId != ''">#{roleId} ,</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="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_role a WHERE a.sts
|
||||
= 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_role(mdm_id, role_id, sorts, create_user_id, create_time, modify_user_id, modify_time,
|
||||
sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.roleId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_role(mdm_id, role_id, sorts, create_user_id, create_time, modify_user_id, modify_time,
|
||||
sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.roleId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
mdm_id = values(mdm_id),
|
||||
role_id = values(role_id),
|
||||
sorts = values(sorts),
|
||||
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)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity">
|
||||
update mdm_module_role set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
||||
<if test="roleId != null and roleId != ''">role_id = #{roleId},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity">
|
||||
update mdm_module_role 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.mdm.mdmModuleRole.entity.MdmModuleRoleEntity">
|
||||
update mdm_module_role 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="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="roleId != null and roleId != ''">and role_id = #{roleId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_role where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRole.service;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 主数据功能角色表(MdmModuleRole)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:32:26
|
||||
*/
|
||||
public interface IMdmModuleRoleService extends IBaseService<MdmModuleRoleEntity, String> {
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRole.service.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRole.entity.MdmModuleRoleEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleRole.dao.IMdmModuleRoleDao;
|
||||
import com.hzya.frame.mdm.mdmModuleRole.service.IMdmModuleRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 主数据功能角色表(MdmModuleRole)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:32:27
|
||||
*/
|
||||
@Service(value = "mdmModuleRoleService")
|
||||
public class MdmModuleRoleServiceImpl extends BaseService<MdmModuleRoleEntity, String> implements IMdmModuleRoleService {
|
||||
|
||||
private IMdmModuleRoleDao mdmModuleRoleDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmModuleRoleDao(IMdmModuleRoleDao dao) {
|
||||
this.mdmModuleRoleDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRoleButton.dao;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 主数据功能角色按钮表(mdm_module_role_button: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:33:09
|
||||
*/
|
||||
public interface IMdmModuleRoleButtonDao extends IBaseDao<MdmModuleRoleButtonEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRoleButton.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleRoleButton.dao.IMdmModuleRoleButtonDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* 主数据功能角色按钮表(MdmModuleRoleButton)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:33:10
|
||||
*/
|
||||
@Repository(value = "MdmModuleRoleButtonDaoImpl")
|
||||
public class MdmModuleRoleButtonDaoImpl extends MybatisGenericDao<MdmModuleRoleButtonEntity, String> implements IMdmModuleRoleButtonDao {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRoleButton.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.hzya.frame.sys.userRole.entity.UserRole;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 主数据功能角色按钮表(MdmModuleRoleButton)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:33:10
|
||||
*/
|
||||
public class MdmModuleRoleButtonEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主数据模版ID
|
||||
*/
|
||||
private String mdmId;
|
||||
/**
|
||||
* 模块角色id
|
||||
*/
|
||||
private String moduleRoleId;
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private String roleId;
|
||||
/**
|
||||
* 按钮类型
|
||||
*/
|
||||
private String buttonType;
|
||||
/**
|
||||
* 按钮名
|
||||
*/
|
||||
private String buttonName;
|
||||
|
||||
/**
|
||||
* 角色ids
|
||||
*/
|
||||
private List<UserRole> roleIds;
|
||||
|
||||
public List<UserRole> getRoleIds() {
|
||||
return roleIds;
|
||||
}
|
||||
|
||||
public void setRoleIds(List<UserRole> roleIds) {
|
||||
this.roleIds = roleIds;
|
||||
}
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
|
||||
public String getModuleRoleId() {
|
||||
return moduleRoleId;
|
||||
}
|
||||
|
||||
public void setModuleRoleId(String moduleRoleId) {
|
||||
this.moduleRoleId = moduleRoleId;
|
||||
}
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getButtonType() {
|
||||
return buttonType;
|
||||
}
|
||||
|
||||
public void setButtonType(String buttonType) {
|
||||
this.buttonType = buttonType;
|
||||
}
|
||||
|
||||
public String getButtonName() {
|
||||
return buttonName;
|
||||
}
|
||||
|
||||
public void setButtonName(String buttonName) {
|
||||
this.buttonName = buttonName;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,274 @@
|
|||
<?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.mdm.mdmModuleRoleButton.dao.impl.MdmModuleRoleButtonDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleRoleButtonEntity-result"
|
||||
type="com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="moduleRoleId" column="module_role_id" jdbcType="VARCHAR"/>
|
||||
<result property="roleId" column="role_id" jdbcType="VARCHAR"/>
|
||||
<result property="buttonType" column="button_type" jdbcType="VARCHAR"/>
|
||||
<result property="buttonName" column="button_name" 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"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="MdmModuleRoleButtonEntity_Base_Column_List">
|
||||
id
|
||||
,mdm_id
|
||||
,module_role_id
|
||||
,role_id
|
||||
,button_type
|
||||
,button_name
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleRoleButtonEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity">
|
||||
select
|
||||
<include refid="MdmModuleRoleButtonEntity_Base_Column_List"/>
|
||||
from mdm_module_role_button
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="moduleRoleId != null and moduleRoleId != ''">and module_role_id = #{moduleRoleId}</if>
|
||||
<if test="roleId != null and roleId != ''">and role_id = #{roleId}</if>
|
||||
<if test="buttonType != null and buttonType != ''">and button_type = #{buttonType}</if>
|
||||
<if test="buttonName != null and buttonName != ''">and button_name = #{buttonName}</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="roleIds != null and roleIds.size > 0">
|
||||
and (
|
||||
<foreach collection="roleIds" index="index" item="item" separator="or">
|
||||
role_id = #{item.roleId}
|
||||
</foreach>
|
||||
)
|
||||
</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.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity">
|
||||
select count(1) from mdm_module_role_button
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="moduleRoleId != null and moduleRoleId != ''">and module_role_id = #{moduleRoleId}</if>
|
||||
<if test="roleId != null and roleId != ''">and role_id = #{roleId}</if>
|
||||
<if test="buttonType != null and buttonType != ''">and button_type = #{buttonType}</if>
|
||||
<if test="buttonName != null and buttonName != ''">and button_name = #{buttonName}</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>
|
||||
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-MdmModuleRoleButtonEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity">
|
||||
select
|
||||
<include refid="MdmModuleRoleButtonEntity_Base_Column_List"/>
|
||||
from mdm_module_role_button
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
|
||||
<if test="moduleRoleId != null and moduleRoleId != ''">and module_role_id like
|
||||
concat('%',#{moduleRoleId},'%')
|
||||
</if>
|
||||
<if test="roleId != null and roleId != ''">and role_id like concat('%',#{roleId},'%')</if>
|
||||
<if test="buttonType != null and buttonType != ''">and button_type like concat('%',#{buttonType},'%')</if>
|
||||
<if test="buttonName != null and buttonName != ''">and button_name like concat('%',#{buttonName},'%')</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>
|
||||
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="MdmModuleRoleButtonentity_list_or" resultMap="get-MdmModuleRoleButtonEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity">
|
||||
select
|
||||
<include refid="MdmModuleRoleButtonEntity_Base_Column_List"/>
|
||||
from mdm_module_role_button
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
|
||||
<if test="moduleRoleId != null and moduleRoleId != ''">or module_role_id = #{moduleRoleId}</if>
|
||||
<if test="roleId != null and roleId != ''">or role_id = #{roleId}</if>
|
||||
<if test="buttonType != null and buttonType != ''">or button_type = #{buttonType}</if>
|
||||
<if test="buttonName != null and buttonName != ''">or button_name = #{buttonName}</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>
|
||||
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.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_role_button(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
|
||||
<if test="moduleRoleId != null and moduleRoleId != ''">module_role_id ,</if>
|
||||
<if test="roleId != null and roleId != ''">role_id ,</if>
|
||||
<if test="buttonType != null and buttonType != ''">button_type ,</if>
|
||||
<if test="buttonName != null and buttonName != ''">button_name ,</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="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="mdmId != null and mdmId != ''">#{mdmId} ,</if>
|
||||
<if test="moduleRoleId != null and moduleRoleId != ''">#{moduleRoleId} ,</if>
|
||||
<if test="roleId != null and roleId != ''">#{roleId} ,</if>
|
||||
<if test="buttonType != null and buttonType != ''">#{buttonType} ,</if>
|
||||
<if test="buttonName != null and buttonName != ''">#{buttonName} ,</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="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_role_button a
|
||||
WHERE a.sts = 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_role_button(mdm_id, module_role_id, role_id, button_type, button_name, sorts,
|
||||
create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.moduleRoleId},#{entity.roleId},#{entity.buttonType},#{entity.buttonName},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_role_button(mdm_id, module_role_id, role_id, button_type, button_name, sorts,
|
||||
create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.moduleRoleId},#{entity.roleId},#{entity.buttonType},#{entity.buttonName},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
mdm_id = values(mdm_id),
|
||||
module_role_id = values(module_role_id),
|
||||
role_id = values(role_id),
|
||||
button_type = values(button_type),
|
||||
button_name = values(button_name),
|
||||
sorts = values(sorts),
|
||||
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)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity">
|
||||
update mdm_module_role_button set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
||||
<if test="moduleRoleId != null and moduleRoleId != ''">module_role_id = #{moduleRoleId},</if>
|
||||
<if test="roleId != null and roleId != ''">role_id = #{roleId},</if>
|
||||
<if test="buttonType != null and buttonType != ''">button_type = #{buttonType},</if>
|
||||
<if test="buttonName != null and buttonName != ''">button_name = #{buttonName},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity">
|
||||
update mdm_module_role_button 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.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity">
|
||||
update mdm_module_role_button 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="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="moduleRoleId != null and moduleRoleId != ''">and module_role_id = #{moduleRoleId}</if>
|
||||
<if test="roleId != null and roleId != ''">and role_id = #{roleId}</if>
|
||||
<if test="buttonType != null and buttonType != ''">and button_type = #{buttonType}</if>
|
||||
<if test="buttonName != null and buttonName != ''">and button_name = #{buttonName}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_role_button where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRoleButton.service;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 主数据功能角色按钮表(MdmModuleRoleButton)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:33:11
|
||||
*/
|
||||
public interface IMdmModuleRoleButtonService extends IBaseService<MdmModuleRoleButtonEntity, String> {
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.mdm.mdmModuleRoleButton.service.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleRoleButton.entity.MdmModuleRoleButtonEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleRoleButton.dao.IMdmModuleRoleButtonDao;
|
||||
import com.hzya.frame.mdm.mdmModuleRoleButton.service.IMdmModuleRoleButtonService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 主数据功能角色按钮表(MdmModuleRoleButton)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:33:12
|
||||
*/
|
||||
@Service(value = "mdmModuleRoleButtonService")
|
||||
public class MdmModuleRoleButtonServiceImpl extends BaseService<MdmModuleRoleButtonEntity, String> implements IMdmModuleRoleButtonService {
|
||||
|
||||
private IMdmModuleRoleButtonDao mdmModuleRoleButtonDao;
|
||||
|
||||
@Autowired
|
||||
public void setMdmModuleRoleButtonDao(IMdmModuleRoleButtonDao dao) {
|
||||
this.mdmModuleRoleButtonDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.mdm.mdmModuleUserView.dao;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 主数据用户视图表(mdm_module_user_view: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:33:47
|
||||
*/
|
||||
public interface IMdmModuleUserViewDao extends IBaseDao<MdmModuleUserViewEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.mdm.mdmModuleUserView.dao.impl;
|
||||
|
||||
import com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity;
|
||||
import com.hzya.frame.mdm.mdmModuleUserView.dao.IMdmModuleUserViewDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* 主数据用户视图表(MdmModuleUserView)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:33:47
|
||||
*/
|
||||
@Repository(value = "MdmModuleUserViewDaoImpl")
|
||||
public class MdmModuleUserViewDaoImpl extends MybatisGenericDao<MdmModuleUserViewEntity, String> implements IMdmModuleUserViewDao {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.hzya.frame.mdm.mdmModuleUserView.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 主数据用户视图表(MdmModuleUserView)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-10-17 15:33:48
|
||||
*/
|
||||
public class MdmModuleUserViewEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主数据模版ID
|
||||
*/
|
||||
private String mdmId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 视图明细id
|
||||
*/
|
||||
private String viewDetailId;
|
||||
|
||||
|
||||
public String getMdmId() {
|
||||
return mdmId;
|
||||
}
|
||||
|
||||
public void setMdmId(String mdmId) {
|
||||
this.mdmId = mdmId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getViewDetailId() {
|
||||
return viewDetailId;
|
||||
}
|
||||
|
||||
public void setViewDetailId(String viewDetailId) {
|
||||
this.viewDetailId = viewDetailId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,244 @@
|
|||
<?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.mdm.mdmModuleUserView.dao.impl.MdmModuleUserViewDaoImpl">
|
||||
|
||||
<resultMap id="get-MdmModuleUserViewEntity-result"
|
||||
type="com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="VARCHAR"/>
|
||||
<result property="viewDetailId" column="view_detail_id" 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"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="MdmModuleUserViewEntity_Base_Column_List">
|
||||
id
|
||||
,mdm_id
|
||||
,user_id
|
||||
,view_detail_id
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-MdmModuleUserViewEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity">
|
||||
select
|
||||
<include refid="MdmModuleUserViewEntity_Base_Column_List"/>
|
||||
from mdm_module_user_view
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
|
||||
<if test="viewDetailId != null and viewDetailId != ''">and view_detail_id = #{viewDetailId}</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>
|
||||
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.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity">
|
||||
select count(1) from mdm_module_user_view
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
|
||||
<if test="viewDetailId != null and viewDetailId != ''">and view_detail_id = #{viewDetailId}</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>
|
||||
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-MdmModuleUserViewEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity">
|
||||
select
|
||||
<include refid="MdmModuleUserViewEntity_Base_Column_List"/>
|
||||
from mdm_module_user_view
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
|
||||
<if test="userId != null and userId != ''">and user_id like concat('%',#{userId},'%')</if>
|
||||
<if test="viewDetailId != null and viewDetailId != ''">and view_detail_id like
|
||||
concat('%',#{viewDetailId},'%')
|
||||
</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>
|
||||
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="MdmModuleUserViewentity_list_or" resultMap="get-MdmModuleUserViewEntity-result"
|
||||
parameterType="com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity">
|
||||
select
|
||||
<include refid="MdmModuleUserViewEntity_Base_Column_List"/>
|
||||
from mdm_module_user_view
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
|
||||
<if test="userId != null and userId != ''">or user_id = #{userId}</if>
|
||||
<if test="viewDetailId != null and viewDetailId != ''">or view_detail_id = #{viewDetailId}</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>
|
||||
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.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_user_view(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
|
||||
<if test="userId != null and userId != ''">user_id ,</if>
|
||||
<if test="viewDetailId != null and viewDetailId != ''">view_detail_id ,</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="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="mdmId != null and mdmId != ''">#{mdmId} ,</if>
|
||||
<if test="userId != null and userId != ''">#{userId} ,</if>
|
||||
<if test="viewDetailId != null and viewDetailId != ''">#{viewDetailId} ,</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="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_user_view a WHERE
|
||||
a.sts = 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_user_view(mdm_id, user_id, view_detail_id, sorts, create_user_id, create_time,
|
||||
modify_user_id, modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.userId},#{entity.viewDetailId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into mdm_module_user_view(mdm_id, user_id, view_detail_id, sorts, create_user_id, create_time,
|
||||
modify_user_id, modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.mdmId},#{entity.userId},#{entity.viewDetailId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
mdm_id = values(mdm_id),
|
||||
user_id = values(user_id),
|
||||
view_detail_id = values(view_detail_id),
|
||||
sorts = values(sorts),
|
||||
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)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity">
|
||||
update mdm_module_user_view set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
||||
<if test="userId != null and userId != ''">user_id = #{userId},</if>
|
||||
<if test="viewDetailId != null and viewDetailId != ''">view_detail_id = #{viewDetailId},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity">
|
||||
update mdm_module_user_view 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.mdm.mdmModuleUserView.entity.MdmModuleUserViewEntity">
|
||||
update mdm_module_user_view 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="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
|
||||
<if test="viewDetailId != null and viewDetailId != ''">and view_detail_id = #{viewDetailId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from mdm_module_user_view where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue