新增 第三方平台sn对应关系表

This commit is contained in:
Lemon
2024-03-09 14:28:38 +08:00
parent 9da10b08f6
commit 86b45362d8
5 changed files with 376 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
package com.jsowell.pile.domain;
import com.jsowell.common.annotation.Excel;
import com.jsowell.common.core.domain.BaseEntity;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 万车充--第三方平台桩编号对应关系对象 thirdparty_sn_relation
*
* @author jsowell
* @date 2024-03-09
*/
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ThirdpartySnRelation extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 站点id
*/
private String stationId;
/**
* 桩编号
*/
@Excel(name = "桩编号")
private String pileSn;
/**
* 第三方平台类型
*/
@Excel(name = "第三方平台类型")
private String thirdpartyType;
/**
* 第三方平台对应的设备编号
*/
@Excel(name = "第三方平台对应的设备编号")
private String thirdpartyPileSn;
/**
* 删除标识0-正常1-删除)
*/
private String delFlag;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
.append("id", getId())
.append("pileSn", getPileSn())
.append("thirdpartyType", getThirdpartyType())
.append("thirdpartyPileSn", getThirdpartyPileSn())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("delFlag", getDelFlag())
.toString();
}
}

View File

@@ -0,0 +1,63 @@
package com.jsowell.pile.mapper;
import java.util.List;
import com.jsowell.pile.domain.ThirdpartySnRelation;
import org.springframework.stereotype.Component;
/**
* 万车充--第三方平台桩编号对应关系Mapper接口
*
* @author jsowell
* @date 2024-03-09
*/
@Component
public interface ThirdpartySnRelationMapper {
/**
* 查询万车充--第三方平台桩编号对应关系
*
* @param id 万车充--第三方平台桩编号对应关系主键
* @return 万车充--第三方平台桩编号对应关系
*/
public ThirdpartySnRelation selectThirdpartySnRelationById(Long id);
/**
* 查询万车充--第三方平台桩编号对应关系列表
*
* @param thirdpartySnRelation 万车充--第三方平台桩编号对应关系
* @return 万车充--第三方平台桩编号对应关系集合
*/
public List<ThirdpartySnRelation> selectThirdpartySnRelationList(ThirdpartySnRelation thirdpartySnRelation);
/**
* 新增万车充--第三方平台桩编号对应关系
*
* @param thirdpartySnRelation 万车充--第三方平台桩编号对应关系
* @return 结果
*/
public int insertThirdpartySnRelation(ThirdpartySnRelation thirdpartySnRelation);
/**
* 修改万车充--第三方平台桩编号对应关系
*
* @param thirdpartySnRelation 万车充--第三方平台桩编号对应关系
* @return 结果
*/
public int updateThirdpartySnRelation(ThirdpartySnRelation thirdpartySnRelation);
/**
* 删除万车充--第三方平台桩编号对应关系
*
* @param id 万车充--第三方平台桩编号对应关系主键
* @return 结果
*/
public int deleteThirdpartySnRelationById(Long id);
/**
* 批量删除万车充--第三方平台桩编号对应关系
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteThirdpartySnRelationByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.ThirdpartySnRelation;
/**
* 万车充--第三方平台桩编号对应关系Service接口
*
* @author jsowell
* @date 2024-03-09
*/
public interface IThirdpartySnRelationService {
/**
* 查询万车充--第三方平台桩编号对应关系
*
* @param id 万车充--第三方平台桩编号对应关系主键
* @return 万车充--第三方平台桩编号对应关系
*/
public ThirdpartySnRelation selectThirdpartySnRelationById(Long id);
/**
* 查询万车充--第三方平台桩编号对应关系列表
*
* @param thirdpartySnRelation 万车充--第三方平台桩编号对应关系
* @return 万车充--第三方平台桩编号对应关系集合
*/
public List<ThirdpartySnRelation> selectThirdpartySnRelationList(ThirdpartySnRelation thirdpartySnRelation);
/**
* 新增万车充--第三方平台桩编号对应关系
*
* @param thirdpartySnRelation 万车充--第三方平台桩编号对应关系
* @return 结果
*/
public int insertThirdpartySnRelation(ThirdpartySnRelation thirdpartySnRelation);
/**
* 修改万车充--第三方平台桩编号对应关系
*
* @param thirdpartySnRelation 万车充--第三方平台桩编号对应关系
* @return 结果
*/
public int updateThirdpartySnRelation(ThirdpartySnRelation thirdpartySnRelation);
/**
* 批量删除万车充--第三方平台桩编号对应关系
*
* @param ids 需要删除的万车充--第三方平台桩编号对应关系主键集合
* @return 结果
*/
public int deleteThirdpartySnRelationByIds(Long[] ids);
/**
* 删除万车充--第三方平台桩编号对应关系信息
*
* @param id 万车充--第三方平台桩编号对应关系主键
* @return 结果
*/
public int deleteThirdpartySnRelationById(Long id);
}

View File

@@ -0,0 +1,90 @@
package com.jsowell.pile.service.impl;
import java.util.List;
import com.jsowell.common.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jsowell.pile.mapper.ThirdpartySnRelationMapper;
import com.jsowell.pile.domain.ThirdpartySnRelation;
import com.jsowell.pile.service.IThirdpartySnRelationService;
/**
* 万车充--第三方平台桩编号对应关系Service业务层处理
*
* @author jsowell
* @date 2024-03-09
*/
@Service
public class ThirdpartySnRelationServiceImpl implements IThirdpartySnRelationService {
@Autowired
private ThirdpartySnRelationMapper thirdpartySnRelationMapper;
/**
* 查询万车充--第三方平台桩编号对应关系
*
* @param id 万车充--第三方平台桩编号对应关系主键
* @return 万车充--第三方平台桩编号对应关系
*/
@Override
public ThirdpartySnRelation selectThirdpartySnRelationById(Long id) {
return thirdpartySnRelationMapper.selectThirdpartySnRelationById(id);
}
/**
* 查询万车充--第三方平台桩编号对应关系列表
*
* @param thirdpartySnRelation 万车充--第三方平台桩编号对应关系
* @return 万车充--第三方平台桩编号对应关系
*/
@Override
public List<ThirdpartySnRelation> selectThirdpartySnRelationList(ThirdpartySnRelation thirdpartySnRelation) {
return thirdpartySnRelationMapper.selectThirdpartySnRelationList(thirdpartySnRelation);
}
/**
* 新增万车充--第三方平台桩编号对应关系
*
* @param thirdpartySnRelation 万车充--第三方平台桩编号对应关系
* @return 结果
*/
@Override
public int insertThirdpartySnRelation(ThirdpartySnRelation thirdpartySnRelation) {
thirdpartySnRelation.setCreateTime(DateUtils.getNowDate());
return thirdpartySnRelationMapper.insertThirdpartySnRelation(thirdpartySnRelation);
}
/**
* 修改万车充--第三方平台桩编号对应关系
*
* @param thirdpartySnRelation 万车充--第三方平台桩编号对应关系
* @return 结果
*/
@Override
public int updateThirdpartySnRelation(ThirdpartySnRelation thirdpartySnRelation) {
thirdpartySnRelation.setUpdateTime(DateUtils.getNowDate());
return thirdpartySnRelationMapper.updateThirdpartySnRelation(thirdpartySnRelation);
}
/**
* 批量删除万车充--第三方平台桩编号对应关系
*
* @param ids 需要删除的万车充--第三方平台桩编号对应关系主键
* @return 结果
*/
@Override
public int deleteThirdpartySnRelationByIds(Long[] ids) {
return thirdpartySnRelationMapper.deleteThirdpartySnRelationByIds(ids);
}
/**
* 删除万车充--第三方平台桩编号对应关系信息
*
* @param id 万车充--第三方平台桩编号对应关系主键
* @return 结果
*/
@Override
public int deleteThirdpartySnRelationById(Long id) {
return thirdpartySnRelationMapper.deleteThirdpartySnRelationById(id);
}
}

View File

@@ -0,0 +1,90 @@
<?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.jsowell.pile.mapper.ThirdpartySnRelationMapper">
<resultMap type="com.jsowell.pile.domain.ThirdpartySnRelation" id="ThirdpartySnRelationResult">
<result property="id" column="id" />
<result property="stationId" column="station_id" />
<result property="pileSn" column="pile_sn" />
<result property="thirdpartyType" column="thirdparty_type" />
<result property="thirdpartyPileSn" column="thirdparty_pile_sn" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectThirdpartySnRelationVo">
select id, station_id, pile_sn, thirdparty_type, thirdparty_pile_sn, create_time, create_by, update_time, update_by, del_flag from thirdparty_sn_relation
</sql>
<select id="selectThirdpartySnRelationList" parameterType="com.jsowell.pile.domain.ThirdpartySnRelation" resultMap="ThirdpartySnRelationResult">
<include refid="selectThirdpartySnRelationVo"/>
<where>
<if test="pileSn != null and pileSn != ''"> and pile_sn = #{pileSn}</if>
<if test="thirdpartyType != null and thirdpartyType != ''"> and thirdparty_type = #{thirdpartyType}</if>
<if test="thirdpartyPileSn != null and thirdpartyPileSn != ''"> and thirdparty_pile_sn = #{thirdpartyPileSn}</if>
</where>
</select>
<select id="selectThirdpartySnRelationById" parameterType="Long" resultMap="ThirdpartySnRelationResult">
<include refid="selectThirdpartySnRelationVo"/>
where id = #{id}
</select>
<insert id="insertThirdpartySnRelation" parameterType="com.jsowell.pile.domain.ThirdpartySnRelation" useGeneratedKeys="true" keyProperty="id">
insert into thirdparty_sn_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stationId != null">station_id,</if>
<if test="pileSn != null">pile_sn,</if>
<if test="thirdpartyType != null">thirdparty_type,</if>
<if test="thirdpartyPileSn != null">thirdparty_pile_sn,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stationId != null">#{stationId},</if>
<if test="pileSn != null">#{pileSn},</if>
<if test="thirdpartyType != null">#{thirdpartyType},</if>
<if test="thirdpartyPileSn != null">#{thirdpartyPileSn},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateThirdpartySnRelation" parameterType="com.jsowell.pile.domain.ThirdpartySnRelation">
update thirdparty_sn_relation
<trim prefix="SET" suffixOverrides=",">
<if test="stationId != null">station_id = #{stationId},</if>
<if test="pileSn != null">pile_sn = #{pileSn},</if>
<if test="thirdpartyType != null">thirdparty_type = #{thirdpartyType},</if>
<if test="thirdpartyPileSn != null">thirdparty_pile_sn = #{thirdpartyPileSn},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteThirdpartySnRelationById" parameterType="Long">
delete from thirdparty_sn_relation where id = #{id}
</delete>
<delete id="deleteThirdpartySnRelationByIds" parameterType="String">
delete from thirdparty_sn_relation where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>