电站远程控制

This commit is contained in:
2025-12-03 17:00:26 +08:00
parent 861155b2e5
commit 219caadd45
6 changed files with 241 additions and 0 deletions

View File

@ -0,0 +1,16 @@
package com.ho.business.mapper;
import com.ho.business.entity.StationRemoteControl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StationRemoteControlMapper {
void insert(@Param("entity") StationRemoteControl entity);
void update(@Param("entity") StationRemoteControl entity);
void delete(@Param("id") Integer id);
StationRemoteControl search(@Param("stationId") Integer stationId);
}

View File

@ -0,0 +1,13 @@
package com.ho.business.service;
import com.ho.business.entity.StationRemoteControl;
public interface StationRemoteControlService {
void insert(StationRemoteControl entity);
void update(StationRemoteControl entity);
void delete(Integer id);
StationRemoteControl search(Integer stationId);
}

View File

@ -0,0 +1,36 @@
package com.ho.business.service.impl;
import com.ho.business.entity.StationRemoteControl;
import com.ho.business.mapper.StationRemoteControlMapper;
import com.ho.business.service.StationRemoteControlService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class StationRemoteControlServiceImpl implements StationRemoteControlService {
@Autowired
StationRemoteControlMapper stationRemoteControlMapper;
@Override
public void insert(StationRemoteControl entity) {
stationRemoteControlMapper.insert(entity);
}
@Override
public void update(StationRemoteControl entity) {
stationRemoteControlMapper.update(entity);
}
@Override
public void delete(Integer id) {
stationRemoteControlMapper.delete(id);
}
@Override
public StationRemoteControl search(Integer stationId) {
return stationRemoteControlMapper.search(stationId);
}
}

View File

@ -0,0 +1,64 @@
<?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.StationRemoteControlMapper">
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ho.business.entity.StationRemoteControl"
useGeneratedKeys="true">
insert into station_remote_control
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="entity.id != null">id,</if>
<if test="entity.stationId != null">station_id,</if>
<if test="entity.ip != null">ip,</if>
<if test="entity.port != null">port,</if>
<if test="entity.userName != null">user_name,</if>
<if test="entity.password != null">password,</if>
<if test="entity.intranetIp != null">intranet_ip,</if>
<if test="entity.createTime != null">create_time,</if>
<if test="entity.updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="entity.id != null">#{entity.id,jdbcType=INTEGER},</if>
<if test="entity.stationId != null">#{entity.stationId,jdbcType=INTEGER},</if>
<if test="entity.ip != null">#{entity.ip,jdbcType=VARCHAR},</if>
<if test="entity.port != null">#{entity.port,jdbcType=VARCHAR},</if>
<if test="entity.userName != null">#{entity.userName,jdbcType=VARCHAR},</if>
<if test="entity.password != null">#{entity.password,jdbcType=VARCHAR},</if>
<if test="entity.intranetIp != null">#{entity.intranetIp,jdbcType=VARCHAR},</if>
<if test="entity.createTime != null">#{entity.createTime,jdbcType=TIMESTAMP},</if>
<if test="entity.updateTime != null">#{entity.updateTime,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="update" parameterType="com.ho.business.entity.StationRemoteControl">
update station_remote_control
<set>
<if test="entity.ip != null">
ip = #{entity.ip,jdbcType=VARCHAR},
</if>
<if test="entity.port != null">
port = #{entity.port,jdbcType=VARCHAR},
</if>
<if test="entity.userName != null">
user_name = #{entity.userName,jdbcType=VARCHAR},
</if>
<if test="entity.password != null">
password = #{entity.password,jdbcType=VARCHAR},
</if>
<if test="entity.intranetIp != null">
intranet_ip = #{entity.intranetIp,jdbcType=VARCHAR},
</if>
<if test="entity.updateTime != null">
update_time = #{entity.updateTime,jdbcType=VARCHAR},
</if>
</set>
where id = #{entity.id,jdbcType=INTEGER}
</update>
<delete id="delete">
delete from station_remote_control where id = #{id,jdbcType=INTEGER}
</delete>
<select id="search" resultType="com.ho.business.entity.StationRemoteControl">
select * from station_remote_control where station_id = #{stationId,jdbcType=INTEGER}
</select>
</mapper>