¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.psConf.controller; |
| | | |
| | | import com.jcdm.common.annotation.Log; |
| | | import com.jcdm.common.core.controller.BaseController; |
| | | import com.jcdm.common.core.domain.AjaxResult; |
| | | import com.jcdm.common.core.page.TableDataInfo; |
| | | import com.jcdm.common.enums.BusinessType; |
| | | import com.jcdm.common.utils.poi.ExcelUtil; |
| | | import com.jcdm.main.da.psConf.domain.DaPsConf; |
| | | import com.jcdm.main.da.psConf.service.IDaPsConfService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 1P1Sé
ç½®Controller |
| | | * |
| | | * @author Yi |
| | | * @date 2024-08-04 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/da/psConf") |
| | | public class DaPsConfController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IDaPsConfService daPsConfService; |
| | | |
| | | /** |
| | | * æ¥è¯¢1P1Sé
ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:psConf:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(DaPsConf daPsConf) |
| | | { |
| | | startPage(); |
| | | List<DaPsConf> list = daPsConfService.selectDaPsConfList(daPsConf); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åº1P1Sé
ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:psConf:export')") |
| | | @Log(title = "1P1Sé
ç½®", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, DaPsConf daPsConf) |
| | | { |
| | | List<DaPsConf> list = daPsConfService.selectDaPsConfList(daPsConf); |
| | | ExcelUtil<DaPsConf> util = new ExcelUtil<DaPsConf>(DaPsConf.class); |
| | | util.exportExcel(response, list, "1P1Sé
ç½®æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·å1P1Sé
置详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:psConf:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(daPsConfService.selectDaPsConfById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢1P1Sé
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:psConf:add')") |
| | | @Log(title = "1P1Sé
ç½®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DaPsConf daPsConf) |
| | | { |
| | | return toAjax(daPsConfService.insertDaPsConf(daPsConf)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹1P1Sé
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:psConf:edit')") |
| | | @Log(title = "1P1Sé
ç½®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DaPsConf daPsConf) |
| | | { |
| | | return toAjax(daPsConfService.updateDaPsConf(daPsConf)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤1P1Sé
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:psConf:remove')") |
| | | @Log(title = "1P1Sé
ç½®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(daPsConfService.deleteDaPsConfByIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.psConf.domain; |
| | | |
| | | import com.jcdm.common.annotation.Excel; |
| | | import com.jcdm.common.core.domain.BaseEntity; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | /** |
| | | * 1P1Sé
置对象 da_ps_conf |
| | | * |
| | | * @author Yi |
| | | * @date 2024-08-04 |
| | | */ |
| | | public class DaPsConf extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主é®id */ |
| | | private Long id; |
| | | |
| | | /** åå代ç */ |
| | | @Excel(name = "åå代ç ") |
| | | private String mfCode; |
| | | |
| | | /** 产åç±»å代ç */ |
| | | @Excel(name = "产åç±»å代ç ") |
| | | private String proTypeCode; |
| | | |
| | | /** çµæ± ç±»å代ç */ |
| | | @Excel(name = "çµæ± ç±»å代ç ") |
| | | private String batteryTypeCode; |
| | | |
| | | /** è§æ ¼ä»£ç */ |
| | | @Excel(name = "è§æ ¼ä»£ç ") |
| | | private String specificationsCode; |
| | | |
| | | /** 追溯信æ¯ä»£ç */ |
| | | @Excel(name = "追溯信æ¯ä»£ç ") |
| | | private String traceInfoCode; |
| | | |
| | | /** ç产æ¥æ代ç */ |
| | | @Excel(name = "ç产æ¥æ代ç ") |
| | | private String proDateCode; |
| | | |
| | | /** åºåå· */ |
| | | @Excel(name = "åºåå·") |
| | | private String sfcCode; |
| | | |
| | | /** ç¶æ (å¯ç¨enableï¼ç¦ç¨disableï¼ */ |
| | | @Excel(name = "ç¶æ (å¯ç¨enableï¼ç¦ç¨disableï¼") |
| | | private String state; |
| | | |
| | | /** å¤æ³¨ */ |
| | | @Excel(name = "å¤æ³¨") |
| | | private String remarks; |
| | | |
| | | /** é¢çå段1 */ |
| | | @Excel(name = "é¢çå段1") |
| | | private String spareField1; |
| | | |
| | | /** é¢çå段2 */ |
| | | @Excel(name = "é¢çå段2") |
| | | private String spareField2; |
| | | |
| | | /** å建ç¨æ· */ |
| | | @Excel(name = "å建ç¨æ·") |
| | | private String createUser; |
| | | |
| | | /** æ´æ¹ç¨æ· */ |
| | | @Excel(name = "æ´æ¹ç¨æ·") |
| | | private String updateUser; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setMfCode(String mfCode) |
| | | { |
| | | this.mfCode = mfCode; |
| | | } |
| | | |
| | | public String getMfCode() |
| | | { |
| | | return mfCode; |
| | | } |
| | | public void setProTypeCode(String proTypeCode) |
| | | { |
| | | this.proTypeCode = proTypeCode; |
| | | } |
| | | |
| | | public String getProTypeCode() |
| | | { |
| | | return proTypeCode; |
| | | } |
| | | public void setBatteryTypeCode(String batteryTypeCode) |
| | | { |
| | | this.batteryTypeCode = batteryTypeCode; |
| | | } |
| | | |
| | | public String getBatteryTypeCode() |
| | | { |
| | | return batteryTypeCode; |
| | | } |
| | | public void setSpecificationsCode(String specificationsCode) |
| | | { |
| | | this.specificationsCode = specificationsCode; |
| | | } |
| | | |
| | | public String getSpecificationsCode() |
| | | { |
| | | return specificationsCode; |
| | | } |
| | | public void setTraceInfoCode(String traceInfoCode) |
| | | { |
| | | this.traceInfoCode = traceInfoCode; |
| | | } |
| | | |
| | | public String getTraceInfoCode() |
| | | { |
| | | return traceInfoCode; |
| | | } |
| | | public void setProDateCode(String proDateCode) |
| | | { |
| | | this.proDateCode = proDateCode; |
| | | } |
| | | |
| | | public String getProDateCode() |
| | | { |
| | | return proDateCode; |
| | | } |
| | | public void setSfcCode(String sfcCode) |
| | | { |
| | | this.sfcCode = sfcCode; |
| | | } |
| | | |
| | | public String getSfcCode() |
| | | { |
| | | return sfcCode; |
| | | } |
| | | public void setState(String state) |
| | | { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getState() |
| | | { |
| | | return state; |
| | | } |
| | | public void setRemarks(String remarks) |
| | | { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public String getRemarks() |
| | | { |
| | | return remarks; |
| | | } |
| | | public void setSpareField1(String spareField1) |
| | | { |
| | | this.spareField1 = spareField1; |
| | | } |
| | | |
| | | public String getSpareField1() |
| | | { |
| | | return spareField1; |
| | | } |
| | | public void setSpareField2(String spareField2) |
| | | { |
| | | this.spareField2 = spareField2; |
| | | } |
| | | |
| | | public String getSpareField2() |
| | | { |
| | | return spareField2; |
| | | } |
| | | public void setCreateUser(String createUser) |
| | | { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public String getCreateUser() |
| | | { |
| | | return createUser; |
| | | } |
| | | public void setUpdateUser(String updateUser) |
| | | { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public String getUpdateUser() |
| | | { |
| | | return updateUser; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("mfCode", getMfCode()) |
| | | .append("proTypeCode", getProTypeCode()) |
| | | .append("batteryTypeCode", getBatteryTypeCode()) |
| | | .append("specificationsCode", getSpecificationsCode()) |
| | | .append("traceInfoCode", getTraceInfoCode()) |
| | | .append("proDateCode", getProDateCode()) |
| | | .append("sfcCode", getSfcCode()) |
| | | .append("state", getState()) |
| | | .append("remarks", getRemarks()) |
| | | .append("spareField1", getSpareField1()) |
| | | .append("spareField2", getSpareField2()) |
| | | .append("createUser", getCreateUser()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateUser", getUpdateUser()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.psConf.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jcdm.main.da.psConf.domain.DaPsConf; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 1P1Sé
ç½®Mapperæ¥å£ |
| | | * |
| | | * @author Yi |
| | | * @date 2024-08-04 |
| | | */ |
| | | public interface DaPsConfMapper extends BaseMapper<DaPsConf> |
| | | { |
| | | /** |
| | | * æ¥è¯¢1P1Sé
ç½® |
| | | * |
| | | * @param id 1P1Sé
ç½®ä¸»é® |
| | | * @return 1P1Sé
ç½® |
| | | */ |
| | | public DaPsConf selectDaPsConfById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢1P1Sé
ç½®å表 |
| | | * |
| | | * @param daPsConf 1P1Sé
ç½® |
| | | * @return 1P1Sé
ç½®éå |
| | | */ |
| | | public List<DaPsConf> selectDaPsConfList(DaPsConf daPsConf); |
| | | |
| | | /** |
| | | * æ°å¢1P1Sé
ç½® |
| | | * |
| | | * @param daPsConf 1P1Sé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertDaPsConf(DaPsConf daPsConf); |
| | | |
| | | /** |
| | | * ä¿®æ¹1P1Sé
ç½® |
| | | * |
| | | * @param daPsConf 1P1Sé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateDaPsConf(DaPsConf daPsConf); |
| | | |
| | | /** |
| | | * å é¤1P1Sé
ç½® |
| | | * |
| | | * @param id 1P1Sé
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaPsConfById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤1P1Sé
ç½® |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaPsConfByIds(Long[] ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.psConf.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jcdm.main.da.psConf.domain.DaPsConf; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 1P1Sé
ç½®Serviceæ¥å£ |
| | | * |
| | | * @author Yi |
| | | * @date 2024-08-04 |
| | | */ |
| | | public interface IDaPsConfService extends IService<DaPsConf> |
| | | { |
| | | /** |
| | | * æ¥è¯¢1P1Sé
ç½® |
| | | * |
| | | * @param id 1P1Sé
ç½®ä¸»é® |
| | | * @return 1P1Sé
ç½® |
| | | */ |
| | | public DaPsConf selectDaPsConfById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢1P1Sé
ç½®å表 |
| | | * |
| | | * @param daPsConf 1P1Sé
ç½® |
| | | * @return 1P1Sé
ç½®éå |
| | | */ |
| | | public List<DaPsConf> selectDaPsConfList(DaPsConf daPsConf); |
| | | |
| | | /** |
| | | * æ°å¢1P1Sé
ç½® |
| | | * |
| | | * @param daPsConf 1P1Sé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertDaPsConf(DaPsConf daPsConf); |
| | | |
| | | /** |
| | | * ä¿®æ¹1P1Sé
ç½® |
| | | * |
| | | * @param daPsConf 1P1Sé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateDaPsConf(DaPsConf daPsConf); |
| | | |
| | | /** |
| | | * æ¹éå é¤1P1Sé
ç½® |
| | | * |
| | | * @param ids éè¦å é¤ç1P1Sé
置主é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaPsConfByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤1P1Sé
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param id 1P1Sé
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaPsConfById(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.psConf.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jcdm.common.utils.DateUtils; |
| | | import com.jcdm.main.da.psConf.domain.DaPsConf; |
| | | import com.jcdm.main.da.psConf.mapper.DaPsConfMapper; |
| | | import com.jcdm.main.da.psConf.service.IDaPsConfService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 1P1Sé
ç½®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author Yi |
| | | * @date 2024-08-04 |
| | | */ |
| | | @Service |
| | | public class DaPsConfServiceImpl extends ServiceImpl<DaPsConfMapper,DaPsConf> implements IDaPsConfService |
| | | { |
| | | @Autowired |
| | | private DaPsConfMapper daPsConfMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢1P1Sé
ç½® |
| | | * |
| | | * @param id 1P1Sé
ç½®ä¸»é® |
| | | * @return 1P1Sé
ç½® |
| | | */ |
| | | @Override |
| | | public DaPsConf selectDaPsConfById(Long id) |
| | | { |
| | | return daPsConfMapper.selectDaPsConfById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢1P1Sé
ç½®å表 |
| | | * |
| | | * @param daPsConf 1P1Sé
ç½® |
| | | * @return 1P1Sé
ç½® |
| | | */ |
| | | @Override |
| | | public List<DaPsConf> selectDaPsConfList(DaPsConf daPsConf) |
| | | { |
| | | return daPsConfMapper.selectDaPsConfList(daPsConf); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢1P1Sé
ç½® |
| | | * |
| | | * @param daPsConf 1P1Sé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertDaPsConf(DaPsConf daPsConf) |
| | | { |
| | | daPsConf.setCreateTime(DateUtils.getNowDate()); |
| | | return daPsConfMapper.insertDaPsConf(daPsConf); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹1P1Sé
ç½® |
| | | * |
| | | * @param daPsConf 1P1Sé
ç½® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateDaPsConf(DaPsConf daPsConf) |
| | | { |
| | | daPsConf.setUpdateTime(DateUtils.getNowDate()); |
| | | return daPsConfMapper.updateDaPsConf(daPsConf); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤1P1Sé
ç½® |
| | | * |
| | | * @param ids éè¦å é¤ç1P1Sé
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteDaPsConfByIds(Long[] ids) |
| | | { |
| | | return daPsConfMapper.deleteDaPsConfByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤1P1Sé
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param id 1P1Sé
ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteDaPsConfById(Long id) |
| | | { |
| | | return daPsConfMapper.deleteDaPsConfById(id); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.jcdm.main.da.psConf.mapper.DaPsConfMapper"> |
| | | |
| | | <resultMap type="DaPsConf" id="DaPsConfResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="mfCode" column="mf_code" /> |
| | | <result property="proTypeCode" column="pro_type_code" /> |
| | | <result property="batteryTypeCode" column="battery_type_code" /> |
| | | <result property="specificationsCode" column="specifications_code" /> |
| | | <result property="traceInfoCode" column="trace_info_code" /> |
| | | <result property="proDateCode" column="pro_date_code" /> |
| | | <result property="sfcCode" column="sfc_code" /> |
| | | <result property="state" column="state" /> |
| | | <result property="remarks" column="remarks" /> |
| | | <result property="spareField1" column="spare_field1" /> |
| | | <result property="spareField2" column="spare_field2" /> |
| | | <result property="createUser" column="create_user" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateUser" column="update_user" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectDaPsConfVo"> |
| | | select id, mf_code, pro_type_code, battery_type_code, specifications_code, trace_info_code, pro_date_code, sfc_code, state, remarks, spare_field1, spare_field2, create_user, create_time, update_user, update_time from da_ps_conf |
| | | </sql> |
| | | |
| | | <select id="selectDaPsConfList" parameterType="DaPsConf" resultMap="DaPsConfResult"> |
| | | <include refid="selectDaPsConfVo"/> |
| | | <where> |
| | | <if test="mfCode != null and mfCode != ''"> and mf_code = #{mfCode}</if> |
| | | <if test="proTypeCode != null and proTypeCode != ''"> and pro_type_code = #{proTypeCode}</if> |
| | | <if test="batteryTypeCode != null and batteryTypeCode != ''"> and battery_type_code = #{batteryTypeCode}</if> |
| | | <if test="specificationsCode != null and specificationsCode != ''"> and specifications_code = #{specificationsCode}</if> |
| | | <if test="traceInfoCode != null and traceInfoCode != ''"> and trace_info_code = #{traceInfoCode}</if> |
| | | <if test="proDateCode != null and proDateCode != ''"> and pro_date_code = #{proDateCode}</if> |
| | | <if test="sfcCode != null and sfcCode != ''"> and sfc_code = #{sfcCode}</if> |
| | | <if test="state != null and state != ''"> and state = #{state}</if> |
| | | <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> |
| | | <if test="spareField1 != null and spareField1 != ''"> and spare_field1 = #{spareField1}</if> |
| | | <if test="spareField2 != null and spareField2 != ''"> and spare_field2 = #{spareField2}</if> |
| | | <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if> |
| | | <if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectDaPsConfById" parameterType="Long" resultMap="DaPsConfResult"> |
| | | <include refid="selectDaPsConfVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertDaPsConf" parameterType="DaPsConf" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into da_ps_conf |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="mfCode != null">mf_code,</if> |
| | | <if test="proTypeCode != null">pro_type_code,</if> |
| | | <if test="batteryTypeCode != null">battery_type_code,</if> |
| | | <if test="specificationsCode != null">specifications_code,</if> |
| | | <if test="traceInfoCode != null">trace_info_code,</if> |
| | | <if test="proDateCode != null">pro_date_code,</if> |
| | | <if test="sfcCode != null">sfc_code,</if> |
| | | <if test="state != null">state,</if> |
| | | <if test="remarks != null">remarks,</if> |
| | | <if test="spareField1 != null">spare_field1,</if> |
| | | <if test="spareField2 != null">spare_field2,</if> |
| | | <if test="createUser != null">create_user,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateUser != null">update_user,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="mfCode != null">#{mfCode},</if> |
| | | <if test="proTypeCode != null">#{proTypeCode},</if> |
| | | <if test="batteryTypeCode != null">#{batteryTypeCode},</if> |
| | | <if test="specificationsCode != null">#{specificationsCode},</if> |
| | | <if test="traceInfoCode != null">#{traceInfoCode},</if> |
| | | <if test="proDateCode != null">#{proDateCode},</if> |
| | | <if test="sfcCode != null">#{sfcCode},</if> |
| | | <if test="state != null">#{state},</if> |
| | | <if test="remarks != null">#{remarks},</if> |
| | | <if test="spareField1 != null">#{spareField1},</if> |
| | | <if test="spareField2 != null">#{spareField2},</if> |
| | | <if test="createUser != null">#{createUser},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateUser != null">#{updateUser},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateDaPsConf" parameterType="DaPsConf"> |
| | | update da_ps_conf |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="mfCode != null">mf_code = #{mfCode},</if> |
| | | <if test="proTypeCode != null">pro_type_code = #{proTypeCode},</if> |
| | | <if test="batteryTypeCode != null">battery_type_code = #{batteryTypeCode},</if> |
| | | <if test="specificationsCode != null">specifications_code = #{specificationsCode},</if> |
| | | <if test="traceInfoCode != null">trace_info_code = #{traceInfoCode},</if> |
| | | <if test="proDateCode != null">pro_date_code = #{proDateCode},</if> |
| | | <if test="sfcCode != null">sfc_code = #{sfcCode},</if> |
| | | <if test="state != null">state = #{state},</if> |
| | | <if test="remarks != null">remarks = #{remarks},</if> |
| | | <if test="spareField1 != null">spare_field1 = #{spareField1},</if> |
| | | <if test="spareField2 != null">spare_field2 = #{spareField2},</if> |
| | | <if test="createUser != null">create_user = #{createUser},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateUser != null">update_user = #{updateUser},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteDaPsConfById" parameterType="Long"> |
| | | delete from da_ps_conf where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteDaPsConfByIds" parameterType="String"> |
| | | delete from da_ps_conf where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢1P1Sé
ç½®å表 |
| | | export function listPsConf(query) { |
| | | return request({ |
| | | url: '/da/psConf/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢1P1Sé
ç½®è¯¦ç» |
| | | export function getPsConf(id) { |
| | | return request({ |
| | | url: '/da/psConf/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢1P1Sé
ç½® |
| | | export function addPsConf(data) { |
| | | return request({ |
| | | url: '/da/psConf', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹1P1Sé
ç½® |
| | | export function updatePsConf(data) { |
| | | return request({ |
| | | url: '/da/psConf', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤1P1Sé
ç½® |
| | | export function delPsConf(id) { |
| | | return request({ |
| | | url: '/da/psConf/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-card class="box-card"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="åå代ç " prop="mfCode"> |
| | | <el-input |
| | | v-model="queryParams.mfCode" |
| | | placeholder="请è¾å
¥åå代ç " |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="产åç±»å代ç " prop="proTypeCode"> |
| | | <el-input |
| | | v-model="queryParams.proTypeCode" |
| | | placeholder="请è¾å
¥äº§åç±»å代ç " |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item style="float: right"> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | |
| | | <el-card style="margin-top: 10px" class="box-card"> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['da:psConf:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['da:psConf:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['da:psConf:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['da:psConf:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table border v-loading="loading" :data="psConfList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="åå代ç " align="center" prop="mfCode"> |
| | | </el-table-column> |
| | | <el-table-column label="产åç±»å代ç " align="center" prop="proTypeCode"> |
| | | </el-table-column> |
| | | <el-table-column label="çµæ± ç±»å代ç " align="center" prop="batteryTypeCode"> |
| | | </el-table-column> |
| | | <el-table-column label="è§æ ¼ä»£ç " align="center" prop="specificationsCode"> |
| | | </el-table-column> |
| | | <el-table-column label="追溯信æ¯ä»£ç " align="center" prop="traceInfoCode"> |
| | | </el-table-column> |
| | | <el-table-column label="ç产æ¥æ代ç " align="center" prop="proDateCode"> |
| | | </el-table-column> |
| | | <el-table-column label="åºåå·" align="center" prop="sfcCode"> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ (å¯ç¨enableï¼ç¦ç¨disableï¼" align="center" prop="state"> |
| | | </el-table-column> |
| | | <el-table-column label="å¤æ³¨" align="center" prop="remarks"> |
| | | </el-table-column> |
| | | <el-table-column label="é¢çå段1" align="center" prop="spareField1"> |
| | | </el-table-column> |
| | | <el-table-column label="é¢çå段2" align="center" prop="spareField2"> |
| | | </el-table-column> |
| | | <el-table-column label="å建ç¨æ·" align="center" prop="createUser"> |
| | | </el-table-column> |
| | | <el-table-column label="æ´æ¹ç¨æ·" align="center" prop="updateUser"> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" width="200" label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="success" |
| | | plain |
| | | style="width: 72px" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['da:psConf:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="danger" |
| | | plain |
| | | style="width: 72px" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['da:psConf:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹1P1Sé
置对è¯æ¡ --> |
| | | <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <span slot="title"> |
| | | <i class="el-icon-s-order"></i> |
| | | {{titleName}} |
| | | </span> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="åå代ç " prop="mfCode"> |
| | | <el-input v-model="form.mfCode" placeholder="请è¾å
¥åå代ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="产åç±»å代ç " prop="proTypeCode"> |
| | | <el-input v-model="form.proTypeCode" placeholder="请è¾å
¥äº§åç±»å代ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="çµæ± ç±»å代ç " prop="batteryTypeCode"> |
| | | <el-input v-model="form.batteryTypeCode" placeholder="请è¾å
¥çµæ± ç±»å代ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="è§æ ¼ä»£ç " prop="specificationsCode"> |
| | | <el-input v-model="form.specificationsCode" placeholder="请è¾å
¥è§æ ¼ä»£ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="追溯信æ¯ä»£ç " prop="traceInfoCode"> |
| | | <el-input v-model="form.traceInfoCode" placeholder="请è¾å
¥è¿½æº¯ä¿¡æ¯ä»£ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="ç产æ¥æ代ç " prop="proDateCode"> |
| | | <el-input v-model="form.proDateCode" placeholder="请è¾å
¥ç产æ¥æ代ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="åºåå·" prop="sfcCode"> |
| | | <el-input v-model="form.sfcCode" placeholder="请è¾å
¥åºåå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ (å¯ç¨enableï¼ç¦ç¨disableï¼" prop="state"> |
| | | <el-input v-model="form.state" placeholder="请è¾å
¥ç¶æ (å¯ç¨enableï¼ç¦ç¨disableï¼" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¤æ³¨" prop="remarks"> |
| | | <el-input v-model="form.remarks" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | <el-form-item label="é¢çå段1" prop="spareField1"> |
| | | <el-input v-model="form.spareField1" placeholder="请è¾å
¥é¢çå段1" /> |
| | | </el-form-item> |
| | | <el-form-item label="é¢çå段2" prop="spareField2"> |
| | | <el-input v-model="form.spareField2" placeholder="请è¾å
¥é¢çå段2" /> |
| | | </el-form-item> |
| | | <el-form-item label="å建ç¨æ·" prop="createUser"> |
| | | <el-input v-model="form.createUser" placeholder="请è¾å
¥å建ç¨æ·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ´æ¹ç¨æ·" prop="updateUser"> |
| | | <el-input v-model="form.updateUser" placeholder="请è¾å
¥æ´æ¹ç¨æ·" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listPsConf, getPsConf, delPsConf, addPsConf, updatePsConf } from "@/api/main/da/psConf/psConf"; |
| | | |
| | | export default { |
| | | name: "PsConf", |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | titleName: "", |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // 1P1Sé
ç½®è¡¨æ ¼æ°æ® |
| | | psConfList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | mfCode: null, |
| | | proTypeCode: null, |
| | | batteryTypeCode: null, |
| | | specificationsCode: null, |
| | | traceInfoCode: null, |
| | | proDateCode: null, |
| | | sfcCode: null, |
| | | state: null, |
| | | remarks: null, |
| | | spareField1: null, |
| | | spareField2: null, |
| | | createUser: null, |
| | | updateUser: null, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "主é®idä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢1P1Sé
ç½®å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listPsConf(this.queryParams).then(response => { |
| | | this.psConfList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | mfCode: null, |
| | | proTypeCode: null, |
| | | batteryTypeCode: null, |
| | | specificationsCode: null, |
| | | traceInfoCode: null, |
| | | proDateCode: null, |
| | | sfcCode: null, |
| | | state: null, |
| | | remarks: null, |
| | | spareField1: null, |
| | | spareField2: null, |
| | | createUser: null, |
| | | createTime: null, |
| | | updateUser: null, |
| | | updateTime: null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡éä¸æ°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.titleName = "æ·»å 1P1Sé
ç½®"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getPsConf(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.titleName = "ä¿®æ¹1P1Sé
ç½®"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updatePsConf(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addPsConf(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤1P1Sé
ç½®ç¼å·ä¸º"' + ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delPsConf(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('da/psConf/export', { |
| | | ...this.queryParams |
| | | }, `psConf_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |