Files
smart_storage_java/business-service-dao/src/main/resources/mapper/StationMapper.xml

655 lines
31 KiB
XML
Raw Normal View History

2025-06-30 10:11:32 +08:00
<?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.StationMapper">
<sql id="Base_Column_List_All">
id
,pid,group_id,dept_id,address,longitude,latitude,capacity,rate_power,
name,name_en,name_fra,name_spa,name_de,name_pl,name_ara,
nation,nation_en,nation_fra,nation_spa,nation_de,nation_pl,nation_ara,
province,province_en,province_fra,province_spa,province_de,province_pl,province_ara,
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>
2025-06-30 10:11:32 +08:00
<sql id="Base_Column_List">
id
,pid,group_id,dept_id,address,longitude,latitude,capacity,rate_power,
name,nation,province,
status,type,create_time,contact,contact_details,grid_time,
2025-11-28 10:04:04 +08:00
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
2025-06-30 10:11:32 +08:00
</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>
2025-06-30 10:11:32 +08:00
<select id="selectByName" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List"/>
from station
where name = #{name,jdbcType=VARCHAR}
and deleted = 1
</select>
<select id="getByName" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List"/>
from station
where name LIKE concat('%',#{name},'%')
</select>
<select id="selectByDimName" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List"/>
from station
where name LIKE concat('%',#{name},'%')
and group_id = #{groupId}
and deleted = 1
</select>
<select id="selectByPrimaryKey" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List_All"/>
2025-06-30 10:11:32 +08:00
from station
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByIds" resultType="com.ho.business.entity.Station">
select
<choose>
<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>
</choose>
2025-06-30 10:11:32 +08:00
from station
<where>
<if test="ids != null and ids.size() != 0">
and id in
<foreach collection="ids" open="(" close=")" separator="," item="item">
#{item}
</foreach>
</if>
</where>
</select>
<select id="selectByNameAndId" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List"/>
from station
where id != #{id,jdbcType=INTEGER}
and name = #{name,jdbcType=VARCHAR}
and dept_id = #{deptId}
and deleted = 1
</select>
<select id="selectAll" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List"/>
from station
where deleted = 1
</select>
<select id="selectByInverterFlag" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List"/>
from station
where inverter_flag = #{inverterFlag}
and deleted = 1
</select>
<select id="selectByCondition" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List"/>
from station
where deleted = 1
<if test="record.name != null and record.name != ''">
and name LIKE concat('%',#{record.name},'%')
</if>
<if test="record.startTime != null">
and grid_time &gt;= #{record.startTime}
</if>
<if test="record.endTime != null">
and grid_time &lt;= #{record.endTime}
</if>
<if test="depts != null and depts.size != 0">
and dept_id in
<foreach collection="depts" open="(" close=")" separator="," item="item">
#{item}
</foreach>
</if>
</select>
<select id="selectByDeptId" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List"/>
FROM station
where dept_id= #{deptId}
and deleted = 1
</select>
<select id="selectByGroupIdNotExclude" resultType="com.ho.business.entity.Station">
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>
2025-06-30 10:11:32 +08:00
FROM station
<where>
<if test="record.name != null and record.name != ''">
and `name` LIKE concat('%',#{record.name},'%')
</if>
<if test="record.batchNumber != null and record.batchNumber != ''">
and batch_number LIKE concat('%',#{record.batchNumber},'%')
</if>
<if test="record.startTime != null">
and grid_time &gt;= #{record.startTime}
</if>
<if test="record.endTime != null">
and grid_time &lt;= #{record.endTime}
</if>
<if test="record.groupId != null">
and group_id = #{record.groupId}
</if>
<if test="record.ids != null and record.ids.size() != 0">
and id in
<foreach collection="record.ids" open="(" close=")" separator="," item="item">
#{item}
</foreach>
</if>
and deleted = 1
</where>
</select>
<select id="selectStatistics" resultType="com.ho.business.entity.Station">
select
<include refid="Base_Column_List"/>
FROM station
where
2025-06-30 10:11:32 +08:00
deleted = #{deleted}
and is_daily_count = #{dailyCount}
</select>
<delete id="deleteByPrimaryKey">
delete
from station
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ho.business.entity.Station"
useGeneratedKeys="true">
insert into station
( id, pid, group_id, dept_id
, name, address, longitude
, latitude, capacity, rate_power
, contact, contact_details, grid_time
, status, type, create_time
, update_time, deleted, is_enable,batch_number)
values ( #{record.id,jdbcType=INTEGER}, #{record.pId,jdbcType=INTEGER}, #{record.groupId,jdbcType=INTEGER}
, #{record.deptId,jdbcType=INTEGER}
, #{record.name,jdbcType=VARCHAR}, #{record.address,jdbcType=VARCHAR}
, #{record.longitude,jdbcType=DECIMAL}
, #{record.latitude,jdbcType=DECIMAL}, #{record.capacity,jdbcType=DECIMAL}
, #{record.ratePower,jdbcType=DECIMAL}
, #{record.contact,jdbcType=VARCHAR}, #{record.contactDetails,jdbcType=VARCHAR}
, #{record.gridTime,jdbcType=TIMESTAMP}
, #{record.status,jdbcType=VARCHAR}, #{record.type,jdbcType=VARCHAR}
, #{record.createTime,jdbcType=TIMESTAMP}
, #{record.updateTime,jdbcType=TIMESTAMP}, #{record.deleted,jdbcType=TINYINT}
, #{record.isEnable}
, #{record.cabinNum}
,#{record.batchNumber})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ho.business.entity.Station"
useGeneratedKeys="true">
insert into station
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.id != null">id,</if>
<if test="record.pId != null">pid,</if>
<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>
2025-06-30 10:11:32 +08:00
<if test="record.address != null">address,</if>
<if test="record.longitude != null">longitude,</if>
<if test="record.latitude != null">latitude,</if>
<if test="record.capacity != null">capacity,</if>
<if test="record.ratePower != null">rate_power,</if>
<if test="record.contact != null">contact,</if>
<if test="record.contactDetails != null">contact_details,</if>
<if test="record.gridTime != null">grid_time,</if>
<if test="record.status != null">status,</if>
<if test="record.type != null">type,</if>
<if test="record.createTime != null">create_time,</if>
<if test="record.updateTime != null">update_time,</if>
<if test="record.deleted != null">deleted,</if>
<if test="record.isEnable != null">is_enable,</if>
<if test="record.cabinNum != null">cabin_num,</if>
<if test="record.district != null">district,</if>
<if test="record.adCode != null">ad_code,</if>
<if test="record.isDailyCount != null">is_daily_count,</if>
<if test="record.topologyType != null">topology_type,</if>
<if test="record.cupboardType != null">cupboard_type,</if>
<if test="record.planVersion != null">plan_version,</if>
<if test="record.inverterFlag != null">inverter_flag,</if>
2025-11-28 10:04:04 +08:00
<if test="record.pvPower != null">pv_power,</if>
2025-06-30 10:11:32 +08:00
<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>
2025-06-30 10:11:32 +08:00
<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>
2025-06-30 10:11:32 +08:00
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.id != null">#{record.id,jdbcType=INTEGER},</if>
<if test="record.pId != null">#{record.pId,jdbcType=INTEGER},</if>
<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>
2025-06-30 10:11:32 +08:00
<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>
<if test="record.capacity != null">#{record.capacity,jdbcType=DECIMAL},</if>
<if test="record.ratePower != null">#{record.ratePower,jdbcType=DECIMAL},</if>
<if test="record.contact != null">#{record.contact,jdbcType=VARCHAR},</if>
<if test="record.contactDetails != null">#{record.contactDetails,jdbcType=VARCHAR},</if>
<if test="record.gridTime != null">#{record.gridTime,jdbcType=TIMESTAMP},</if>
<if test="record.status != null">#{record.status,jdbcType=VARCHAR},</if>
<if test="record.type != null">#{record.type,jdbcType=VARCHAR},</if>
<if test="record.createTime != null">#{record.createTime,jdbcType=TIMESTAMP},</if>
<if test="record.updateTime != null">#{record.updateTime,jdbcType=TIMESTAMP},</if>
<if test="record.deleted != null">#{record.deleted,jdbcType=TINYINT},</if>
<if test="record.isEnable != null">#{record.isEnable},</if>
<if test="record.cabinNum != null">#{record.cabinNum},</if>
<if test="record.district != null">#{record.district},</if>
<if test="record.adCode != null">#{record.adCode},</if>
<if test="record.isDailyCount != null">#{record.isDailyCount},</if>
<if test="record.topologyType != null">#{record.topologyType},</if>
<if test="record.cupboardType != null">#{record.cupboardType},</if>
<if test="record.planVersion != null">#{record.planVersion},</if>
<if test="record.inverterFlag != null">#{record.inverterFlag},</if>
2025-11-28 10:04:04 +08:00
<if test="record.pvPower != null">#{record.pvPower},</if>
2025-06-30 10:11:32 +08:00
<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>
2025-06-30 10:11:32 +08:00
<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>
2025-06-30 10:11:32 +08:00
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ho.business.entity.Station">
update station
<set>
<if test="record.groupId != null">
group_id = #{record.groupId,jdbcType=INTEGER},
</if>
<if test="record.deptId != null">
dept_id = #{record.deptId,jdbcType=INTEGER},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.nameEn != null">
name_en = #{record.nameEn,jdbcType=VARCHAR},
</if>
<if test="record.nameFra != null">
name_fra = #{record.nameFra,jdbcType=VARCHAR},
</if>
<if test="record.nameSpa != null">
name_spa = #{record.nameSpa,jdbcType=VARCHAR},
</if>
<if test="record.nameDe != null">
name_de = #{record.nameDe,jdbcType=VARCHAR},
</if>
<if test="record.namePl != null">
name_pl = #{record.namePl,jdbcType=VARCHAR},
</if>
<if test="record.nameAra != null">
name_ara = #{record.nameAra,jdbcType=VARCHAR},
</if>
2025-06-30 10:11:32 +08:00
<if test="record.address != null">
address = #{record.address,jdbcType=VARCHAR},
</if>
<if test="record.longitude != null">
longitude = #{record.longitude,jdbcType=DECIMAL},
</if>
<if test="record.latitude != null">
latitude = #{record.latitude,jdbcType=DECIMAL},
</if>
<if test="record.capacity != null">
capacity = #{record.capacity,jdbcType=DECIMAL},
</if>
<if test="record.ratePower != null">
rate_power = #{record.ratePower,jdbcType=DECIMAL},
</if>
<if test="record.contact != null">
contact = #{record.contact,jdbcType=VARCHAR},
</if>
<if test="record.contactDetails != null">
contact_details = #{record.contactDetails,jdbcType=VARCHAR},
</if>
<if test="record.gridTime != null">
grid_time = #{record.gridTime,jdbcType=TIMESTAMP},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted,jdbcType=TINYINT},
</if>
<if test="record.isEnable != null">
is_enable = #{record.isEnable,jdbcType=TINYINT},
</if>
<if test="record.cabinNum != null">
cabin_num = #{record.cabinNum},
</if>
<if test="record.district != null">
district = #{record.district},
</if>
<if test="record.adCode != null">
ad_code = #{record.adCode},
</if>
<if test="record.isDailyCount != null">
is_daily_count = #{record.isDailyCount},
</if>
<if test="record.topologyType != null">
topology_type = #{record.topologyType},
</if>
<if test="record.cupboardType != null">
cupboard_type = #{record.cupboardType},
</if>
<if test="record.planVersion != null">
plan_version = #{record.planVersion},
</if>
<if test="record.inverterFlag != null">
inverter_flag = #{record.inverterFlag},
</if>
2025-11-28 10:04:04 +08:00
<if test="record.pvPower != null">
pv_power = #{record.pvPower,jdbcType=DECIMAL},
</if>
2025-06-30 10:11:32 +08:00
<if test="record.iccId != null">
icc_id = #{record.iccId},
</if>
<if test="record.iccId == null">
icc_id = null,
</if>
<if test="record.province != null">
province = #{record.province},
</if>
<if test="record.provinceEn != null">
province_en = #{record.provinceEn},
</if>
<if test="record.provinceFra != null">
province_fra = #{record.provinceFra},
</if>
<if test="record.provinceSpa != null">
province_spa = #{record.provinceSpa},
</if>
<if test="record.provinceDe != null">
province_de = #{record.provinceDe},
</if>
<if test="record.provincePl != null">
province_pl = #{record.provincePl},
</if>
<if test="record.provinceAra != null">
province_ara = #{record.provinceAra},
</if>
2025-06-30 10:11:32 +08:00
<if test="record.city != null">
city = #{record.city},
</if>
<if test="record.electricityType != null">
electricity_type = #{record.electricityType},
</if>
<if test="record.customerType != null">
customer_type = #{record.customerType},
</if>
<if test="record.voltageLevel != null">
voltage_level = #{record.voltageLevel},
</if>
<if test="record.batchNumber != null">
batch_number = #{record.batchNumber},
</if>
<if test="record.nation != null">
nation = #{record.nation},
</if>
<if test="record.nationEn != null">
nation_en = #{record.nationEn},
</if>
<if test="record.nationFra != null">
nation_fra = #{record.nationFra},
</if>
<if test="record.nationSpa != null">
nation_spa = #{record.nationSpa},
</if>
<if test="record.nationDe != null">
nation_de = #{record.nationDe},
</if>
<if test="record.nationPl != null">
nation_pl = #{record.nationPl},
</if>
<if test="record.nationAra != null">
nation_ara = #{record.nationAra},
</if>
2025-06-30 10:11:32 +08:00
</set>
where id = #{record.id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.ho.business.entity.Station">
update station
set group_id = #{groupId,jdbcType=INTEGER},
dept_id = #{deptId,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
longitude = #{longitude,jdbcType=DECIMAL},
latitude = #{latitude,jdbcType=DECIMAL},
capacity = #{capacity,jdbcType=DECIMAL},
rate_power = #{ratePower,jdbcType=DECIMAL},
contact = #{contact,jdbcType=VARCHAR},
contact_details = #{contactDetails,jdbcType=VARCHAR},
grid_time = #{gridTime,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=TINYINT},
is_enable = #{isEnable,jdbcType=TINYINT},
cabin_num = #{cabinNum},
batch_number = #{batchNumber},
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByParam" resultType="com.ho.business.vo.resp.StationInfoResp">
select s.id,s.pid,s.group_id,s.dept_id,s.name,s.address,s.capacity,s.rate_power,s.status,s.type,s.grid_time,
s.cupboard_type,s.plan_version,d.device_name,d.producer,d.producer_type from
(
<if test="record.list != null and record.list.size != 0">
<foreach collection="record.list" open="(" close=")" separator=" union all " item="item">
select * from device
<where>
<if test="item.deviceType != null">
and device_type like concat('%',#{item.deviceType},'%')
</if>
<if test="item.producer != null">
and producer like concat('%',#{item.producer},'%')
</if>
<if test="item.producerType != null">
and producer_type like concat('%',#{item.producerType},'%')
</if>
and `virtual` = 0 and category > 2 and device_type is not null
</where>
</foreach>
</if>
<if test="record.list == null">
select * from device where `virtual` = 0 and category > 2 and device_type is not null
</if>
) d,
( select * from station
<where>
<if test="record.name != null">
and name like concat('%',#{record.name},'%')
</if>
<if test="record.cupboardType != null">
and cupboard_type = #{record.cupboardType}
</if>
<if test="record.planVersion != null">
and plan_version like concat('%',#{record.planVersion},'%')
</if>
</where>
) s
where d.station_id = s.id order by s.id asc
</select>
<select id="getTermDictionary" parameterType="java.lang.String" resultType="java.util.Map">
select * from term_dictionary
<where>
<if test="language!= null and language !=''">
and language = #{language}
</if>
</where>
</select>
<update id="updateStationList" keyColumn="id" keyProperty="id" parameterType="java.util.List" useGeneratedKeys="true">
<foreach collection="list" item="item" index="index" separator=";">
update station set name = #{item.name},name_en = #{item.nameEn},address = #{item.address},address_en = #{item.addressEn} where id = #{item.id}
</foreach>
</update>
</mapper>