海外平台-数据全英文化

This commit is contained in:
2025-09-18 14:05:01 +08:00
parent e6b6ccd804
commit 83eff7d1ee
112 changed files with 2151 additions and 344 deletions

View File

@ -35,9 +35,14 @@
<select id="selectByParam" resultType="com.ho.business.vo.resp.dynamicConfig.CurveConfigResp">
SELECT
c.id,
c.curve_name,
c.curve_name as curve_name_zh,
c.curve_name_en,
<choose>
<when test="lang != null and lang=='en_US' ">
c.curve_name_en curveName,
</when>
<otherwise>
c.curve_name,
</otherwise>
</choose>
c.curve_type,
c.auxiliary_value,
c.station_id,

View File

@ -26,6 +26,12 @@
producer,serial_no,status,device_json,`virtual`,from_id,hide,flow_direction,producer_type,unit_type
</sql>
<sql id="Base_Column_List1">
id,group_id,dept_id,src_id,pid,category,
station_id,device_name_en 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"/>
@ -81,7 +87,14 @@
<select id="selectByCondition" resultType="com.ho.business.vo.resp.DeviceRespVO">
select
<include refid="Base_Column_List"/>
<choose>
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
</choose>
from device
<where>
<if test="stationId != null">
@ -259,7 +272,14 @@
</select>
<select id="selectByIdAndSrcIdNotZero" resultType="com.ho.business.vo.resp.DeviceRespVO">
SELECT
<include refid="Base_Column_List"/>
<choose>
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
</choose>
FROM `device`
<where>
<if test="needHide == null">
@ -334,6 +354,7 @@
<if test="category != null">category,</if>
<if test="stationId != null">station_id,</if>
<if test="deviceName != null">device_name,</if>
<if test="deviceNameEn != null">device_name_en,</if>
<if test="deviceType != null">device_type,</if>
<if test="producer != null">producer,</if>
<if test="serialNo != null">serial_no,</if>
@ -351,6 +372,7 @@
<if test="category != null">#{category,jdbcType=INTEGER},</if>
<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="deviceType != null">#{deviceType,jdbcType=VARCHAR},</if>
<if test="producer != null">#{producer,jdbcType=VARCHAR},</if>
<if test="serialNo != null">#{serialNo,jdbcType=VARCHAR},</if>
@ -366,13 +388,13 @@
<insert id="insertBatch">
INSERT INTO device
(group_id,dept_id,src_id,pid,category,
station_id,device_name,device_type,
station_id,device_name,device_name_en,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.deviceType}
,#{item.category} ,#{item.stationId},#{item.deviceName},#{item.deviceNameEn},#{item.deviceType}
,#{item.serialNo},#{item.status},#{item.virtual},#{item.fromId},#{item.createTime}
)
</foreach>

View File

@ -31,6 +31,14 @@
data_type,filter_type
</sql>
<sql id="Base_Column_List1">
id
,device_type_id,device_type,
device_type_name,col,col_en 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
,device_type_id,device_type,
@ -73,7 +81,14 @@
<select id="selectByDeviceType" resultType="com.ho.business.entity.DeviceTypeCol">
select
<include refid="Base_Column_List"/>
<choose>
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
</choose>
from device_type_col
<where>
<if test="deviceType != null">
@ -103,7 +118,14 @@
<select id="selectByDeviceTypeList" resultType="com.ho.business.entity.DeviceTypeCol">
select
<include refid="Base_Column_List"/>
<choose>
<when test="deviceTypeColReqVO.lang != null and deviceTypeColReqVO.lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
</choose>
from device_type_col
<where>
<if test="deviceTypeColReqVO.deviceTypeList != null and deviceTypeColReqVO.deviceTypeList.size !=0">
@ -116,7 +138,7 @@
and is_save = #{deviceTypeColReqVO.isSave}
</if>
<if test="deviceTypeColReqVO.name != null">
and (col_name LIKE concat('%',#{deviceTypeColReqVO.name},'%') or col LIKE
and (col_name LIKE concat('%',#{deviceTypeColReqVO.name},'%') or col_en LIKE concat('%',#{deviceTypeColReqVO.name},'%') or col LIKE
concat('%',#{deviceTypeColReqVO.name},'%'))
</if>
<if test="deviceTypeColReqVO.sensType != null">
@ -181,7 +203,14 @@
<select id="selectSameCol" resultType="com.ho.business.entity.DeviceTypeCol">
select
<include refid="Base_Column_List"/>
<choose>
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
</choose>
from device_type_col
<where>
<if test="deviceType != null">
@ -197,7 +226,14 @@
</select>
<select id="selectTypeAndCol" resultType="com.ho.business.entity.DeviceTypeCol">
select
<include refid="Base_Column_List"/>
<choose>
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
</choose>
from device_type_col
<where>
<if test="deviceType != null">

View File

@ -22,18 +22,25 @@
col_name
</sql>
<sql id="Base_Column_List1">
id
,user_id,model_id,
model_name_en 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,src_id,col,station_id,device_type,
col_name)
model_name,model_name_en,src_id,col,station_id,device_type,
col_name,col_name_en)
VALUES
<foreach item="item" collection="list" index="index" separator=",">
(
#{item.userId},#{item.modelId},#{item.modelName},#{item.srcId}
#{item.userId},#{item.modelId},#{item.modelName},#{item.modelNameEn},#{item.srcId}
,#{item.col} ,#{item.stationId},#{item.deviceType}
,#{item.colName}
,#{item.colName},#{item.colName}
)
</foreach>
@ -41,7 +48,14 @@
<select id="selectAll" resultType="com.ho.business.entity.HisCurveRelate">
select
<include refid="Base_Column_List"/>
<choose>
<when test="hisCurveRelate.lang != null and hisCurveRelate.lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
</choose>
from his_curve_relate
<where>
<if test="hisCurveRelate.stationId!=null">

View File

@ -6,12 +6,29 @@
<select id="getIssueDevices" resultType="HashMap">
select
src_id as value, device_name as label
src_id as value,
<choose>
<when test="lang != null and lang=='en_US' ">
device_name_en as label
</when>
<otherwise>
device_name as label
</otherwise>
</choose>
from device where (device_type like 'agc%' or device_type like 'planCurve%' ) and station_id = #{stationId}
</select>
<select id="getTemplate" resultType="HashMap">
select id as value,template_name as label from planning_curve_template
select id as value,
<choose>
<when test="lang != null and lang=='en_US' ">
template_name_en as label
</when>
<otherwise>
template_name as label
</otherwise>
</choose>
from planning_curve_template
where ( station_id = #{stationId} or station_id is null ) and status = 1
</select>
@ -110,11 +127,12 @@
<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_result,effective_time,status,previous_planning_curve,latest_planning_curve,station_id)
values (
#{condition.userId},#{condition.userName},#{condition.operateTime},#{condition.operateContent},#{condition.operateResult},
#{condition.effectiveTime},#{condition.status},#{condition.previousPlanningCurve},#{condition.latestPlanningCurve},#{condition.stationId}
)
(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)
values (
#{condition.userId},#{condition.userName},#{condition.operateTime},#{condition.operateContent},#{condition.operateContentEn},
#{condition.operateResult},#{condition.operateResultEn},
#{condition.effectiveTime},#{condition.status},#{condition.previousPlanningCurve},#{condition.latestPlanningCurve},#{condition.stationId}
)
</insert>
<insert id="addPlanningCurveHistory" parameterType="com.ho.business.entity.PlanningCurveHistory">
@ -125,8 +143,25 @@
</insert>
<select id="getPlanCurveOperationList" resultType="com.ho.business.entity.PlanCurveOperationRecordReq">
select user_id,user_name,operate_time,operate_content,operate_result,effective_time,status,previous_planning_curve,latest_planning_curve,station_id from
planning_curve_operation_record where station_id = #{stationId} order by operate_time desc
select user_id,user_name,operate_time,
<choose>
<when test="lang != null and lang=='en_US' ">
operate_content_en operate_content,
</when>
<otherwise>
operate_content,
</otherwise>
</choose>
<choose>
<when test="lang != null and lang=='en_US' ">
operate_result_en operate_result,
</when>
<otherwise>
operate_result,
</otherwise>
</choose>
effective_time,status,previous_planning_curve,latest_planning_curve,station_id from
planning_curve_operation_record where station_id = #{stationId} order by operate_time desc
</select>
<select id="getPlanningCurveHistory" resultType="com.ho.business.entity.PlanningCurveHistory">

View File

@ -35,14 +35,23 @@
tem.elec_template_id elec_template_id, tem.status status, date_format(tem.update_time,'%Y-%m-%d %H:%i:%s') update_time, tem.p tem_p, tem.capacity, tem.soc_upper,
tem.soc_lower, cur.id id, cur.start_time start_time, cur.end_time end_time, cur.p p, cur.q q, cur.soc soc,cur.planning_template_id
from (
select id,template_no,template_name,elec_template_id,station_id,group_id,income,status,p,capacity,soc_upper,soc_lower,create_time,update_time
select id,template_no,
<choose>
<when test="lang != null and lang=='en_US' ">
template_name_en template_name,
</when>
<otherwise>
template_name,
</otherwise>
</choose>
elec_template_id,station_id,group_id,income,status,p,capacity,soc_upper,soc_lower,create_time,update_time
from planning_curve_template
<where>
<if test="temId != null and temId != ''">
id = #{temId}
</if>
<if test="templateName != null and templateName != ''">
and template_name like concat('%',#{templateName},'%')
and (template_name like concat('%',#{templateName},'%') or template_name_en like concat('%',#{templateName},'%'))
</if>
<if test="status != null">
and status = #{status}
@ -57,7 +66,7 @@
<if test="pageNum != null and pageSize != null" >
limit ${pageNum},${pageSize}
</if>
)tem left join planning_curve cur on cur.planning_template_id = tem.id
)tem left join planning_curve cur on cur.planning_template_id = tem.id
order by tem.create_time,tem.update_time desc, cur.start_time
</select>
@ -67,22 +76,22 @@
<!-- 新增模板 -->
<insert id="addPlanningCurveTemplate" parameterType="com.ho.business.entity.PlanningCurveTemplate">
insert into planning_curve_template ( id,template_no,template_name,<!-- elec_template_id, -->
<if test="stationId != null and stationId != ''">
station_id,
</if>
<if test="groupId != null and groupId != ''">
group_id,
</if>
income,status,p,capacity,soc_upper,soc_lower,create_time )
values( #{temId},#{templateNo},#{templateName},<!-- #{elecTemplateId}, -->
<if test="stationId != null and stationId != ''">
#{stationId},
</if>
<if test="groupId != null and groupId != ''">
#{groupId},
</if>
#{income},#{status},#{temP},#{capacity},#{socUpper},#{socLower},sysdate() )
insert into planning_curve_template ( id,template_no,template_name,template_name_en,<!-- elec_template_id, -->
<if test="stationId != null and stationId != ''">
station_id,
</if>
<if test="groupId != null and groupId != ''">
group_id,
</if>
income,status,p,capacity,soc_upper,soc_lower,create_time )
values( #{temId},#{templateNo},#{templateName},#{templateNameEn},<!-- #{elecTemplateId}, -->
<if test="stationId != null and stationId != ''">
#{stationId},
</if>
<if test="groupId != null and groupId != ''">
#{groupId},
</if>
#{income},#{status},#{temP},#{capacity},#{socUpper},#{socLower},sysdate() )
</insert>
<!-- 新增曲线 -->
@ -102,6 +111,9 @@
<if test="templateName != null and templateName != ''">
template_name = #{templateName},
</if>
<if test="templateNameEn != null and templateNameEn != ''">
template_name_en = #{templateNameEn},
</if>
<!--
<if test="elecTemplateId != null and elecTemplateId != ''">
elec_template_id = #{elecTemplateId},
@ -170,7 +182,16 @@
tem.elec_template_id elec_template_id, tem.status status, tem.update_time update_time, tem.p tem_p, tem.capacity, tem.soc_upper,
tem.soc_lower, cur.id id, cur.start_time start_time, cur.end_time end_time, ifnull(cur.p,0) p, ifnull(cur.q,0) q, cur.soc soc,cur.planning_template_id
from (
select id,template_no,template_name,elec_template_id,station_id,group_id,income,status,p,capacity,soc_upper,soc_lower,create_time,update_time
select id,template_no,
<choose>
<when test="lang != null and lang=='en_US' ">
template_name_en template_name,
</when>
<otherwise>
template_name,
</otherwise>
</choose>
elec_template_id,station_id,group_id,income,status,p,capacity,soc_upper,soc_lower,create_time,update_time
from planning_curve_template
<where>
<if test="temId != null and temId != ''">
@ -189,7 +210,7 @@
and group_id = #{groupId} or group_id is null
</if>
</where>
) tem left join planning_curve cur on cur.planning_template_id = tem.id
) tem left join planning_curve cur on cur.planning_template_id = tem.id
order by tem.create_time,tem.update_time desc, cur.start_time
</select>

View File

@ -27,11 +27,11 @@
</resultMap>
<insert id="insertList" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into point_config (name,name_en,default_value,point_type,station_id,permission_id,page_location,div_location,sort,device_id,offset_value,factor)
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)
values
<foreach item="item" collection="list" index="index" separator=",">
(
#{item.name},#{item.nameEn},#{item.defaultValue},#{item.pointType},
#{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}
)
</foreach>
@ -53,6 +53,14 @@
</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
@ -90,10 +98,18 @@
<select id="selectByParamNew" resultMap="baseMap">
SELECT
p.id,
p.name,
p.name as name_zh,
p.name_en,
p.default_value,
<choose>
<when test="lang != null and lang=='en_US' ">
p.name_en name,
d.col_name_en col_name,
p.default_value_en default_value,
</when>
<otherwise>
p.name,
d.col_name,
p.default_value,
</otherwise>
</choose>
p.point_type,
p.station_id,
p.permission_id,
@ -106,9 +122,6 @@
d.src_id,
d.device_type,
d.col,
d.col_name,
d.col_name as col_name_zh,
d.col_name_en,
d.sens_type
FROM
point_config p
@ -138,10 +151,10 @@
</delete>
<insert id="updateList" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
insert into point_config (id,name,name_en,default_value,point_type,station_id,permission_id,page_location,div_location,sort,device_id,offset_value,factor)
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)
values
<foreach item="item" collection="list" index="index" separator=",">
(#{item.id},#{item.name},#{item.nameEn},#{item.defaultValue},#{item.pointType},
(#{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}
)
</foreach>

View File

@ -8,6 +8,10 @@
id,point_id,value,name,name as name_zh,name_en,symbol
</sql>
<sql id="Base_Column_List1">
id,point_id,value,name_en 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)
values
@ -35,7 +39,15 @@
</update>
<select id="selectByPointIds" resultType="com.ho.business.entity.PointPolysemyConfig">
select <include refid="Base_Column_List"/>
select
<choose>
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"/>
</when>
<otherwise>
<include refid="Base_Column_List"/>
</otherwise>
</choose>
from point_polysemy_config
<where>
<if test="ids != null and ids.size() != 0">

View File

@ -0,0 +1,30 @@
<?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.ho.business.mapper.TranslateNameMapper">
<sql id="Base_Column_List">
id,`name`,name_en
</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 <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>
<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})
</insert>
</mapper>

View File

@ -1,15 +0,0 @@
<?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.ho.business.mapper.TranslateNationMapper">
<sql id="Base_Column_List">
id,`name`,name_en
</sql>
<select id="getDictNation" resultType="com.ho.business.entity.TranslateNation">
select <include refid="Base_Column_List"/> from translate_nation
</select>
</mapper>

View File

@ -12,7 +12,16 @@
<select id="selectVirtualDeviceCol" resultType="com.ho.business.vo.resp.VirtualDeviceColResp">
select
<include refid="Base_Column_List"/>,factor,offset_value
FROM (select a.*,b.factor,b.offset_value from virtual_device_col a left join device_type_col b on
FROM (select a.id,a.station_id,a.src_id,a.device_col_id,a.col,
<choose>
<when test="lang != null and lang=='en_US' ">
b.col_en col_name,
</when>
<otherwise>
a.col_name,
</otherwise>
</choose>
a.type,b.factor,b.offset_value from virtual_device_col a left join device_type_col b on
a.device_col_id = b.id ) col
<where>
<if test="id != null">