修改 月
parent
8d17a6d494
commit
3051fbc033
@ -0,0 +1,127 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.BaseDtNeng;
|
||||
import com.ruoyi.system.service.IBaseDtNengService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 月看板-单台能耗Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-07-28
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/base_dt_neng")
|
||||
public class BaseDtNengController extends BaseController
|
||||
{
|
||||
private String prefix = "system/base_dt_neng";
|
||||
|
||||
@Autowired
|
||||
private IBaseDtNengService baseDtNengService;
|
||||
|
||||
@RequiresPermissions("system:base_dt_neng:view")
|
||||
@GetMapping()
|
||||
public String base_dt_neng()
|
||||
{
|
||||
return prefix + "/base_dt_neng";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询月看板-单台能耗列表
|
||||
*/
|
||||
@RequiresPermissions("system:base_dt_neng:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BaseDtNeng baseDtNeng)
|
||||
{
|
||||
startPage();
|
||||
List<BaseDtNeng> list = baseDtNengService.selectBaseDtNengList(baseDtNeng);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出月看板-单台能耗列表
|
||||
*/
|
||||
@RequiresPermissions("system:base_dt_neng:export")
|
||||
@Log(title = "月看板-单台能耗", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BaseDtNeng baseDtNeng)
|
||||
{
|
||||
List<BaseDtNeng> list = baseDtNengService.selectBaseDtNengList(baseDtNeng);
|
||||
ExcelUtil<BaseDtNeng> util = new ExcelUtil<BaseDtNeng>(BaseDtNeng.class);
|
||||
return util.exportExcel(list, "月看板-单台能耗数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增月看板-单台能耗
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存月看板-单台能耗
|
||||
*/
|
||||
@RequiresPermissions("system:base_dt_neng:add")
|
||||
@Log(title = "月看板-单台能耗", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BaseDtNeng baseDtNeng)
|
||||
{
|
||||
return toAjax(baseDtNengService.insertBaseDtNeng(baseDtNeng));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改月看板-单台能耗
|
||||
*/
|
||||
@RequiresPermissions("system:base_dt_neng:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
BaseDtNeng baseDtNeng = baseDtNengService.selectBaseDtNengById(id);
|
||||
mmap.put("baseDtNeng", baseDtNeng);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存月看板-单台能耗
|
||||
*/
|
||||
@RequiresPermissions("system:base_dt_neng:edit")
|
||||
@Log(title = "月看板-单台能耗", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BaseDtNeng baseDtNeng)
|
||||
{
|
||||
return toAjax(baseDtNengService.updateBaseDtNeng(baseDtNeng));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除月看板-单台能耗
|
||||
*/
|
||||
@RequiresPermissions("system:base_dt_neng:remove")
|
||||
@Log(title = "月看板-单台能耗", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(baseDtNengService.deleteBaseDtNengByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,219 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 月看板-单台能耗对象 base_dt_neng
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-07-28
|
||||
*/
|
||||
public class BaseDtNeng extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 年份 */
|
||||
@Excel(name = "年份")
|
||||
private Long yearName;
|
||||
|
||||
/** 1月 */
|
||||
@Excel(name = "1月")
|
||||
private String month1;
|
||||
|
||||
/** 2月 */
|
||||
@Excel(name = "2月")
|
||||
private String month2;
|
||||
|
||||
/** 3月 */
|
||||
@Excel(name = "3月")
|
||||
private String month3;
|
||||
|
||||
/** 4月 */
|
||||
@Excel(name = "4月")
|
||||
private String month4;
|
||||
|
||||
/** 5月 */
|
||||
@Excel(name = "5月")
|
||||
private String month5;
|
||||
|
||||
/** 6月 */
|
||||
@Excel(name = "6月")
|
||||
private String month6;
|
||||
|
||||
/** 7月 */
|
||||
@Excel(name = "7月")
|
||||
private String month7;
|
||||
|
||||
/** 8月 */
|
||||
@Excel(name = "8月")
|
||||
private String month8;
|
||||
|
||||
/** 9月 */
|
||||
@Excel(name = "9月")
|
||||
private String month9;
|
||||
|
||||
/** 10月 */
|
||||
@Excel(name = "10月")
|
||||
private String month10;
|
||||
|
||||
/** 11月 */
|
||||
@Excel(name = "11月")
|
||||
private String month11;
|
||||
|
||||
/** 12月 */
|
||||
@Excel(name = "12月")
|
||||
private String month12;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setYearName(Long yearName)
|
||||
{
|
||||
this.yearName = yearName;
|
||||
}
|
||||
|
||||
public Long getYearName()
|
||||
{
|
||||
return yearName;
|
||||
}
|
||||
public void setMonth1(String month1)
|
||||
{
|
||||
this.month1 = month1;
|
||||
}
|
||||
|
||||
public String getMonth1()
|
||||
{
|
||||
return month1;
|
||||
}
|
||||
public void setMonth2(String month2)
|
||||
{
|
||||
this.month2 = month2;
|
||||
}
|
||||
|
||||
public String getMonth2()
|
||||
{
|
||||
return month2;
|
||||
}
|
||||
public void setMonth3(String month3)
|
||||
{
|
||||
this.month3 = month3;
|
||||
}
|
||||
|
||||
public String getMonth3()
|
||||
{
|
||||
return month3;
|
||||
}
|
||||
public void setMonth4(String month4)
|
||||
{
|
||||
this.month4 = month4;
|
||||
}
|
||||
|
||||
public String getMonth4()
|
||||
{
|
||||
return month4;
|
||||
}
|
||||
public void setMonth5(String month5)
|
||||
{
|
||||
this.month5 = month5;
|
||||
}
|
||||
|
||||
public String getMonth5()
|
||||
{
|
||||
return month5;
|
||||
}
|
||||
public void setMonth6(String month6)
|
||||
{
|
||||
this.month6 = month6;
|
||||
}
|
||||
|
||||
public String getMonth6()
|
||||
{
|
||||
return month6;
|
||||
}
|
||||
public void setMonth7(String month7)
|
||||
{
|
||||
this.month7 = month7;
|
||||
}
|
||||
|
||||
public String getMonth7()
|
||||
{
|
||||
return month7;
|
||||
}
|
||||
public void setMonth8(String month8)
|
||||
{
|
||||
this.month8 = month8;
|
||||
}
|
||||
|
||||
public String getMonth8()
|
||||
{
|
||||
return month8;
|
||||
}
|
||||
public void setMonth9(String month9)
|
||||
{
|
||||
this.month9 = month9;
|
||||
}
|
||||
|
||||
public String getMonth9()
|
||||
{
|
||||
return month9;
|
||||
}
|
||||
public void setMonth10(String month10)
|
||||
{
|
||||
this.month10 = month10;
|
||||
}
|
||||
|
||||
public String getMonth10()
|
||||
{
|
||||
return month10;
|
||||
}
|
||||
public void setMonth11(String month11)
|
||||
{
|
||||
this.month11 = month11;
|
||||
}
|
||||
|
||||
public String getMonth11()
|
||||
{
|
||||
return month11;
|
||||
}
|
||||
public void setMonth12(String month12)
|
||||
{
|
||||
this.month12 = month12;
|
||||
}
|
||||
|
||||
public String getMonth12()
|
||||
{
|
||||
return month12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("yearName", getYearName())
|
||||
.append("month1", getMonth1())
|
||||
.append("month2", getMonth2())
|
||||
.append("month3", getMonth3())
|
||||
.append("month4", getMonth4())
|
||||
.append("month5", getMonth5())
|
||||
.append("month6", getMonth6())
|
||||
.append("month7", getMonth7())
|
||||
.append("month8", getMonth8())
|
||||
.append("month9", getMonth9())
|
||||
.append("month10", getMonth10())
|
||||
.append("month11", getMonth11())
|
||||
.append("month12", getMonth12())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BaseDtNeng;
|
||||
|
||||
/**
|
||||
* 月看板-单台能耗Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-07-28
|
||||
*/
|
||||
public interface BaseDtNengMapper
|
||||
{
|
||||
/**
|
||||
* 查询月看板-单台能耗
|
||||
*
|
||||
* @param id 月看板-单台能耗主键
|
||||
* @return 月看板-单台能耗
|
||||
*/
|
||||
public BaseDtNeng selectBaseDtNengById(Long id);
|
||||
|
||||
/**
|
||||
* 查询月看板-单台能耗列表
|
||||
*
|
||||
* @param baseDtNeng 月看板-单台能耗
|
||||
* @return 月看板-单台能耗集合
|
||||
*/
|
||||
public List<BaseDtNeng> selectBaseDtNengList(BaseDtNeng baseDtNeng);
|
||||
|
||||
/**
|
||||
* 新增月看板-单台能耗
|
||||
*
|
||||
* @param baseDtNeng 月看板-单台能耗
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseDtNeng(BaseDtNeng baseDtNeng);
|
||||
|
||||
/**
|
||||
* 修改月看板-单台能耗
|
||||
*
|
||||
* @param baseDtNeng 月看板-单台能耗
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseDtNeng(BaseDtNeng baseDtNeng);
|
||||
|
||||
/**
|
||||
* 删除月看板-单台能耗
|
||||
*
|
||||
* @param id 月看板-单台能耗主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDtNengById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除月看板-单台能耗
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDtNengByIds(String[] ids);
|
||||
|
||||
List<BaseDtNeng> selectBaseDtNengList1();
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BaseDtNeng;
|
||||
|
||||
/**
|
||||
* 月看板-单台能耗Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-07-28
|
||||
*/
|
||||
public interface IBaseDtNengService
|
||||
{
|
||||
/**
|
||||
* 查询月看板-单台能耗
|
||||
*
|
||||
* @param id 月看板-单台能耗主键
|
||||
* @return 月看板-单台能耗
|
||||
*/
|
||||
public BaseDtNeng selectBaseDtNengById(Long id);
|
||||
|
||||
/**
|
||||
* 查询月看板-单台能耗列表
|
||||
*
|
||||
* @param baseDtNeng 月看板-单台能耗
|
||||
* @return 月看板-单台能耗集合
|
||||
*/
|
||||
public List<BaseDtNeng> selectBaseDtNengList(BaseDtNeng baseDtNeng);
|
||||
|
||||
/**
|
||||
* 新增月看板-单台能耗
|
||||
*
|
||||
* @param baseDtNeng 月看板-单台能耗
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseDtNeng(BaseDtNeng baseDtNeng);
|
||||
|
||||
/**
|
||||
* 修改月看板-单台能耗
|
||||
*
|
||||
* @param baseDtNeng 月看板-单台能耗
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseDtNeng(BaseDtNeng baseDtNeng);
|
||||
|
||||
/**
|
||||
* 批量删除月看板-单台能耗
|
||||
*
|
||||
* @param ids 需要删除的月看板-单台能耗主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDtNengByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除月看板-单台能耗信息
|
||||
*
|
||||
* @param id 月看板-单台能耗主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDtNengById(Long id);
|
||||
|
||||
List<BaseDtNeng> selectBaseDtNengList1();
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.BaseDtNengMapper;
|
||||
import com.ruoyi.system.domain.BaseDtNeng;
|
||||
import com.ruoyi.system.service.IBaseDtNengService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 月看板-单台能耗Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-07-28
|
||||
*/
|
||||
@Service
|
||||
public class BaseDtNengServiceImpl implements IBaseDtNengService
|
||||
{
|
||||
@Autowired
|
||||
private BaseDtNengMapper baseDtNengMapper;
|
||||
|
||||
/**
|
||||
* 查询月看板-单台能耗
|
||||
*
|
||||
* @param id 月看板-单台能耗主键
|
||||
* @return 月看板-单台能耗
|
||||
*/
|
||||
@Override
|
||||
public BaseDtNeng selectBaseDtNengById(Long id)
|
||||
{
|
||||
return baseDtNengMapper.selectBaseDtNengById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询月看板-单台能耗列表
|
||||
*
|
||||
* @param baseDtNeng 月看板-单台能耗
|
||||
* @return 月看板-单台能耗
|
||||
*/
|
||||
@Override
|
||||
public List<BaseDtNeng> selectBaseDtNengList(BaseDtNeng baseDtNeng)
|
||||
{
|
||||
return baseDtNengMapper.selectBaseDtNengList(baseDtNeng);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增月看板-单台能耗
|
||||
*
|
||||
* @param baseDtNeng 月看板-单台能耗
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseDtNeng(BaseDtNeng baseDtNeng)
|
||||
{
|
||||
return baseDtNengMapper.insertBaseDtNeng(baseDtNeng);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改月看板-单台能耗
|
||||
*
|
||||
* @param baseDtNeng 月看板-单台能耗
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseDtNeng(BaseDtNeng baseDtNeng)
|
||||
{
|
||||
return baseDtNengMapper.updateBaseDtNeng(baseDtNeng);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除月看板-单台能耗
|
||||
*
|
||||
* @param ids 需要删除的月看板-单台能耗主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseDtNengByIds(String ids)
|
||||
{
|
||||
return baseDtNengMapper.deleteBaseDtNengByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除月看板-单台能耗信息
|
||||
*
|
||||
* @param id 月看板-单台能耗主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseDtNengById(Long id)
|
||||
{
|
||||
return baseDtNengMapper.deleteBaseDtNengById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BaseDtNeng> selectBaseDtNengList1() {
|
||||
return baseDtNengMapper.selectBaseDtNengList1();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values(2110, '月看板-单台能耗', '5', '1', '/system/base_dt_neng', 'C', '0', 'system:base_dt_neng:view', '#', 'admin', sysdate, '', null, '月看板-单台能耗菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values(seq_sys_menu.nextval, '月看板-单台能耗查询', 2110, '1', '#', 'F', '0', 'system:base_dt_neng:list', '#', 'admin', sysdate, '', null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values(seq_sys_menu.nextval, '月看板-单台能耗新增', 2110, '2', '#', 'F', '0', 'system:base_dt_neng:add', '#', 'admin', sysdate, '', null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values(seq_sys_menu.nextval, '月看板-单台能耗修改', 2110, '3', '#', 'F', '0', 'system:base_dt_neng:edit', '#', 'admin', sysdate, '', null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values(seq_sys_menu.nextval, '月看板-单台能耗删除', 2110, '4', '#', 'F', '0', 'system:base_dt_neng:remove', '#', 'admin', sysdate, '', null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values(seq_sys_menu.nextval, '月看板-单台能耗导出', 2110, '5', '#', 'F', '0', 'system:base_dt_neng:export', '#', 'admin', sysdate, '', null, '');
|
||||
|
||||
-- base_dt_neng主键序列
|
||||
create sequence seq_base_dt_neng
|
||||
increment by 1
|
||||
start with 10
|
||||
nomaxvalue
|
||||
nominvalue
|
||||
cache 20;
|
||||
@ -0,0 +1,113 @@
|
||||
<?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.ruoyi.system.mapper.BaseDtNengMapper">
|
||||
|
||||
<resultMap type="BaseDtNeng" id="BaseDtNengResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="yearName" column="year_name" />
|
||||
<result property="month1" column="month1" />
|
||||
<result property="month2" column="month2" />
|
||||
<result property="month3" column="month3" />
|
||||
<result property="month4" column="month4" />
|
||||
<result property="month5" column="month5" />
|
||||
<result property="month6" column="month6" />
|
||||
<result property="month7" column="month7" />
|
||||
<result property="month8" column="month8" />
|
||||
<result property="month9" column="month9" />
|
||||
<result property="month10" column="month10" />
|
||||
<result property="month11" column="month11" />
|
||||
<result property="month12" column="month12" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseDtNengVo">
|
||||
select id, year_name, month1, month2, month3, month4, month5, month6, month7, month8, month9, month10, month11, month12 from base_dt_neng
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseDtNengList1" parameterType="BaseDtNeng" resultMap="BaseDtNengResult">
|
||||
select id, year_name, month1, month2, month3, month4, month5, month6, month7, month8, month9, month10, month11, month12 from base_dt_neng
|
||||
where year_name=to_number(to_char(sysdate,'yyyy'))
|
||||
</select>
|
||||
<select id="selectBaseDtNengList" parameterType="BaseDtNeng" resultMap="BaseDtNengResult">
|
||||
<include refid="selectBaseDtNengVo"/>
|
||||
<where>
|
||||
<if test="yearName != null "> and year_name = #{yearName}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseDtNengById" parameterType="Long" resultMap="BaseDtNengResult">
|
||||
<include refid="selectBaseDtNengVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseDtNeng" parameterType="BaseDtNeng">
|
||||
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
||||
SELECT seq_base_dt_neng.NEXTVAL as id FROM DUAL
|
||||
</selectKey>
|
||||
insert into base_dt_neng
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="yearName != null">year_name,</if>
|
||||
<if test="month1 != null">month1,</if>
|
||||
<if test="month2 != null">month2,</if>
|
||||
<if test="month3 != null">month3,</if>
|
||||
<if test="month4 != null">month4,</if>
|
||||
<if test="month5 != null">month5,</if>
|
||||
<if test="month6 != null">month6,</if>
|
||||
<if test="month7 != null">month7,</if>
|
||||
<if test="month8 != null">month8,</if>
|
||||
<if test="month9 != null">month9,</if>
|
||||
<if test="month10 != null">month10,</if>
|
||||
<if test="month11 != null">month11,</if>
|
||||
<if test="month12 != null">month12,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="yearName != null">#{yearName},</if>
|
||||
<if test="month1 != null">#{month1},</if>
|
||||
<if test="month2 != null">#{month2},</if>
|
||||
<if test="month3 != null">#{month3},</if>
|
||||
<if test="month4 != null">#{month4},</if>
|
||||
<if test="month5 != null">#{month5},</if>
|
||||
<if test="month6 != null">#{month6},</if>
|
||||
<if test="month7 != null">#{month7},</if>
|
||||
<if test="month8 != null">#{month8},</if>
|
||||
<if test="month9 != null">#{month9},</if>
|
||||
<if test="month10 != null">#{month10},</if>
|
||||
<if test="month11 != null">#{month11},</if>
|
||||
<if test="month12 != null">#{month12},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseDtNeng" parameterType="BaseDtNeng">
|
||||
update base_dt_neng
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="yearName != null">year_name = #{yearName},</if>
|
||||
<if test="month1 != null">month1 = #{month1},</if>
|
||||
<if test="month2 != null">month2 = #{month2},</if>
|
||||
<if test="month3 != null">month3 = #{month3},</if>
|
||||
<if test="month4 != null">month4 = #{month4},</if>
|
||||
<if test="month5 != null">month5 = #{month5},</if>
|
||||
<if test="month6 != null">month6 = #{month6},</if>
|
||||
<if test="month7 != null">month7 = #{month7},</if>
|
||||
<if test="month8 != null">month8 = #{month8},</if>
|
||||
<if test="month9 != null">month9 = #{month9},</if>
|
||||
<if test="month10 != null">month10 = #{month10},</if>
|
||||
<if test="month11 != null">month11 = #{month11},</if>
|
||||
<if test="month12 != null">month12 = #{month12},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseDtNengById" parameterType="Long">
|
||||
delete from base_dt_neng where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseDtNengByIds" parameterType="String">
|
||||
delete from base_dt_neng where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,134 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('月看板-单台能耗列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>年份:</label>
|
||||
<input type="text" name="yearName"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:base_dt_neng:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:base_dt_neng:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:base_dt_neng:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:base_dt_neng:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('system:base_dt_neng:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:base_dt_neng:remove')}]];
|
||||
var prefix = ctx + "system/base_dt_neng";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "月看板-单台能耗",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '主键',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'yearName',
|
||||
title: '年份'
|
||||
},
|
||||
{
|
||||
field: 'month1',
|
||||
title: '1月'
|
||||
},
|
||||
{
|
||||
field: 'month2',
|
||||
title: '2月'
|
||||
},
|
||||
{
|
||||
field: 'month3',
|
||||
title: '3月'
|
||||
},
|
||||
{
|
||||
field: 'month4',
|
||||
title: '4月'
|
||||
},
|
||||
{
|
||||
field: 'month5',
|
||||
title: '5月'
|
||||
},
|
||||
{
|
||||
field: 'month6',
|
||||
title: '6月'
|
||||
},
|
||||
{
|
||||
field: 'month7',
|
||||
title: '7月'
|
||||
},
|
||||
{
|
||||
field: 'month8',
|
||||
title: '8月'
|
||||
},
|
||||
{
|
||||
field: 'month9',
|
||||
title: '9月'
|
||||
},
|
||||
{
|
||||
field: 'month10',
|
||||
title: '10月'
|
||||
},
|
||||
{
|
||||
field: 'month11',
|
||||
title: '11月'
|
||||
},
|
||||
{
|
||||
field: 'month12',
|
||||
title: '12月'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue