海外平台-数据全英文化
This commit is contained in:
@ -6,7 +6,14 @@
|
||||
|
||||
<select id="selectByInfo" resultType="com.ho.flow.vo.resp.event.EventRespVO">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
<choose>
|
||||
<when test="record.lang != null and record.lang=='en_US' ">
|
||||
<include refid="Base_Column_List1"/>
|
||||
</when>
|
||||
<otherwise>
|
||||
<include refid="Base_Column_List"/>
|
||||
</otherwise>
|
||||
</choose>
|
||||
from event
|
||||
<where>
|
||||
<if test="record.targetDevice != null">
|
||||
@ -160,6 +167,17 @@
|
||||
category,type,sub_type,sens_type,is_recovery,before_event_id
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Column_List1">
|
||||
id
|
||||
,station_id,dept_id,group_id,
|
||||
event_type,event_level,time_stamp,
|
||||
target_device,device_type, device_type_id, `signal`,`status`,
|
||||
value,description_en description ,confirm_status,
|
||||
confirm_man,confirm_time,remark,
|
||||
suggestion,create_time,update_time,
|
||||
category,type,sub_type,sens_type,is_recovery,before_event_id
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectByPrimaryKey" resultType="com.ho.flow.vo.Event">
|
||||
select
|
||||
@ -325,14 +343,14 @@
|
||||
id,station_id,dept_id,group_id,
|
||||
event_type,event_level,time_stamp,
|
||||
target_device,device_type, device_type_id,`signal`,status,
|
||||
`value`,`description`,confirm_status,
|
||||
`value`,`description`,description_en,confirm_status,
|
||||
confirm_man,confirm_time,remark,
|
||||
suggestion,category,type,sub_type,sens_type,is_recovery,before_event_id
|
||||
) values(
|
||||
#{id},#{stationId},#{deptId},#{groupId},
|
||||
#{eventType},#{eventLevel},#{timeStamp},
|
||||
#{targetDevice},#{deviceType}, #{deviceTypeId},#{signal},#{status},
|
||||
#{value},#{description},#{confirmStatus},
|
||||
#{value},#{description},#{descriptionEn},#{confirmStatus},
|
||||
#{confirmMan},#{confirmTime},#{remark},
|
||||
#{suggestion},#{category},#{type},#{subType},#{sensType},#{isRecovery},#{beforeEventId}
|
||||
)
|
||||
@ -403,7 +421,7 @@
|
||||
id,station_id,dept_id,group_id,
|
||||
event_type,event_level,time_stamp,
|
||||
target_device,device_type, device_type_id,`signal`,status,
|
||||
`value`,`description`,confirm_status,
|
||||
`value`,`description`,description_en,confirm_status,
|
||||
confirm_man,confirm_time,remark,
|
||||
suggestion,category,type,sub_type,sens_type,is_recovery,before_event_id
|
||||
)
|
||||
@ -413,7 +431,7 @@
|
||||
#{item.id},#{item.stationId},#{item.deptId},#{item.groupId},
|
||||
#{item.eventType},#{item.eventLevel},#{item.timeStamp},
|
||||
#{item.targetDevice},#{item.deviceType}, #{item.deviceTypeId},#{item.signal},#{item.status},
|
||||
#{item.value},#{item.description},#{item.confirmStatus},
|
||||
#{item.value},#{item.description},#{item.descriptionEn},#{item.confirmStatus},
|
||||
#{item.confirmMan},#{item.confirmTime},#{item.remark},
|
||||
#{item.suggestion},#{item.category},#{item.type},#{item.subType},#{item.sensType},#{item.isRecovery},#{item.beforeEventId}
|
||||
)
|
||||
@ -431,6 +449,9 @@
|
||||
<if test="event.description != null">
|
||||
description = #{event.description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="event.descriptionEn != null">
|
||||
description_en = #{event.descriptionEn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="event.updateTime != null">
|
||||
update_time = #{event.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
@ -778,4 +799,14 @@
|
||||
<select id="eventDeviceNum" resultType="java.lang.Integer">
|
||||
SELECT count(0) faultDevice FROM event where status = 0 and station_id = #{vo.stationId} group by target_device
|
||||
</select>
|
||||
|
||||
<select id="selectTableList" resultType="com.ho.flow.vo.EventVo">
|
||||
select
|
||||
id,${name} name
|
||||
from ${tableName} where (${nameEn} is null or ${nameEn}='') and ${name} is not null
|
||||
</select>
|
||||
|
||||
<update id="updateNameEnById">
|
||||
update ${tableName} set ${nameEn}=#{translateName} where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
@ -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.flow.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>
|
||||
Reference in New Issue
Block a user