官网管理对接、大屏更新

This commit is contained in:
Rue Ji
2026-03-05 00:35:31 +08:00
parent 96605402a5
commit 258d3d7c13
14 changed files with 4186 additions and 3068 deletions

View File

@ -74,7 +74,7 @@ public class PipelineDataController {
@RequestMapping("/delete.do")
public String dodelete(HttpServletRequest request, Model model,
@RequestParam(value = "id") String id) {
@RequestParam(value = "id") Long id) {
int result = this.pipelineDataService.deleteById(id);
model.addAttribute("result", result);
return "result";
@ -83,15 +83,14 @@ public class PipelineDataController {
@RequestMapping("/deletes.do")
public String dodeletes(HttpServletRequest request, Model model,
@RequestParam(value = "ids") String ids) {
ids = ids.replace(",", "','");
int result = this.pipelineDataService.deleteByWhere("where id in ('" + ids + "')");
int result = this.pipelineDataService.deleteByWhere("where id in (" + ids + ")");
model.addAttribute("result", result);
return "result";
}
@RequestMapping("/edit.do")
public String doedit(HttpServletRequest request, Model model,
@RequestParam(value = "id") String id) {
@RequestParam(value = "id") Long id) {
PipelineData pipelineData = this.pipelineDataService.selectById(id);
model.addAttribute("pipelineData", pipelineData);
return "/pipeline/pipelineDataEdit";
@ -109,7 +108,7 @@ public class PipelineDataController {
@RequestMapping("/view.do")
public String doview(HttpServletRequest request, Model model,
@RequestParam(value = "id") String id) {
@RequestParam(value = "id") Long id) {
PipelineData pipelineData = this.pipelineDataService.selectById(id);
model.addAttribute("pipelineData", pipelineData);
return "/pipeline/pipelineDataView";

View File

@ -49,6 +49,14 @@ public class CommDaoImpl<T> implements CommDao<T> {
T o = getSqlSession().selectOne(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t);
return o;
}
/**
* 根据ID查询Long类型
*/
public T selectByPrimaryKey(Long t){
T o = getSqlSession().selectOne(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t);
return o;
}
/**
* wxp为activiti测试修改
* @param t
@ -62,6 +70,13 @@ public class CommDaoImpl<T> implements CommDao<T> {
return getSqlSession().delete(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t);
}
/**
* 根据ID删除Long类型
*/
public int deleteByPrimaryKey(Long t) {
return getSqlSession().delete(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t);
}
public int insert(T t){
return getSqlSession().insert(mappernamespace+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), t);
}

View File

@ -16,32 +16,30 @@
id, pipeline_name, diameter_mm, length_m, start_burial_depth_m, end_burial_depth_m,
start_ground_elevation_m, end_ground_elevation_m, pipeline_invert_elevation_m
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from pipeline_data
where id = #{id,jdbcType=VARCHAR}
from tb_pipeline_data
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from pipeline_data
where id = #{id,jdbcType=VARCHAR}
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from tb_pipeline_data
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.sipai.entity.pipeline.PipelineData" >
insert into pipeline_data (id, pipeline_name, diameter_mm,
<insert id="insert" parameterType="com.sipai.entity.pipeline.PipelineData" useGeneratedKeys="true" keyProperty="id" >
insert into tb_pipeline_data (pipeline_name, diameter_mm,
length_m, start_burial_depth_m, end_burial_depth_m,
start_ground_elevation_m, end_ground_elevation_m,
pipeline_invert_elevation_m)
values (#{id,jdbcType=VARCHAR}, #{pipelineName,jdbcType=VARCHAR}, #{diameterMm,jdbcType=DECIMAL},
values (#{pipelineName,jdbcType=VARCHAR}, #{diameterMm,jdbcType=DECIMAL},
#{lengthM,jdbcType=DECIMAL}, #{startBurialDepthM,jdbcType=DECIMAL}, #{endBurialDepthM,jdbcType=DECIMAL},
#{startGroundElevationM,jdbcType=DECIMAL}, #{endGroundElevationM,jdbcType=DECIMAL},
#{pipelineInvertElevationM,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.sipai.entity.pipeline.PipelineData" >
insert into pipeline_data
<insert id="insertSelective" parameterType="com.sipai.entity.pipeline.PipelineData" useGeneratedKeys="true" keyProperty="id" >
insert into tb_pipeline_data
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="pipelineName != null" >
pipeline_name,
</if>
@ -68,9 +66,7 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=VARCHAR},
</if>
<if test="pipelineName != null" >
#{pipelineName,jdbcType=VARCHAR},
</if>
@ -98,7 +94,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sipai.entity.pipeline.PipelineData" >
update pipeline_data
update tb_pipeline_data
<set >
<if test="pipelineName != null" >
pipeline_name = #{pipelineName,jdbcType=VARCHAR},
@ -125,10 +121,10 @@
pipeline_invert_elevation_m = #{pipelineInvertElevationM,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.sipai.entity.pipeline.PipelineData" >
update pipeline_data
update tb_pipeline_data
set pipeline_name = #{pipelineName,jdbcType=VARCHAR},
diameter_mm = #{diameterMm,jdbcType=DECIMAL},
length_m = #{lengthM,jdbcType=DECIMAL},
@ -137,17 +133,17 @@
start_ground_elevation_m = #{startGroundElevationM,jdbcType=DECIMAL},
end_ground_elevation_m = #{endGroundElevationM,jdbcType=DECIMAL},
pipeline_invert_elevation_m = #{pipelineInvertElevationM,jdbcType=DECIMAL}
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectListByWhere" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pipeline_data
from tb_pipeline_data
${where}
</select>
<delete id="deleteByWhere" parameterType="java.lang.String">
delete from
pipeline_data
tb_pipeline_data
${where}
</delete>
</mapper>

View File

@ -19,11 +19,25 @@ public class PipelineDataService implements CommService<PipelineData> {
return pipelineData;
}
/**
* 根据ID查询Long类型
*/
public PipelineData selectById(Long id) {
return pipelineDataDao.selectByPrimaryKey(id);
}
@Override
public int deleteById(String id) {
return pipelineDataDao.deleteByPrimaryKey(id);
}
/**
* 根据ID删除Long类型
*/
public int deleteById(Long id) {
return pipelineDataDao.deleteByPrimaryKey(id);
}
@Override
public int save(PipelineData pipelineData) {
return pipelineDataDao.insert(pipelineData);