多语言(英语、法语、西班牙语、德语、波兰语、阿拉伯语)处理

This commit is contained in:
2026-01-12 09:37:20 +08:00
parent 219caadd45
commit 41f0b72253
113 changed files with 3593 additions and 464 deletions

View File

@ -62,14 +62,4 @@ public interface PointConfigMapper {
* @return
*/
int updateList(List<PointConfig> list);
/**
* 查询所有name_en 为空的数据
* @return
*/
List<PointConfigResp> selectTableList(@Param("tableName") String tableName,@Param("name") String name,@Param("nameEn") String nameEn);
int updateNameEnById(@Param("id") Integer id, @Param("tableName") String tableName,@Param("nameEn") String nameEn,@Param("translateName") String translateName);
}

View File

@ -16,11 +16,11 @@ public interface TranslateNameMapper {
List<TranslateName> getDictNation();
TranslateName selectNameEN(@Param("name")String name);
TranslateName selectNameLang(@Param("name")String name);
int insert(@Param("vo")TranslateName vo);
int updateNameEnById(@Param("id") Integer id, @Param("nameEn") String nameEn);
int updateById(@Param("vo") TranslateName vo);
}

View File

@ -2,6 +2,7 @@ package com.ho.business.service;
import com.ho.business.entity.DynamicConfig;
import com.ho.business.entity.DynamicConfigTitle;
import com.ho.business.entity.TranslateName;
import com.ho.business.vo.req.dynamicConfig.*;
import com.ho.business.vo.resp.DeviceRespVO;
import com.ho.business.vo.resp.dynamicConfig.CurveConfigQueryResp;
@ -120,11 +121,7 @@ public interface DynamicConfigService {
*/
int delDynamicConfigTitle(DynamicConfigTitle vo);
/**
* 修改点名称英文
* @return
*/
int updatePointNameEn(String tableName,String name,String nameEn);
TranslateName getNameLanguage(String name);
String getNameEn(String name);
String getNameByLang(String name,String lang);
}

View File

@ -395,7 +395,13 @@ public class DeviceServiceImpl implements DeviceService {
String dName = adddevice.getDeviceName() + (i + 1);
newSrcIdList.add(newSrcId);
device.setDeviceName(dName);
device.setDeviceNameEn(dynamicConfigService.getNameEn(dName));
TranslateName translate = dynamicConfigService.getNameLanguage(dName);
device.setDeviceNameEn(translate.getNameEn());
device.setDeviceNameDe(translate.getNameDe());
device.setDeviceNamePl(translate.getNamePl());
device.setDeviceNameAra(translate.getNameAra());
device.setDeviceNameFra(translate.getNameFra());
device.setDeviceNameSpa(translate.getNameSpa());
device.setSrcId(newSrcId);
device.setDeptId(adddevice.getDeptId());
device.setDeviceType(adddevice.getDeviceType());

View File

@ -159,8 +159,14 @@ public class DynamicConfigServiceImpl implements DynamicConfigService {
List<CurveConfig> insertList = new ArrayList<>();
CurveConfig config = null;
for (CurveConfigAdd c:list) {
//curveName 设置英文翻译 20250821
c.setCurveNameEn(getNameEn(c.getCurveName()));
//curveName 设置多语言翻译 20250821
TranslateName translate = getNameLanguage(c.getCurveName());
c.setCurveNameEn(translate.getNameEn());
c.setCurveNameFra(translate.getNameFra());
c.setCurveNameSpa(translate.getNameSpa());
c.setCurveNameDe(translate.getNameDe());
c.setCurveNamePl(translate.getNamePl());
c.setCurveNameAra(translate.getNameAra());
config = new CurveConfig();
BeanUtils.copyProperties(c,config);
if(c.getId() == null){
@ -188,7 +194,15 @@ public class DynamicConfigServiceImpl implements DynamicConfigService {
list.get(i).setId(id);
List<DynamicConfig> dList = list.get(i).getList();
if(null != dList && !dList.isEmpty()){
dList.stream().forEach(s->{s.setColNameEn(getNameEn(s.getColName()));});
dList.stream().forEach(s->{
TranslateName translate = getNameLanguage(s.getColName());
s.setColNameEn(translate.getNameEn());
s.setColNameFra(translate.getNameFra());
s.setColNameSpa(translate.getNameSpa());
s.setColNameDe(translate.getNameDe());
s.setColNamePl(translate.getNamePl());
s.setColNameAra(translate.getNameAra());
});
//动态配置点国际化
result = dynamicConfigMapper.insertList(dList);
log.info("插入动态配置结果,{}",result);
@ -302,10 +316,22 @@ public class DynamicConfigServiceImpl implements DynamicConfigService {
if(srcPoint.getSort()==null){
srcPoint.setSort(i);
}
//name defaultValue 设置英文翻译 20250821
srcPoint.setNameEn(getNameEn(srcPoint.getName()));
//name defaultValue 设置多语言翻译 20250821
TranslateName translate = getNameLanguage(srcPoint.getName());
srcPoint.setNameEn(translate.getNameEn());
srcPoint.setNameFra(translate.getNameFra());
srcPoint.setNameSpa(translate.getNameSpa());
srcPoint.setNameDe(translate.getNameDe());
srcPoint.setNamePl(translate.getNamePl());
srcPoint.setNameAra(translate.getNameAra());
if(StringUtil.isNotBlank(srcPoint.getDefaultValue())){
srcPoint.setDefaultValueEn(getNameEn(srcPoint.getDefaultValue()));
TranslateName translateDe = getNameLanguage(srcPoint.getDefaultValue());
srcPoint.setDefaultValueEn(translateDe.getNameEn());
srcPoint.setDefaultValueFra(translateDe.getNameFra());
srcPoint.setDefaultValueSpa(translateDe.getNameSpa());
srcPoint.setDefaultValueDe(translateDe.getNameDe());
srcPoint.setDefaultValuePl(translateDe.getNamePl());
srcPoint.setDefaultValueAra(translateDe.getNameAra());
}
pointConfig = new PointConfig();
BeanUtils.copyProperties(srcPoint,pointConfig);
@ -351,7 +377,15 @@ public class DynamicConfigServiceImpl implements DynamicConfigService {
List<DynamicConfig> dynamicConfigs = list.get(i).getList();
//插入动态配置点
if(!dynamicConfigs.isEmpty()){
dynamicConfigs.stream().forEach(s->{s.setColNameEn(getNameEn(s.getColName()));});
dynamicConfigs.stream().forEach(s->{
TranslateName translate = getNameLanguage(s.getColName());
s.setColNameEn(translate.getNameEn());
s.setColNameFra(translate.getNameFra());
s.setColNameSpa(translate.getNameSpa());
s.setColNameDe(translate.getNameDe());
s.setColNamePl(translate.getNamePl());
s.setColNameAra(translate.getNameAra());
});
result = dynamicConfigMapper.insertList(dynamicConfigs);
for (DynamicConfig d:dynamicConfigs) {
relation = new PointConfigRelation();
@ -374,8 +408,16 @@ public class DynamicConfigServiceImpl implements DynamicConfigService {
p.getPolysemyList().forEach(i->i.setPointId(p.getId()));
pList.addAll(p.getPolysemyList());
}
//name 设置英文翻译 20250821
pList.stream().forEach(i->{i.setNameEn(getNameEn(i.getName()));});
//name 设置多语言翻译 20250821
pList.stream().forEach(i->{
TranslateName translate = getNameLanguage(i.getName());
i.setNameEn(translate.getNameEn());
i.setNameFra(translate.getNameFra());
i.setNameSpa(translate.getNameSpa());
i.setNameDe(translate.getNameDe());
i.setNamePl(translate.getNamePl());
i.setNameAra(translate.getNameAra());
});
result = polysemyMapper.insertList(pList);
log.info("插入一点多义表结果:{}",result);
}
@ -780,47 +822,97 @@ public class DynamicConfigServiceImpl implements DynamicConfigService {
}
@Override
public int updatePointNameEn(String tableName,String name,String nameEn) {
int a=0;
//查询所有name_en 为空的数据
List<PointConfigResp> pointList = pointConfigMapper.selectTableList(tableName,name,nameEn);
for (PointConfigResp vo:pointList){
if(StringUtil.isNotBlank(vo.getName())){
String translateName = getNameEn(vo.getName());
int resoult=pointConfigMapper.updateNameEnById(vo.getId(),tableName,nameEn,translateName);
a=a+resoult;
log.info("修改进度:{}",a);
}
public String getNameByLang(String name,String lang){
TranslateName translate = getNameLanguage(name);
switch (lang){
case CommonConstant.langTemp.EN_US:
return translate.getNameEn();
case CommonConstant.langTemp.DE_DE:
return translate.getNameDe();
case CommonConstant.langTemp.ES_ES:
return translate.getNameSpa();
case CommonConstant.langTemp.AR_EG:
return translate.getNameAra();
case CommonConstant.langTemp.PL_PL:
return translate.getNamePl();
case CommonConstant.langTemp.FR_FR:
return translate.getNameFra();
case CommonConstant.langTemp.ZH_CN:
return translate.getName();
}
return a;
return null;
}
@Override
public String getNameEn(String name) {
// 查询数据库中有预先翻译的中文字段
public TranslateName getNameLanguage(String name) {
// 英语
String nameEn = null;
TranslateName vo = translateNameMapper.selectNameEN(name);
// 法语
String nameFra = null;
// 西班牙语
String nameSpa = null;
// 德语
String nameDe = null;
// 波兰语
String namePl = null;
// 阿拉伯语
String nameAra = null;
// 查询数据库中 预先翻译的中文字段 语言
TranslateName vo = translateNameMapper.selectNameLang(name);
TranslateName translate = new TranslateName();
boolean flag = false;
if(vo == null){
nameEn = TranslateUtils.translate(name);
nameEn = TranslateUtils.translate(name,CommonConstant.lang.EN);
nameFra = TranslateUtils.translate(name,CommonConstant.lang.FRA);
nameSpa = TranslateUtils.translate(name,CommonConstant.lang.SPA);
nameDe = TranslateUtils.translate(name,CommonConstant.lang.DE);
namePl = TranslateUtils.translate(name,CommonConstant.lang.PL);
nameAra = TranslateUtils.translate(name,CommonConstant.lang.ARA);
// 插入中文预翻译表
TranslateName translate = new TranslateName();
translate.setName(name);
translate.setNameEn(nameEn);
translate.setNameFra(nameFra);
translate.setNameSpa(nameSpa);
translate.setNameDe(nameDe);
translate.setNamePl(namePl);
translate.setNameAra(nameAra);
CompletableFuture.runAsync(()->{
translateNameMapper.insert(translate);
});
return translate;
}else{
if(StringUtil.isEmpty(vo.getNameEn())){
nameEn = TranslateUtils.translate(name);
String finalNameEn = nameEn;
vo.setNameEn(TranslateUtils.translate(name,CommonConstant.lang.EN));
flag = true;
}
if(StringUtil.isEmpty(vo.getNameFra())){
vo.setNameFra(TranslateUtils.translate(name,CommonConstant.lang.FRA));
flag = true;
}
if(StringUtil.isEmpty(vo.getNameSpa())){
vo.setNameSpa(TranslateUtils.translate(name,CommonConstant.lang.SPA));
flag = true;
}
if(StringUtil.isEmpty(vo.getNameDe())){
vo.setNameDe(TranslateUtils.translate(name,CommonConstant.lang.DE));
flag = true;
}
if(StringUtil.isEmpty(vo.getNamePl())){
vo.setNamePl(TranslateUtils.translate(name,CommonConstant.lang.PL));
flag = true;
}
if(StringUtil.isEmpty(vo.getNameAra())){
vo.setNameAra(TranslateUtils.translate(name,CommonConstant.lang.ARA));
flag = true;
}
if(flag){
CompletableFuture.runAsync(()->{
translateNameMapper.updateNameEnById(vo.getId(), finalNameEn);
translateNameMapper.updateById(vo);
});
}else{
nameEn = vo.getNameEn();
}
}
return nameEn;
return vo;
}

View File

@ -209,10 +209,30 @@ public class EarningsCalculateServiceImpl implements EarningsCalculateService {
ec.setMonth(time.substring(time.length() - 2, time.length()));
String reportName = CommonConstant.REPORT_NAME;
String billName = CommonConstant.BILL_NAME;
if(RedisKeyConstant.User.EN_US.equals(earningsCalculateReq.getLang())){
if(CommonConstant.langTemp.EN_US.equals(earningsCalculateReq.getLang())){
reportName = CommonConstant.REPORT_NAME_EN;
billName = CommonConstant.BILL_NAME_EN;
}
if(CommonConstant.langTemp.FR_FR.equals(earningsCalculateReq.getLang())){
reportName = CommonConstant.REPORT_NAME_FRA;
billName = CommonConstant.BILL_NAME_FRA;
}
if(CommonConstant.langTemp.ES_ES.equals(earningsCalculateReq.getLang())){
reportName = CommonConstant.REPORT_NAME_SPA;
billName = CommonConstant.BILL_NAME_SPA;
}
if(CommonConstant.langTemp.AR_EG.equals(earningsCalculateReq.getLang())){
reportName = CommonConstant.REPORT_NAME_ARA;
billName = CommonConstant.BILL_NAME_ARA;
}
if(CommonConstant.langTemp.DE_DE.equals(earningsCalculateReq.getLang())){
reportName = CommonConstant.REPORT_NAME_DE;
billName = CommonConstant.BILL_NAME_DE;
}
if(CommonConstant.langTemp.PL_PL.equals(earningsCalculateReq.getLang())){
reportName = CommonConstant.REPORT_NAME_PL;
billName = CommonConstant.BILL_NAME_PL;
}
// 电站名称(报表标题)
if (type == 0) {
ec.setStationName(station.getName() + "( " + time + " ) "+reportName);

View File

@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ho.business.entity.ElecMeterValue;
import com.ho.business.entity.HisCurveRelate;
import com.ho.business.entity.TranslateName;
import com.ho.business.mapper.HisCurveRelateMapper;
import com.ho.business.service.DynamicConfigService;
import com.ho.business.service.HisCurveRelateService;
@ -54,12 +55,24 @@ public class HisCurveRelateServiceImpl implements HisCurveRelateService {
hisCurveRelate.setDeviceType(hisPointCurveReqVo.getDeviceType());
hisCurveRelate.setModelId(String.valueOf(modelId));
hisCurveRelate.setColName(hisPointCurveReqVo.getColName());
hisCurveRelate.setColNameEn(dynamicConfigService.getNameEn(hisPointCurveReqVo.getColName()));
TranslateName colTrans = dynamicConfigService.getNameLanguage(hisPointCurveReqVo.getColName());
hisCurveRelate.setColNameEn(colTrans.getNameEn());
hisCurveRelate.setColNameFra(colTrans.getNameFra());
hisCurveRelate.setColNameSpa(colTrans.getNameSpa());
hisCurveRelate.setColNameDe(colTrans.getNameDe());
hisCurveRelate.setColNamePl(colTrans.getNamePl());
hisCurveRelate.setColNameAra(colTrans.getNameAra());
hisCurveRelate.setStationId(hisPointCurveReqVo.getStationId());
//modelname 不能重复
//hisCurveRelateMapper.selectName(hisPointReqVo.getModelName());
hisCurveRelate.setModelName(hisPointReqVo.getModelName());
hisCurveRelate.setModelNameEn(dynamicConfigService.getNameEn(hisPointReqVo.getModelName()));
TranslateName modelTrans = dynamicConfigService.getNameLanguage(hisPointReqVo.getModelName());
hisCurveRelate.setModelNameEn(modelTrans.getNameEn());
hisCurveRelate.setModelNameFra(modelTrans.getNameFra());
hisCurveRelate.setModelNameSpa(modelTrans.getNameSpa());
hisCurveRelate.setModelNameDe(modelTrans.getNameDe());
hisCurveRelate.setModelNamePl(modelTrans.getNamePl());
hisCurveRelate.setModelNameAra(modelTrans.getNameAra());
hisCurveRelate.setSrcId(hisPointCurveReqVo.getSrcId());
hisCurveRelate.setUserId(user.getUserId());
list.add(hisCurveRelate);

View File

@ -608,10 +608,30 @@ public class OpenStationServiceImpl implements OpenStationService {
String name = "";
String summary = DefineConstant.SUMMARY;
String summaryData = DefineConstant.SUMMARY_DATA_STATION;
if(RedisKeyConstant.User.EN_US.equals(lang)){
if(CommonConstant.langTemp.EN_US.equals(lang)){
summary = DefineConstant.SUMMARY_EN;
summaryData = DefineConstant.SUMMARY_DATA_STATION_EN;
}
if(CommonConstant.langTemp.FR_FR.equals(lang)){
summary = DefineConstant.SUMMARY_FRA;
summaryData = DefineConstant.SUMMARY_DATA_STATION_FRA;
}
if(CommonConstant.langTemp.ES_ES.equals(lang)){
summary = DefineConstant.SUMMARY_SPA;
summaryData = DefineConstant.SUMMARY_DATA_STATION_SPA;
}
if(CommonConstant.langTemp.AR_EG.equals(lang)){
summary = DefineConstant.SUMMARY_ARA;
summaryData = DefineConstant.SUMMARY_DATA_STATION_ARA;
}
if(CommonConstant.langTemp.DE_DE.equals(lang)){
summary = DefineConstant.SUMMARY_DE;
summaryData = DefineConstant.SUMMARY_DATA_STATION_DE;
}
if(CommonConstant.langTemp.PL_PL.equals(lang)){
summary = DefineConstant.SUMMARY_PL;
summaryData = DefineConstant.SUMMARY_DATA_STATION_PL;
}
if("segment".equals(segmentType)){
List<EarningsCalculateData> totalList = new ArrayList<>();
BigDecimal chargeTip = BigDecimal.ZERO;
@ -773,8 +793,18 @@ public class OpenStationServiceImpl implements OpenStationService {
String segmentType = req.getSegmentType();
String name = "";
String summary = DefineConstant.SUMMARY;
if(RedisKeyConstant.User.EN_US.equals(req.getLang())){
if(CommonConstant.langTemp.EN_US.equals(req.getLang())){
summary = DefineConstant.SUMMARY_EN;
}else if(CommonConstant.langTemp.FR_FR.equals(req.getLang())){
summary = DefineConstant.SUMMARY_FRA;
}else if(CommonConstant.langTemp.ES_ES.equals(req.getLang())){
summary = DefineConstant.SUMMARY_SPA;
}else if(CommonConstant.langTemp.DE_DE.equals(req.getLang())){
summary = DefineConstant.SUMMARY_DE;
}else if(CommonConstant.langTemp.PL_PL.equals(req.getLang())){
summary = DefineConstant.SUMMARY_PL;
}else if(CommonConstant.langTemp.AR_EG.equals(req.getLang())){
summary = DefineConstant.SUMMARY_ARA;
}
if(CommonConstant.SEGMENT.equals(segmentType)){
List<EarningsCalculateData> resultList = new ArrayList<>();
@ -1082,7 +1112,7 @@ public class OpenStationServiceImpl implements OpenStationService {
// title的参数为ExportParams类型目前仅仅在ExportParams中设置了sheetName
userExportMap.put("title", userExportParams);
// 模版导出对应得实体类型
if(RedisKeyConstant.User.EN_US.equals(lang)){
if(CommonConstant.langTemp.EN_US.equals(lang)){
userExportMap.put("entity", PcsElecDataEn.class);
List<PcsElecDataEn> enList=new ArrayList<>();
dataList.stream().forEach(s->{
@ -1092,7 +1122,59 @@ public class OpenStationServiceImpl implements OpenStationService {
});
// sheet1中要填充得数据
userExportMap.put("data", enList);
}else{
}else if(CommonConstant.langTemp.FR_FR.equals(lang)){
userExportMap.put("entity", PcsElecDataFra.class);
List<PcsElecDataFra> fraList=new ArrayList<>();
dataList.stream().forEach(s->{
PcsElecDataFra fra = new PcsElecDataFra();
BeanUtils.copyProperties(s, fra);
fraList.add(fra);
});
// sheet1中要填充得数据
userExportMap.put("data", fraList);
}else if(CommonConstant.langTemp.ES_ES.equals(lang)){
userExportMap.put("entity", PcsElecDataSpa.class);
List<PcsElecDataSpa> spaList=new ArrayList<>();
dataList.stream().forEach(s->{
PcsElecDataSpa spa = new PcsElecDataSpa();
BeanUtils.copyProperties(s, spa);
spaList.add(spa);
});
// sheet1中要填充得数据
userExportMap.put("data", spaList);
}else if(CommonConstant.langTemp.AR_EG.equals(lang)){
userExportMap.put("entity", PcsElecDataAra.class);
List<PcsElecDataAra> araList=new ArrayList<>();
dataList.stream().forEach(s->{
PcsElecDataAra ara = new PcsElecDataAra();
BeanUtils.copyProperties(s, ara);
araList.add(ara);
});
// sheet1中要填充得数据
userExportMap.put("data", araList);
}else if(CommonConstant.langTemp.DE_DE.equals(lang)){
userExportMap.put("entity", PcsElecDataDe.class);
List<PcsElecDataDe> deList=new ArrayList<>();
dataList.stream().forEach(s->{
PcsElecDataDe de = new PcsElecDataDe();
BeanUtils.copyProperties(s, de);
deList.add(de);
});
// sheet1中要填充得数据
userExportMap.put("data", deList);
}else if(CommonConstant.langTemp.PL_PL.equals(lang)){
userExportMap.put("entity", PcsElecDataPl.class);
List<PcsElecDataPl> plList=new ArrayList<>();
dataList.stream().forEach(s->{
PcsElecDataPl pl = new PcsElecDataPl();
BeanUtils.copyProperties(s, pl);
plList.add(pl);
});
// sheet1中要填充得数据
userExportMap.put("data", plList);
}
else{
userExportMap.put("entity", PcsElecData.class);
// sheet1中要填充得数据
userExportMap.put("data", dataList);
@ -1110,7 +1192,7 @@ public class OpenStationServiceImpl implements OpenStationService {
// title的参数为ExportParams类型目前仅仅在ExportParams中设置了sheetName
userExportMap.put("title", userExportParams);
// 模版导出对应得实体类型
if(RedisKeyConstant.User.EN_US.equals(lang)){
if(CommonConstant.langTemp.EN_US.equals(lang)){
userExportMap.put("entity", EarningsCalculateDataEn.class);
List<EarningsCalculateDataEn> enList=new ArrayList<>();
dataList.stream().forEach(s->{
@ -1120,6 +1202,56 @@ public class OpenStationServiceImpl implements OpenStationService {
});
// sheet1中要填充得数据
userExportMap.put("data", enList);
}else if(CommonConstant.langTemp.FR_FR.equals(lang)){
userExportMap.put("entity", EarningsCalculateDataFra.class);
List<EarningsCalculateDataFra> fraList=new ArrayList<>();
dataList.stream().forEach(s->{
EarningsCalculateDataFra fra = new EarningsCalculateDataFra();
BeanUtils.copyProperties(s, fra);
fraList.add(fra);
});
// sheet1中要填充得数据
userExportMap.put("data", fraList);
}else if(CommonConstant.langTemp.ES_ES.equals(lang)){
userExportMap.put("entity", EarningsCalculateDataSpa.class);
List<EarningsCalculateDataSpa> spaList=new ArrayList<>();
dataList.stream().forEach(s->{
EarningsCalculateDataSpa spa = new EarningsCalculateDataSpa();
BeanUtils.copyProperties(s, spa);
spaList.add(spa);
});
// sheet1中要填充得数据
userExportMap.put("data", spaList);
}else if(CommonConstant.langTemp.AR_EG.equals(lang)){
userExportMap.put("entity", EarningsCalculateDataAra.class);
List<EarningsCalculateDataAra> araList=new ArrayList<>();
dataList.stream().forEach(s->{
EarningsCalculateDataAra ara = new EarningsCalculateDataAra();
BeanUtils.copyProperties(s, ara);
araList.add(ara);
});
// sheet1中要填充得数据
userExportMap.put("data", araList);
}else if(CommonConstant.langTemp.DE_DE.equals(lang)){
userExportMap.put("entity", EarningsCalculateDataDe.class);
List<EarningsCalculateDataDe> deList=new ArrayList<>();
dataList.stream().forEach(s->{
EarningsCalculateDataDe de = new EarningsCalculateDataDe();
BeanUtils.copyProperties(s, de);
deList.add(de);
});
// sheet1中要填充得数据
userExportMap.put("data", deList);
}else if(CommonConstant.langTemp.PL_PL.equals(lang)){
userExportMap.put("entity", EarningsCalculateDataPl.class);
List<EarningsCalculateDataPl> plList=new ArrayList<>();
dataList.stream().forEach(s->{
EarningsCalculateDataPl pl = new EarningsCalculateDataPl();
BeanUtils.copyProperties(s, pl);
plList.add(pl);
});
// sheet1中要填充得数据
userExportMap.put("data", plList);
}else{
userExportMap.put("entity", EarningsCalculateData.class);
// sheet1中要填充得数据

View File

@ -372,10 +372,22 @@ public class PlanningCurveIssueServiceImpl implements PlanningCurveIssueService
planCurveOperationRecordReq.setPreviousPlanningCurve(previousOperateId);
// 英文字段处理
if(StringUtil.isNotBlank(planCurveOperationRecordReq.getOperateContent())){
planCurveOperationRecordReq.setOperateContentEn(dynamicConfigService.getNameEn(planCurveOperationRecordReq.getOperateContent()));
TranslateName opTrans = dynamicConfigService.getNameLanguage(planCurveOperationRecordReq.getOperateContent());
planCurveOperationRecordReq.setOperateContentEn(opTrans.getNameEn());
planCurveOperationRecordReq.setOperateContentFra(opTrans.getNameFra());
planCurveOperationRecordReq.setOperateContentSpa(opTrans.getNameSpa());
planCurveOperationRecordReq.setOperateContentDe(opTrans.getNameDe());
planCurveOperationRecordReq.setOperateContentPl(opTrans.getNamePl());
planCurveOperationRecordReq.setOperateContentAra(opTrans.getNameAra());
}
if(StringUtil.isNotBlank(planCurveOperationRecordReq.getOperateResult())){
planCurveOperationRecordReq.setOperateResultEn(dynamicConfigService.getNameEn(planCurveOperationRecordReq.getOperateResult()));
TranslateName reTrans = dynamicConfigService.getNameLanguage(planCurveOperationRecordReq.getOperateResult());
planCurveOperationRecordReq.setOperateResultEn(reTrans.getNameEn());
planCurveOperationRecordReq.setOperateResultFra(reTrans.getNameFra());
planCurveOperationRecordReq.setOperateResultSpa(reTrans.getNameSpa());
planCurveOperationRecordReq.setOperateResultDe(reTrans.getNameDe());
planCurveOperationRecordReq.setOperateResultPl(reTrans.getNamePl());
planCurveOperationRecordReq.setOperateResultAra(reTrans.getNameAra());
}
//插入操作记录
issueMapper.planCurveOperationRecord(planCurveOperationRecordReq);

View File

@ -4,10 +4,7 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.ho.business.entity.PlanningCurve;
import com.ho.business.entity.PlanningCurveTactics;
import com.ho.business.entity.PlanningCurveTemplate;
import com.ho.business.entity.Station;
import com.ho.business.entity.*;
import com.ho.business.mapper.PlanningCurveMapper;
import com.ho.business.mapper.PlanningCurveTacticsMapper;
import com.ho.business.service.DynamicConfigService;
@ -69,7 +66,13 @@ public class PlanningCurveServiceImpl implements PlanningCurveService {
if(StringUtil.isNotBlank(template.getTemplateName())){
// 摸版名字英文处理
template.setTemplateNameEn(dynamicConfigService.getNameEn(template.getTemplateName()));
TranslateName translate = dynamicConfigService.getNameLanguage(template.getTemplateName());
template.setTemplateNameEn(translate.getNameEn());
template.setTemplateNameFra(translate.getNameFra());
template.setTemplateNameSpa(translate.getNameSpa());
template.setTemplateNameDe(translate.getNameDe());
template.setTemplateNamePl(translate.getNamePl());
template.setTemplateNameAra(translate.getNameAra());
}
if (template.getPlanningCurves().size() <= 0) {
@ -113,7 +116,13 @@ public class PlanningCurveServiceImpl implements PlanningCurveService {
if (null != template && null != template.getTemId()) {
if(StringUtil.isNotBlank(template.getTemplateName())){
// 摸版名字英文处理
template.setTemplateNameEn(dynamicConfigService.getNameEn(template.getTemplateName()));
TranslateName translate = dynamicConfigService.getNameLanguage(template.getTemplateName());
template.setTemplateNameEn(translate.getNameEn());
template.setTemplateNameFra(translate.getNameFra());
template.setTemplateNameSpa(translate.getNameSpa());
template.setTemplateNameDe(translate.getNameDe());
template.setTemplateNamePl(translate.getNamePl());
template.setTemplateNameAra(translate.getNameAra());
}
Integer templateId = template.getTemId();
Map<String, Object> check = this.checkData(template, templateId);

View File

@ -1370,8 +1370,18 @@ public class PointDemoServiceImpl implements PointDemoService {
}
List<String> titleList = new ArrayList<>();
String time;
if(RedisKeyConstant.User.EN_US.equals(pointCurveReq.getLang())){
if(CommonConstant.langTemp.EN_US.equals(pointCurveReq.getLang())){
time = DefineConstant.PointDemo.TIME_EN;
}else if(CommonConstant.langTemp.FR_FR.equals(pointCurveReq.getLang())){
time = DefineConstant.PointDemo.TIME_FRA;
}else if(CommonConstant.langTemp.ES_ES.equals(pointCurveReq.getLang())){
time = DefineConstant.PointDemo.TIME_SPA;
}else if(CommonConstant.langTemp.AR_EG.equals(pointCurveReq.getLang())){
time = DefineConstant.PointDemo.TIME_ARA;
}else if(CommonConstant.langTemp.DE_DE.equals(pointCurveReq.getLang())){
time = DefineConstant.PointDemo.TIME_DE;
}else if(CommonConstant.langTemp.PL_PL.equals(pointCurveReq.getLang())){
time = DefineConstant.PointDemo.TIME_PL;
}else{
time = DefineConstant.PointDemo.TIME;
}

View File

@ -648,16 +648,35 @@ public class StationHomeServiceImpl implements StationHomeService {
//计算运行天数
String operationDayStr = null;
if (station.getStatus().equals(CommonConstant.TWO)) {
if(RedisKeyConstant.User.EN_US.equals(req.getLang())){
//切换为英文
// 多语言切换
if(CommonConstant.langTemp.EN_US.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.BUILDING_EN;
}else if(CommonConstant.langTemp.FR_FR.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.BUILDING_FRA;
}else if(CommonConstant.langTemp.ES_ES.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.BUILDING_SPA;
}else if(CommonConstant.langTemp.AR_EG.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.BUILDING_ARA;
}else if(CommonConstant.langTemp.DE_DE.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.BUILDING_DE;
}else if(CommonConstant.langTemp.PL_PL.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.BUILDING_PL;
}else{
operationDayStr = DefineConstant.StationHome.BUILDING;
}
} else if (station.getStatus().equals(CommonConstant.THREE)) {
if(RedisKeyConstant.User.EN_US.equals(req.getLang())){
//切换为英文
if(CommonConstant.langTemp.EN_US.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.PROPOSED_EN;
}else if(CommonConstant.langTemp.FR_FR.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.PROPOSED_FRA;
}else if(CommonConstant.langTemp.ES_ES.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.PROPOSED_SPA;
}else if(CommonConstant.langTemp.AR_EG.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.PROPOSED_ARA;
}else if(CommonConstant.langTemp.DE_DE.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.PROPOSED_DE;
}else if(CommonConstant.langTemp.PL_PL.equals(req.getLang())){
operationDayStr = DefineConstant.StationHome.PROPOSED_PL;
}else{
operationDayStr = DefineConstant.StationHome.PROPOSED;
}

View File

@ -34,6 +34,7 @@ import com.ho.common.tools.util.*;
import com.ho.common.tools.vo.req.CardInfoReqVo;
import com.ho.user.api.entity.SysDept;
import com.ho.user.api.vo.req.QueryDeptReqVO;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,6 +44,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@ -100,6 +102,9 @@ public class StationServiceImpl implements StationService {
@Autowired
TranslateProvinceMapper translateProvinceMapper;
@Autowired
DynamicConfigService dynamicConfigService;
@Value("${station.timeDifference}")
Integer minute;
@ -249,6 +254,17 @@ public class StationServiceImpl implements StationService {
//新增电站是默认不接入光伏
station.setInverterFlag(CommonConstant.ZERO);
updateStationInfo(station);
//电站名称多语言处理
if(StringUtil.isNotBlank(station.getName())){
TranslateName translate = dynamicConfigService.getNameLanguage(station.getName());
station.setNameEn(translate.getNameEn());
station.setNameFra(translate.getNameFra());
station.setNameSpa(translate.getNameSpa());
station.setNameDe(translate.getNameDe());
station.setNamePl(translate.getNamePl());
station.setNameAra(translate.getNameAra());
}
stationMapper.insertSelective(station);
vo.setId(station.getId());
//新增图片数据
@ -310,11 +326,28 @@ public class StationServiceImpl implements StationService {
MyAddress address = AbroadAddressUtils.getAddress(String.valueOf(station.getLatitude()),String.valueOf(station.getLongitude()));
if (null != address) {
String adCode = address.getCityCode();
if(StringUtil.isEmpty(adCode)){
adCode = String.format("%05d", new Random().nextInt(100000));
}
station.setAdCode(adCode);
station.setDistrict(address.getDistrict());
station.setCity(address.getCity());
station.setProvince(address.getProvince());
TranslateName pro = dynamicConfigService.getNameLanguage(station.getProvince());
station.setProvinceEn(pro.getNameEn());
station.setProvinceFra(pro.getNameFra());
station.setProvinceSpa(pro.getNameSpa());
station.setProvinceDe(pro.getNameDe());
station.setProvincePl(pro.getNamePl());
station.setProvinceAra(pro.getNameAra());
station.setNation(address.getNation());
TranslateName na = dynamicConfigService.getNameLanguage(station.getNation());
station.setNationEn(na.getNameEn());
station.setNationFra(na.getNameFra());
station.setNationSpa(na.getNameSpa());
station.setNationDe(na.getNameDe());
station.setNationPl(na.getNamePl());
station.setNationAra(na.getNameAra());
String key = RedisKeyConstant.WEATHER_PROVINCE_CITY + adCode;
if (!redisService.hasKey(key)) {
WeatherRespVo weatherRespVo = AbroadWeatherUtils.getWeatherRespVo(String.valueOf(station.getLatitude()),String.valueOf(station.getLongitude()));
@ -373,6 +406,18 @@ public class StationServiceImpl implements StationService {
if (!(vo.getLongitude().compareTo(s.getLongitude()) == 0 && vo.getLatitude().compareTo(s.getLatitude()) == 0)) {
updateStationInfo(station);
}
// 电站名称多语言处理,名称相同是不需要处理
if(StringUtil.isNotBlank(station.getName())
&& !(vo.getName().equals(s.getName()))){
TranslateName translate = dynamicConfigService.getNameLanguage(station.getName());
station.setNameEn(translate.getNameEn());
station.setNameFra(translate.getNameFra());
station.setNameSpa(translate.getNameSpa());
station.setNameDe(translate.getNameDe());
station.setNamePl(translate.getNamePl());
station.setNameAra(translate.getNameAra());
}
station.setIccId(vo.getIccId());
stationMapper.updateByPrimaryKeySelective(station);
//调用device方法 直接进行修改
@ -712,6 +757,7 @@ public class StationServiceImpl implements StationService {
if (stationIds != null && !stationIds.isEmpty()) {
StationPageReqVO vo = new StationPageReqVO();
vo.setIds(stationIds);
vo.setLang(user.getLang());
stations = stationMapper.selectByGroupIdNotExclude(vo);
}
List<NationStation> nationList = new ArrayList<>();

View File

@ -14,10 +14,14 @@
</insert>
<insert id="insertList" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into curve_config (curve_type,curve_name,curve_name_en,auxiliary_value,is_hide,station_id,permission_id,page_location,device_id,sort)
insert into curve_config (curve_type,curve_name,curve_name_en,
curve_name_fra,curve_name_spa,curve_name_de,curve_name_pl,curve_name_ara,
auxiliary_value,is_hide,station_id,permission_id,page_location,device_id,sort)
values
<foreach item="item" collection="list" index="index" separator=",">
(#{item.curveType},#{item.curveName},#{item.curveNameEn},#{item.auxiliaryValue},#{item.isHide},#{item.stationId},#{item.permissionId},#{item.pageLocation},#{item.deviceId},#{item.sort})
(#{item.curveType},#{item.curveName},#{item.curveNameEn},
#{item.curveNameFra},#{item.curveNameSpa},#{item.curveNameDe},#{item.curveNamePl},#{item.curveNameAra},
#{item.auxiliaryValue},#{item.isHide},#{item.stationId},#{item.permissionId},#{item.pageLocation},#{item.deviceId},#{item.sort})
</foreach>
</insert>
@ -39,6 +43,21 @@
<when test="lang != null and lang=='en_US' ">
c.curve_name_en curveName,
</when>
<when test="lang != null and lang=='fr_FR' ">
c.curve_name_fra curveName,
</when>
<when test="lang != null and lang=='es_ES' ">
c.curve_name_spa curveName,
</when>
<when test="lang != null and lang=='de_DE' ">
c.curve_name_de curveName,
</when>
<when test="lang != null and lang=='pl_PL' ">
c.curve_name_pl curveName,
</when>
<when test="lang != null and lang=='ar_EG' ">
c.curve_name_ara curveName,
</when>
<otherwise>
c.curve_name,
</otherwise>
@ -86,10 +105,14 @@
</delete>
<insert id="updateList" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into curve_config (id,curve_type,curve_name,auxiliary_value,is_hide,station_id,permission_id,page_location,device_id,sort)
insert into curve_config (id,curve_type,curve_name,auxiliary_value,is_hide,
curve_name_en,curve_name_fra,curve_name_spa,curve_name_de,curve_name_pl,curve_name_ara,
station_id,permission_id,page_location,device_id,sort)
values
<foreach item="item" collection="list" index="index" separator=",">
(#{item.id},#{item.curveType},#{item.curveName},#{item.auxiliaryValue},#{item.isHide},#{item.stationId},#{item.permissionId},#{item.pageLocation},#{item.deviceId},#{item.sort})
(#{item.id},#{item.curveType},#{item.curveName},
#{item.curveNameEn},#{item.curveNameFra},#{item.curveNameSpa},#{item.curveNameDe},#{item.curveNamePl},#{item.curveNameAra},
#{item.auxiliaryValue},#{item.isHide},#{item.stationId},#{item.permissionId},#{item.pageLocation},#{item.deviceId},#{item.sort})
</foreach>
</insert>

View File

@ -32,6 +32,36 @@
producer,serial_no,status,device_json,`virtual`,from_id,hide,flow_direction,producer_type,unit_type
</sql>
<sql id="Base_Column_List2">
id,group_id,dept_id,src_id,pid,category,
station_id,device_name_fra deviceName,device_type,
producer,serial_no,status,device_json,`virtual`,from_id,hide,flow_direction,producer_type,unit_type
</sql>
<sql id="Base_Column_List3">
id,group_id,dept_id,src_id,pid,category,
station_id,device_name_spa deviceName,device_type,
producer,serial_no,status,device_json,`virtual`,from_id,hide,flow_direction,producer_type,unit_type
</sql>
<sql id="Base_Column_List4">
id,group_id,dept_id,src_id,pid,category,
station_id,device_name_de deviceName,device_type,
producer,serial_no,status,device_json,`virtual`,from_id,hide,flow_direction,producer_type,unit_type
</sql>
<sql id="Base_Column_List5">
id,group_id,dept_id,src_id,pid,category,
station_id,device_name_pl deviceName,device_type,
producer,serial_no,status,device_json,`virtual`,from_id,hide,flow_direction,producer_type,unit_type
</sql>
<sql id="Base_Column_List6">
id,group_id,dept_id,src_id,pid,category,
station_id,device_name_ara deviceName,device_type,
producer,serial_no,status,device_json,`virtual`,from_id,hide,flow_direction,producer_type,unit_type
</sql>
<select id="selectByInfo" resultType="com.ho.business.vo.resp.DeviceRespVO">
select
<include refid="Base_Column_List"/>
@ -91,6 +121,21 @@
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<when test="lang != null and lang=='fr_FR' ">
<include refid="Base_Column_List2"/>
</when>
<when test="lang != null and lang=='es_ES' ">
<include refid="Base_Column_List3"/>
</when>
<when test="lang != null and lang=='de_DE' ">
<include refid="Base_Column_List4"/>
</when>
<when test="lang != null and lang=='pl_PL' ">
<include refid="Base_Column_List5"/>
</when>
<when test="lang != null and lang=='ar_EG' ">
<include refid="Base_Column_List6"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
@ -276,6 +321,21 @@
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<when test="lang != null and lang=='fr_FR' ">
<include refid="Base_Column_List2"/>
</when>
<when test="lang != null and lang=='es_ES' ">
<include refid="Base_Column_List3"/>
</when>
<when test="lang != null and lang=='de_DE' ">
<include refid="Base_Column_List4"/>
</when>
<when test="lang != null and lang=='pl_PL' ">
<include refid="Base_Column_List5"/>
</when>
<when test="lang != null and lang=='ar_EG' ">
<include refid="Base_Column_List6"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
@ -355,6 +415,11 @@
<if test="stationId != null">station_id,</if>
<if test="deviceName != null">device_name,</if>
<if test="deviceNameEn != null">device_name_en,</if>
<if test="deviceNameFra != null">device_name_fra,</if>
<if test="deviceNameSpa != null">device_name_spa,</if>
<if test="deviceNameDe != null">device_name_de,</if>
<if test="deviceNamePl != null">device_name_pl,</if>
<if test="deviceNameAra != null">device_name_ara,</if>
<if test="deviceType != null">device_type,</if>
<if test="producer != null">producer,</if>
<if test="serialNo != null">serial_no,</if>
@ -373,6 +438,11 @@
<if test="stationId != null">#{stationId,jdbcType=INTEGER},</if>
<if test="deviceName != null">#{deviceName,jdbcType=VARCHAR},</if>
<if test="deviceNameEn != null">#{deviceNameEn,jdbcType=VARCHAR},</if>
<if test="deviceNameFra != null">#{deviceNameFra,jdbcType=VARCHAR},</if>
<if test="deviceNameSpa != null">#{deviceNameSpa,jdbcType=VARCHAR},</if>
<if test="deviceNameDe != null">#{deviceNameDe,jdbcType=VARCHAR},</if>
<if test="deviceNamePl != null">#{deviceNamePl,jdbcType=VARCHAR},</if>
<if test="deviceNameAra != null">#{deviceNameAra,jdbcType=VARCHAR},</if>
<if test="deviceType != null">#{deviceType,jdbcType=VARCHAR},</if>
<if test="producer != null">#{producer,jdbcType=VARCHAR},</if>
<if test="serialNo != null">#{serialNo,jdbcType=VARCHAR},</if>
@ -388,14 +458,16 @@
<insert id="insertBatch">
INSERT INTO device
(group_id,dept_id,src_id,pid,category,
station_id,device_name,device_name_en,device_type,
serial_no,status,`virtual`,from_id,create_time)
station_id,device_name,device_name_en,
device_name_fra,device_name_spa,device_name_de,device_name_pl,device_name_ara,
device_type,serial_no,status,`virtual`,from_id,create_time)
VALUES
<foreach item="item" collection="list" index="index" separator=",">
(
#{item.groupId},#{item.deptId},#{item.srcId},#{item.pid}
,#{item.category} ,#{item.stationId},#{item.deviceName},#{item.deviceNameEn},#{item.deviceType}
,#{item.serialNo},#{item.status},#{item.virtual},#{item.fromId},#{item.createTime}
,#{item.category} ,#{item.stationId},#{item.deviceName},#{item.deviceNameEn}
,#{item.deviceNameFra},#{item.deviceNameSpa},#{item.deviceNameDe},#{item.deviceNamePl},#{item.deviceNameAra}
,#{item.deviceType},#{item.serialNo},#{item.status},#{item.virtual},#{item.fromId},#{item.createTime}
)
</foreach>

View File

@ -38,6 +38,41 @@
max_value,min_value,specified_value,offset_value,factor,unit,
data_type,filter_type
</sql>
<sql id="Base_Column_List2">
id
,device_type_id,device_type,
device_type_name,col,col_fra colName,col_en,sens_type,is_show,is_save,
max_value,min_value,specified_value,offset_value,factor,unit,
data_type,filter_type
</sql>
<sql id="Base_Column_List3">
id
,device_type_id,device_type,
device_type_name,col,col_spa colName,col_en,sens_type,is_show,is_save,
max_value,min_value,specified_value,offset_value,factor,unit,
data_type,filter_type
</sql>
<sql id="Base_Column_List4">
id
,device_type_id,device_type,
device_type_name,col,col_de colName,col_en,sens_type,is_show,is_save,
max_value,min_value,specified_value,offset_value,factor,unit,
data_type,filter_type
</sql>
<sql id="Base_Column_List5">
id
,device_type_id,device_type,
device_type_name,col,col_pl colName,col_en,sens_type,is_show,is_save,
max_value,min_value,specified_value,offset_value,factor,unit,
data_type,filter_type
</sql>
<sql id="Base_Column_List6">
id
,device_type_id,device_type,
device_type_name,col,col_ara colName,col_en,sens_type,is_show,is_save,
max_value,min_value,specified_value,offset_value,factor,unit,
data_type,filter_type
</sql>
<sql id="Base_List">
id
@ -85,6 +120,21 @@
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<when test="lang != null and lang=='fr_FR' ">
<include refid="Base_Column_List2"/>
</when>
<when test="lang != null and lang=='es_ES' ">
<include refid="Base_Column_List3"/>
</when>
<when test="lang != null and lang=='de_DE' ">
<include refid="Base_Column_List4"/>
</when>
<when test="lang != null and lang=='pl_PL' ">
<include refid="Base_Column_List5"/>
</when>
<when test="lang != null and lang=='ar_EG' ">
<include refid="Base_Column_List6"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
@ -122,6 +172,21 @@
<when test="deviceTypeColReqVO.lang != null and deviceTypeColReqVO.lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<when test="deviceTypeColReqVO.lang != null and deviceTypeColReqVO.lang=='fr_FR' ">
<include refid="Base_Column_List2"/>
</when>
<when test="deviceTypeColReqVO.lang != null and deviceTypeColReqVO.lang=='es_ES' ">
<include refid="Base_Column_List3"/>
</when>
<when test="deviceTypeColReqVO.lang != null and deviceTypeColReqVO.lang=='de_DE' ">
<include refid="Base_Column_List4"/>
</when>
<when test="deviceTypeColReqVO.lang != null and deviceTypeColReqVO.lang=='pl_PL' ">
<include refid="Base_Column_List5"/>
</when>
<when test="deviceTypeColReqVO.lang != null and deviceTypeColReqVO.lang=='ar_EG' ">
<include refid="Base_Column_List6"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
@ -207,6 +272,21 @@
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<when test="lang != null and lang=='fr_FR' ">
<include refid="Base_Column_List2"/>
</when>
<when test="lang != null and lang=='es_ES' ">
<include refid="Base_Column_List3"/>
</when>
<when test="lang != null and lang=='de_DE' ">
<include refid="Base_Column_List4"/>
</when>
<when test="lang != null and lang=='pl_PL' ">
<include refid="Base_Column_List5"/>
</when>
<when test="lang != null and lang=='ar_EG' ">
<include refid="Base_Column_List6"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
@ -230,6 +310,21 @@
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<when test="lang != null and lang=='fr_FR' ">
<include refid="Base_Column_List2"/>
</when>
<when test="lang != null and lang=='es_ES' ">
<include refid="Base_Column_List3"/>
</when>
<when test="lang != null and lang=='de_DE' ">
<include refid="Base_Column_List4"/>
</when>
<when test="lang != null and lang=='pl_PL' ">
<include refid="Base_Column_List5"/>
</when>
<when test="lang != null and lang=='ar_EG' ">
<include refid="Base_Column_List6"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>

View File

@ -19,12 +19,16 @@
</resultMap>
<insert id="insertList" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into dynamic_config (station_id,src_id,device_type,col,col_name,col_name_en,sens_type,permission_id,page_location,div_location,sort,device_id)
insert into dynamic_config (station_id,src_id,device_type,col,col_name,col_name_en,
col_name_fra,col_name_spa,col_name_de,col_name_pl,col_name_ara,
sens_type,permission_id,page_location,div_location,sort,device_id)
values
<foreach item="item" collection="list" index="index" separator=",">
(
#{item.stationId},#{item.srcId},#{item.deviceType},#{item.col},
#{item.colName},#{item.colNameEn},#{item.sensType},#{item.permissionId},#{item.pageLocation},#{item.divLocation},#{item.sort},#{item.deviceId}
#{item.colName},#{item.colNameEn},
#{item.colNameFra},#{item.colNameSpa},#{item.colNameDe},#{item.colNamePl},#{item.colNameAra},
#{item.sensType},#{item.permissionId},#{item.pageLocation},#{item.divLocation},#{item.sort},#{item.deviceId}
)
</foreach>

View File

@ -28,19 +28,53 @@
model_name_en model_name,src_id,col,station_id,device_type,
col_name_en col_name
</sql>
<sql id="Base_Column_List2">
id
,user_id,model_id,
model_name_fra model_name,src_id,col,station_id,device_type,
col_name_en col_name
</sql>
<sql id="Base_Column_List3">
id
,user_id,model_id,
model_name_spa model_name,src_id,col,station_id,device_type,
col_name_en col_name
</sql>
<sql id="Base_Column_List4">
id
,user_id,model_id,
model_name_de model_name,src_id,col,station_id,device_type,
col_name_en col_name
</sql>
<sql id="Base_Column_List5">
id
,user_id,model_id,
model_name_pl model_name,src_id,col,station_id,device_type,
col_name_en col_name
</sql>
<sql id="Base_Column_List6">
id
,user_id,model_id,
model_name_ara model_name,src_id,col,station_id,device_type,
col_name_en col_name
</sql>
<insert id="insertBatch">
INSERT INTO his_curve_relate
(user_id,model_id,
model_name,model_name_en,src_id,col,station_id,device_type,
col_name,col_name_en)
model_name,model_name_en,
model_name_fra,model_name_spa,model_name_de,model_name_pl,model_name_ara,
src_id,col,station_id,device_type,
col_name,col_name_en,
col_name_fra,col_name_spa,col_name_de,col_name_pl, col_name_ara)
VALUES
<foreach item="item" collection="list" index="index" separator=",">
(
#{item.userId},#{item.modelId},#{item.modelName},#{item.modelNameEn},#{item.srcId}
,#{item.col} ,#{item.stationId},#{item.deviceType}
,#{item.colName},#{item.colName}
#{item.userId},#{item.modelId},#{item.modelName},#{item.modelNameEn},
#{item.modelNameFra},#{item.modelNameSpa},#{item.modelNameDe},#{item.modelNamePl},#{item.modelNameAra},
#{item.srcId},#{item.col} ,#{item.stationId},#{item.deviceType}
,#{item.colName},#{item.colNameEn},#{item.colNameFra},#{item.colNameSpa},#{item.colNameDe},#{item.colNamePl},#{item.colNameAra}
)
</foreach>
@ -52,6 +86,21 @@
<when test="hisCurveRelate.lang != null and hisCurveRelate.lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<when test="hisCurveRelate.lang != null and hisCurveRelate.lang=='fr_FR' ">
<include refid="Base_Column_List2"/>
</when>
<when test="hisCurveRelate.lang != null and hisCurveRelate.lang=='es_ES' ">
<include refid="Base_Column_List3"/>
</when>
<when test="hisCurveRelate.lang != null and hisCurveRelate.lang=='de_DE' ">
<include refid="Base_Column_List4"/>
</when>
<when test="hisCurveRelate.lang != null and hisCurveRelate.lang=='pl_PL' ">
<include refid="Base_Column_List5"/>
</when>
<when test="hisCurveRelate.lang != null and hisCurveRelate.lang=='ar_EG' ">
<include refid="Base_Column_List6"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>

View File

@ -11,6 +11,21 @@
<when test="lang != null and lang=='en_US' ">
device_name_en as label
</when>
<when test="lang != null and lang=='fr_FR' ">
device_name_fra as label
</when>
<when test="lang != null and lang=='es_ES' ">
device_name_spa as label
</when>
<when test="lang != null and lang=='de_DE' ">
device_name_de as label
</when>
<when test="lang != null and lang=='pl_PL' ">
device_name_pl as label
</when>
<when test="lang != null and lang=='ar_EG' ">
device_name_ara as label
</when>
<otherwise>
device_name as label
</otherwise>
@ -24,6 +39,21 @@
<when test="lang != null and lang=='en_US' ">
template_name_en as label
</when>
<when test="lang != null and lang=='fr_FR' ">
template_name_fra as label
</when>
<when test="lang != null and lang=='es_ES' ">
template_name_spa as label
</when>
<when test="lang != null and lang=='de_DE' ">
template_name_de as label
</when>
<when test="lang != null and lang=='pl_PL' ">
template_name_pl as label
</when>
<when test="lang != null and lang=='ar_EG' ">
template_name_ara as label
</when>
<otherwise>
template_name as label
</otherwise>
@ -127,10 +157,15 @@
<insert id="planCurveOperationRecord" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.ho.business.vo.resp.planningCurve.PlanningIssueVo">
insert into planning_curve_operation_record
(user_id,user_name,operate_time,operate_content,operate_content_en,operate_result,operate_result_en,effective_time,status,previous_planning_curve,latest_planning_curve,station_id)
(user_id,user_name,operate_time,operate_content,operate_content_en,
operate_content_fra,operate_content_spa,operate_content_de,operate_content_pl,operate_content_ara,
operate_result,operate_result_en,operate_result_fra,operate_result_spa,operate_result_de,operate_result_pl,operate_result_ara,
effective_time,status,previous_planning_curve,latest_planning_curve,station_id)
values (
#{condition.userId},#{condition.userName},#{condition.operateTime},#{condition.operateContent},#{condition.operateContentEn},
#{condition.operateResult},#{condition.operateResultEn},
#{condition.userId},#{condition.userName},#{condition.operateTime},#{condition.operateContent},
#{condition.operateContentEn},#{condition.operateContentFra},#{condition.operateContentSpa},#{condition.operateContentDe},#{condition.operateContentPl},#{condition.operateContentAra},
#{condition.operateResult},
#{condition.operateResultEn},#{condition.operateResultFra},#{condition.operateResultSpa},#{condition.operateResultDe},#{condition.operateResultPl},#{condition.operateResultAra},
#{condition.effectiveTime},#{condition.status},#{condition.previousPlanningCurve},#{condition.latestPlanningCurve},#{condition.stationId}
)
</insert>
@ -148,6 +183,21 @@
<when test="lang != null and lang=='en_US' ">
operate_content_en operate_content,
</when>
<when test="lang != null and lang=='fr_FR' ">
operate_content_fra operate_content,
</when>
<when test="lang != null and lang=='es_ES' ">
operate_content_spa operate_content,
</when>
<when test="lang != null and lang=='de_DE' ">
operate_content_de operate_content,
</when>
<when test="lang != null and lang=='pl_PL' ">
operate_content_pl operate_content,
</when>
<when test="lang != null and lang=='ar_EG' ">
operate_content_ara operate_content,
</when>
<otherwise>
operate_content,
</otherwise>
@ -156,6 +206,21 @@
<when test="lang != null and lang=='en_US' ">
operate_result_en operate_result,
</when>
<when test="lang != null and lang=='fr_FR' ">
operate_result_fra operate_content,
</when>
<when test="lang != null and lang=='es_ES' ">
operate_result_spa operate_content,
</when>
<when test="lang != null and lang=='de_DE' ">
operate_result_de operate_content,
</when>
<when test="lang != null and lang=='pl_PL' ">
operate_result_pl operate_content,
</when>
<when test="lang != null and lang=='ar_EG' ">
operate_result_ara operate_content,
</when>
<otherwise>
operate_result,
</otherwise>

View File

@ -40,6 +40,21 @@
<when test="lang != null and lang=='en_US' ">
template_name_en template_name,
</when>
<when test="lang != null and lang=='fr_FR' ">
template_name_fra template_name,
</when>
<when test="lang != null and lang=='es_ES' ">
template_name_spa template_name,
</when>
<when test="lang != null and lang=='de_DE' ">
template_name_de template_name,
</when>
<when test="lang != null and lang=='pl_PL' ">
template_name_pl template_name,
</when>
<when test="lang != null and lang=='ar_EG' ">
template_name_ara template_name,
</when>
<otherwise>
template_name,
</otherwise>
@ -51,7 +66,14 @@
id = #{temId}
</if>
<if test="templateName != null and templateName != ''">
and (template_name like concat('%',#{templateName},'%') or template_name_en like concat('%',#{templateName},'%'))
and (template_name like concat('%',#{templateName},'%') or
template_name_en like concat('%',#{templateName},'%') or
template_name_fra like concat('%',#{templateName},'%')
template_name_spa like concat('%',#{templateName},'%')
template_name_de like concat('%',#{templateName},'%')
template_name_pl like concat('%',#{templateName},'%')
template_name_ara like concat('%',#{templateName},'%')
)
</if>
<if test="status != null">
and status = #{status}
@ -76,7 +98,8 @@
<!-- 新增模板 -->
<insert id="addPlanningCurveTemplate" parameterType="com.ho.business.entity.PlanningCurveTemplate">
insert into planning_curve_template ( id,template_no,template_name,template_name_en,<!-- elec_template_id, -->
insert into planning_curve_template ( id,template_no,template_name,template_name_en,
template_name_fra,template_name_spa,template_name_de,template_name_pl,template_name_ara,
<if test="stationId != null and stationId != ''">
station_id,
</if>
@ -84,7 +107,8 @@
group_id,
</if>
income,status,p,capacity,soc_upper,soc_lower,create_time )
values( #{temId},#{templateNo},#{templateName},#{templateNameEn},<!-- #{elecTemplateId}, -->
values( #{temId},#{templateNo},#{templateName},#{templateNameEn},
#{templateNameFra},#{templateNameSpa},#{templateNameDe},#{templateNamePl},#{templateNameAra},
<if test="stationId != null and stationId != ''">
#{stationId},
</if>
@ -114,6 +138,21 @@
<if test="templateNameEn != null and templateNameEn != ''">
template_name_en = #{templateNameEn},
</if>
<if test="templateNameFra != null and templateNameFra != ''">
template_name_fra = #{templateNameFra},
</if>
<if test="templateNameSpa != null and templateNameSpa != ''">
template_name_spa = #{templateNameSpa},
</if>
<if test="templateNameDe != null and templateNameDe != ''">
template_name_de = #{templateNameDe},
</if>
<if test="templateNamePl != null and templateNamePl != ''">
template_name_pl = #{templateNamePl},
</if>
<if test="templateNameAra != null and templateNameAra != ''">
template_name_ara = #{templateNameAra},
</if>
<!--
<if test="elecTemplateId != null and elecTemplateId != ''">
elec_template_id = #{elecTemplateId},
@ -187,6 +226,21 @@
<when test="lang != null and lang=='en_US' ">
template_name_en template_name,
</when>
<when test="lang != null and lang=='fr_FR' ">
template_name_fra template_name,
</when>
<when test="lang != null and lang=='es_ES' ">
template_name_spa template_name,
</when>
<when test="lang != null and lang=='de_DE' ">
template_name_de template_name,
</when>
<when test="lang != null and lang=='pl_PL' ">
template_name_pl template_name,
</when>
<when test="lang != null and lang=='ar_EG' ">
template_name_ara template_name,
</when>
<otherwise>
template_name,
</otherwise>

View File

@ -27,12 +27,19 @@
</resultMap>
<insert id="insertList" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into point_config (name,name_en,default_value,default_value_en,point_type,station_id,permission_id,page_location,div_location,sort,device_id,offset_value,factor)
insert into point_config (name,name_en,
name_fra,name_spa,name_de,name_pl,name_ara,
default_value,default_value_en,
default_value_fra,default_value_spa,default_value_de,default_value_pl,default_value_ara,
point_type,station_id,permission_id,page_location,div_location,sort,device_id,offset_value,factor)
values
<foreach item="item" collection="list" index="index" separator=",">
(
#{item.name},#{item.nameEn},#{item.defaultValue},#{item.defaultValueEn},#{item.pointType},
#{item.stationId},#{item.permissionId},#{item.pageLocation},#{item.divLocation},#{item.sort},#{item.deviceId},#{item.offsetValue},#{item.factor}
#{item.name},#{item.nameEn},
#{item.nameFra},#{item.nameSpa},#{item.nameDe},#{item.namePl},#{item.nameAra},
#{item.defaultValue},#{item.defaultValueEn},
#{item.defaultValueFra},#{item.defaultValueSpa},#{item.defaultValueDe},#{item.defaultValuePl},#{item.defaultValueAra},
#{item.pointType},#{item.stationId},#{item.permissionId},#{item.pageLocation},#{item.divLocation},#{item.sort},#{item.deviceId},#{item.offsetValue},#{item.factor}
)
</foreach>
@ -53,14 +60,6 @@
</set>
where id = #{id}
</update>
<update id="updateNameEnById">
update ${tableName} set ${nameEn}=#{translateName} where id = #{id}
</update>
<select id="selectTableList" resultType="com.ho.business.vo.resp.dynamicConfig.PointConfigResp">
select
id,${name} name
from ${tableName} where (${nameEn} is null or ${nameEn}='') and ${name} is not null
</select>
<select id="selectByParam" resultType="com.ho.business.vo.resp.dynamicConfig.PointConfigResp">
SELECT
@ -104,6 +103,31 @@
d.col_name_en col_name,
p.default_value_en default_value,
</when>
<when test="lang != null and lang=='fr_FR' ">
p.name_fra name,
d.col_name_fra col_name,
p.default_value_fra default_value,
</when>
<when test="lang != null and lang=='es_ES' ">
p.name_spa name,
d.col_name_spa col_name,
p.default_value_spa default_value,
</when>
<when test="lang != null and lang=='de_DE' ">
p.name_de name,
d.col_name_de col_name,
p.default_value_de default_value,
</when>
<when test="lang != null and lang=='pl_PL' ">
p.name_pl name,
d.col_name_pl col_name,
p.default_value_pl default_value,
</when>
<when test="lang != null and lang=='ar_EG' ">
p.name_ara name,
d.col_name_ara col_name,
p.default_value_ara default_value,
</when>
<otherwise>
p.name,
d.col_name,
@ -151,11 +175,18 @@
</delete>
<insert id="updateList" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into point_config (id,name,name_en,default_value,default_value_en,point_type,station_id,permission_id,page_location,div_location,sort,device_id,offset_value,factor)
insert into point_config (id,name,name_en,
name_fra,name_spa,name_de,name_pl,name_ara,
default_value,default_value_en,
default_value_fra,default_value_spa,default_value_de,default_value_pl,default_value_ara,
point_type,station_id,permission_id,page_location,div_location,sort,device_id,offset_value,factor)
values
<foreach item="item" collection="list" index="index" separator=",">
(#{item.id},#{item.name},#{item.nameEn},#{item.defaultValue},#{item.defaultValueEn},#{item.pointType},
#{item.stationId},#{item.permissionId},#{item.pageLocation},#{item.divLocation},#{item.sort},#{item.deviceId},#{item.offsetValue},#{item.factor}
(#{item.id},#{item.name},#{item.nameEn},
#{item.nameFra},#{item.nameSpa},#{item.nameDe},#{item.namePl},#{item.nameAra},
#{item.defaultValue},#{item.defaultValueEn},
#{item.defaultValueFra},#{item.defaultValueSpa},#{item.defaultValueDe},#{item.defaultValuePl},#{item.defaultValueAra},
#{item.pointType},#{item.stationId},#{item.permissionId},#{item.pageLocation},#{item.divLocation},#{item.sort},#{item.deviceId},#{item.offsetValue},#{item.factor}
)
</foreach>

View File

@ -11,13 +11,33 @@
<sql id="Base_Column_List1">
id,point_id,value,name_en name,name as name_zh,name_en,symbol
</sql>
<sql id="Base_Column_List2">
id,point_id,value,name_fra name,name as name_zh,name_en,symbol
</sql>
<sql id="Base_Column_List3">
id,point_id,value,name_spa name,name as name_zh,name_en,symbol
</sql>
<sql id="Base_Column_List4">
id,point_id,value,name_de name,name as name_zh,name_en,symbol
</sql>
<sql id="Base_Column_List5">
id,point_id,value,name_pl name,name as name_zh,name_en,symbol
</sql>
<sql id="Base_Column_List6">
id,point_id,value,name_ara name,name as name_zh,name_en,symbol
</sql>
<insert id="insertList" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into point_polysemy_config (point_id,value,name,name_en,symbol)
insert into point_polysemy_config (point_id,value,name,name_en,
name_fra,name_spa,name_de,name_pl,name_ara,
symbol)
values
<foreach item="item" collection="list" index="index" separator=",">
(
#{item.pointId},#{item.value},#{item.name},#{item.nameEn},#{item.symbol}
#{item.pointId},#{item.value},#{item.name},#{item.nameEn},
#{item.nameFra},#{item.nameSpa},#{item.nameDe},#{item.namePl},#{item.nameAra},
#{item.symbol}
)
</foreach>
@ -44,6 +64,21 @@
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<when test="lang != null and lang=='fr_FR' ">
<include refid="Base_Column_List2"/>
</when>
<when test="lang != null and lang=='es_ES' ">
<include refid="Base_Column_List3"/>
</when>
<when test="lang != null and lang=='de_DE' ">
<include refid="Base_Column_List4"/>
</when>
<when test="lang != null and lang=='pl_PL' ">
<include refid="Base_Column_List5"/>
</when>
<when test="lang != null and lang=='ar_EG' ">
<include refid="Base_Column_List6"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>

View File

@ -7,14 +7,62 @@
<sql id="Base_Column_List">
id
,pid,group_id,dept_id,
`name`,name_en,address,address_en,longitude,
latitude,capacity,rate_power,
status,type,create_time,
contact,contact_details,grid_time,
,pid,group_id,dept_id,address,longitude,latitude,capacity,rate_power,
name,nation,province,
,status,type,create_time,contact,contact_details,grid_time,
update_time,deleted,is_enable,cabin_num,district,ad_code,is_daily_count,topology_type,cupboard_type,plan_version,inverter_flag,pv_power,icc_id,province,city,
electricity_type,customer_type,voltage_level,batch_number,nation
electricity_type,customer_type,voltage_level,batch_number
</sql>
<sql id="Base_Column_List1">
id
,pid,group_id,dept_id,address,longitude,latitude,capacity,rate_power,
name_en name,nation_en nation ,province_en province,
,status,type,create_time,contact,contact_details,grid_time,
update_time,deleted,is_enable,cabin_num,district,ad_code,is_daily_count,topology_type,cupboard_type,plan_version,inverter_flag,pv_power,icc_id,province,city,
electricity_type,customer_type,voltage_level,batch_number
</sql>
<sql id="Base_Column_List2">
id
,pid,group_id,dept_id,address,longitude,latitude,capacity,rate_power,
name_fra name,nation_fra nation ,province_fra province,
,status,type,create_time,contact,contact_details,grid_time,
update_time,deleted,is_enable,cabin_num,district,ad_code,is_daily_count,topology_type,cupboard_type,plan_version,inverter_flag,pv_power,icc_id,province,city,
electricity_type,customer_type,voltage_level,batch_number
</sql>
<sql id="Base_Column_List3">
id
,pid,group_id,dept_id,address,longitude,latitude,capacity,rate_power,
name_spa name,nation_spa nation ,province_spa province,
,status,type,create_time,contact,contact_details,grid_time,
update_time,deleted,is_enable,cabin_num,district,ad_code,is_daily_count,topology_type,cupboard_type,plan_version,inverter_flag,pv_power,icc_id,province,city,
electricity_type,customer_type,voltage_level,batch_number
</sql>
<sql id="Base_Column_List4">
id
,pid,group_id,dept_id,address,longitude,latitude,capacity,rate_power,
name_de name,nation_de nation ,province_de province,
,status,type,create_time,contact,contact_details,grid_time,
update_time,deleted,is_enable,cabin_num,district,ad_code,is_daily_count,topology_type,cupboard_type,plan_version,inverter_flag,pv_power,icc_id,province,city,
electricity_type,customer_type,voltage_level,batch_number
</sql>
<sql id="Base_Column_List5">
id
,pid,group_id,dept_id,address,longitude,latitude,capacity,rate_power,
name_pl name,nation_pl nation ,province_pl province,
,status,type,create_time,contact,contact_details,grid_time,
update_time,deleted,is_enable,cabin_num,district,ad_code,is_daily_count,topology_type,cupboard_type,plan_version,inverter_flag,pv_power,icc_id,province,city,
electricity_type,customer_type,voltage_level,batch_number
</sql>
<sql id="Base_Column_List6">
id
,pid,group_id,dept_id,address,longitude,latitude,capacity,rate_power,
name_ara name,nation_ara nation ,province_ara province,
,status,type,create_time,contact,contact_details,grid_time,
update_time,deleted,is_enable,cabin_num,district,ad_code,is_daily_count,topology_type,cupboard_type,plan_version,inverter_flag,pv_power,icc_id,province,city,
electricity_type,customer_type,voltage_level,batch_number
</sql>
<select id="selectByName" resultType="com.ho.business.entity.Station">
select
@ -119,7 +167,30 @@
</select>
<select id="selectByGroupIdNotExclude" resultType="com.ho.business.entity.Station">
select <include refid="Base_Column_List"/>
select
<choose>
<when test="record.lang != null and record.lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<when test="record.lang != null and record.lang=='fr_FR' ">
<include refid="Base_Column_List2"/>
</when>
<when test="record.lang != null and record.lang=='es_ES' ">
<include refid="Base_Column_List3"/>
</when>
<when test="record.lang != null and record.lang=='de_DE' ">
<include refid="Base_Column_List4"/>
</when>
<when test="record.lang != null and record.lang=='pl_PL' ">
<include refid="Base_Column_List5"/>
</when>
<when test="record.lang != null and record.lang=='ar_EG' ">
<include refid="Base_Column_List6"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
</choose>
FROM station
<where>
<if test="record.name != null and record.name != ''">
@ -152,6 +223,7 @@
<include refid="Base_Column_List"/>
FROM station
where
deleted = #{deleted}
and is_daily_count = #{dailyCount}
</select>
@ -195,6 +267,12 @@
<if test="record.groupId != null">group_id,</if>
<if test="record.deptId != null">dept_id,</if>
<if test="record.name != null">name,</if>
<if test="record.nameEn != null">name_en,</if>
<if test="record.nameFra != null">name_fra,</if>
<if test="record.nameSpa != null">name_spa,</if>
<if test="record.nameDe != null">name_de,</if>
<if test="record.namePl != null">name_pl,</if>
<if test="record.nameAra != null">name_ara,</if>
<if test="record.address != null">address,</if>
<if test="record.longitude != null">longitude,</if>
<if test="record.latitude != null">latitude,</if>
@ -220,12 +298,24 @@
<if test="record.pvPower != null">pv_power,</if>
<if test="record.iccId != null">icc_id,</if>
<if test="record.province != null">province,</if>
<if test="record.provinceEn != null">province_en,</if>
<if test="record.provinceFra != null">province_fra,</if>
<if test="record.provinceSpa != null">province_spa,</if>
<if test="record.provinceDe != null">province_de,</if>
<if test="record.provincePl != null">province_pl,</if>
<if test="record.provinceAra != null">province_ara,</if>
<if test="record.city != null">city,</if>
<if test="record.electricityType != null">electricity_type,</if>
<if test="record.customerType != null">customer_type,</if>
<if test="record.voltageLevel != null">voltage_level,</if>
<if test="record.batchNumber != null">batch_number,</if>
<if test="record.nation != null">nation,</if>
<if test="record.nationEn != null">nation_en,</if>
<if test="record.nationFra != null">nation_fra,</if>
<if test="record.nationSpa != null">nation_spa,</if>
<if test="record.nationDe != null">nation_de,</if>
<if test="record.nationPl != null">nation_pl,</if>
<if test="record.nationAra != null">nation_ara,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.id != null">#{record.id,jdbcType=INTEGER},</if>
@ -233,6 +323,12 @@
<if test="record.groupId != null">#{record.groupId,jdbcType=INTEGER},</if>
<if test="record.deptId != null">#{record.deptId,jdbcType=INTEGER},</if>
<if test="record.name != null">#{record.name,jdbcType=VARCHAR},</if>
<if test="record.nameEn != null">#{record.nameEn,jdbcType=VARCHAR},</if>
<if test="record.nameFra != null">#{record.nameFra,jdbcType=VARCHAR},</if>
<if test="record.nameSpa != null">#{record.nameSpa,jdbcType=VARCHAR},</if>
<if test="record.nameDe != null">#{record.nameDe,jdbcType=VARCHAR},</if>
<if test="record.namePl != null">#{record.namePl,jdbcType=VARCHAR},</if>
<if test="record.nameAra != null">#{record.nameAra,jdbcType=VARCHAR},</if>
<if test="record.address != null">#{record.address,jdbcType=VARCHAR},</if>
<if test="record.longitude != null">#{record.longitude,jdbcType=DECIMAL},</if>
<if test="record.latitude != null">#{record.latitude,jdbcType=DECIMAL},</if>
@ -258,12 +354,24 @@
<if test="record.pvPower != null">#{record.pvPower},</if>
<if test="record.iccId != null">#{record.iccId},</if>
<if test="record.province != null">#{record.province},</if>
<if test="record.provinceEn != null">#{record.provinceEn},</if>
<if test="record.provinceFra != null">#{record.provinceFra},</if>
<if test="record.provinceSpa != null">#{record.provinceSpa},</if>
<if test="record.provinceDe != null">#{record.provinceDe},</if>
<if test="record.provincePl != null">#{record.provincePl},</if>
<if test="record.provinceAra != null">#{record.provinceAra},</if>
<if test="record.city != null">#{record.city},</if>
<if test="record.electricityType != null">#{record.electricityType},</if>
<if test="record.customerType != null">#{record.customerType},</if>
<if test="record.voltageLevel != null">#{record.voltageLevel},</if>
<if test="record.batchNumber != null">#{record.batchNumber},</if>
<if test="record.nation != null">#{record.nation},</if>
<if test="record.nationEn != null">#{record.nationEn},</if>
<if test="record.nationFra != null">#{record.nationFra},</if>
<if test="record.nationSpa != null">#{record.nationSpa},</if>
<if test="record.nationDe != null">#{record.nationDe},</if>
<if test="record.nationPl != null">#{record.nationPl},</if>
<if test="record.nationAra != null">#{record.nationAra},</if>
</trim>
</insert>
@ -279,6 +387,24 @@
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.nameEn != null">
name = #{record.nameEn,jdbcType=VARCHAR},
</if>
<if test="record.nameFra != null">
name = #{record.nameFra,jdbcType=VARCHAR},
</if>
<if test="record.nameSpa != null">
name = #{record.nameSpa,jdbcType=VARCHAR},
</if>
<if test="record.nameDe != null">
name = #{record.nameDe,jdbcType=VARCHAR},
</if>
<if test="record.namePl != null">
name = #{record.namePl,jdbcType=VARCHAR},
</if>
<if test="record.nameAra != null">
name = #{record.nameAra,jdbcType=VARCHAR},
</if>
<if test="record.address != null">
address = #{record.address,jdbcType=VARCHAR},
</if>
@ -357,6 +483,24 @@
<if test="record.province != null">
province = #{record.province},
</if>
<if test="record.provinceEn != null">
province = #{record.provinceEn},
</if>
<if test="record.provinceFra != null">
province = #{record.provinceFra},
</if>
<if test="record.provinceSpa != null">
province = #{record.provinceSpa},
</if>
<if test="record.provinceDe != null">
province = #{record.provinceDe},
</if>
<if test="record.provincePl != null">
province = #{record.provincePl},
</if>
<if test="record.provinceAra != null">
province = #{record.provinceAra},
</if>
<if test="record.city != null">
city = #{record.city},
</if>
@ -375,6 +519,24 @@
<if test="record.nation != null">
nation = #{record.nation},
</if>
<if test="record.nationEn != null">
nation = #{record.nationEn},
</if>
<if test="record.nationFra != null">
nation = #{record.nationFra},
</if>
<if test="record.nationSpa != null">
nation = #{record.nationSpa},
</if>
<if test="record.nationDe != null">
nation = #{record.nationDe},
</if>
<if test="record.nationPl != null">
nation = #{record.nationPl},
</if>
<if test="record.nationAra != null">
nation = #{record.nationAra},
</if>
</set>
where id = #{record.id,jdbcType=INTEGER}
</update>

View File

@ -5,26 +5,32 @@
<mapper namespace="com.ho.business.mapper.TranslateNameMapper">
<sql id="Base_Column_List">
id,`name`,name_en
id,`name`,name_en,name_fra,name_spa,name_de,name_pl,name_ara
</sql>
<select id="getDictNation" resultType="com.ho.business.entity.TranslateName">
select <include refid="Base_Column_List"/> from translate_name
</select>
<select id="selectNameEN" resultType="com.ho.business.entity.TranslateName">
<select id="selectNameLang" resultType="com.ho.business.entity.TranslateName">
select <include refid="Base_Column_List"/> from translate_name where name = #{name} limit 1
</select>
<update id="updateNameEnById">
update translate_name set name_en=#{nameEn} where id = #{id}
<update id="updateById">
update translate_name
set name_en=#{vo.nameEn},name_fra=#{vo.nameFra},
name_spa = #{vo.nameSpa},name_de=#{vo.nameDe},
name_pl = #{vo.namePl},name_ara = #{vo.nameAra}
where id = #{vo.id}
</update>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ho.business.entity.TranslateName"
useGeneratedKeys="true">
insert into translate_name
( id, name, name_en)
values ( #{vo.id,jdbcType=INTEGER}, #{vo.name,jdbcType=VARCHAR}, #{vo.nameEn,jdbcType=VARCHAR})
( id, name, name_en,name_fra,name_spa,name_de,name_pl,name_ara)
values ( #{vo.id,jdbcType=INTEGER}, #{vo.name,jdbcType=VARCHAR}, #{vo.nameEn,jdbcType=VARCHAR},
#{vo.nameFra,jdbcType=VARCHAR},#{vo.nameSpa,jdbcType=VARCHAR},#{vo.nameDe,jdbcType=VARCHAR},
#{vo.namePl,jdbcType=VARCHAR},#{vo.nameAra,jdbcType=VARCHAR})
</insert>
</mapper>

View File

@ -17,6 +17,21 @@
<when test="lang != null and lang=='en_US' ">
b.col_en col_name,
</when>
<when test="lang != null and lang=='fr_FR' ">
b.col_fra col_name,
</when>
<when test="lang != null and lang=='es_ES' ">
b.col_spa col_name,
</when>
<when test="lang != null and lang=='de_DE' ">
b.col_de col_name,
</when>
<when test="lang != null and lang=='pl_PL' ">
b.col_pl col_name,
</when>
<when test="lang != null and lang=='ar_EG' ">
b.col_ara col_name,
</when>
<otherwise>
a.col_name,
</otherwise>