billion-main/src/main/java/com/billion/main/controller/BsWorkshopController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
billion-main/src/main/java/com/billion/main/domain/BsWorkshop.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
billion-main/src/main/java/com/billion/main/mapper/BsWorkshopMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
billion-main/src/main/java/com/billion/main/service/IBsWorkshopService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
billion-main/src/main/java/com/billion/main/service/impl/BsWorkshopServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
billion-main/src/main/java/com/billion/main/service/impl/DaMaterialCollectionServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
billion-main/src/main/resources/mapper/BsWorkshopMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
sql/table.sql | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
billion-main/src/main/java/com/billion/main/controller/BsWorkshopController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,105 @@ package com.billion.main.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.billion.main.domain.BsWorkshop; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.billion.common.annotation.Log; import com.billion.common.core.controller.BaseController; import com.billion.common.core.domain.AjaxResult; import com.billion.common.enums.BusinessType; import com.billion.main.service.IBsWorkshopService; import com.billion.common.utils.poi.ExcelUtil; import com.billion.common.core.page.TableDataInfo; /** * 车é´ä¿¡æ¯Controller * * @author Billion-Yi * @date 2024-11-19 */ @RestController @RequestMapping("/bs/workshop") public class BsWorkshopController extends BaseController { @Autowired private IBsWorkshopService bsWorkshopService; /** * æ¥è¯¢è½¦é´ä¿¡æ¯å表 */ @PreAuthorize("@ss.hasPermi('bs:workshop:list')") @GetMapping("/list") public TableDataInfo list(BsWorkshop bsWorkshop) { startPage(); List<BsWorkshop> list = bsWorkshopService.selectBsWorkshopList(bsWorkshop); return getDataTable(list); } /** * 导åºè½¦é´ä¿¡æ¯å表 */ @PreAuthorize("@ss.hasPermi('bs:workshop:export')") @Log(title = "车é´ä¿¡æ¯", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, BsWorkshop bsWorkshop) { List<BsWorkshop> list = bsWorkshopService.selectBsWorkshopList(bsWorkshop); ExcelUtil<BsWorkshop> util = new ExcelUtil<BsWorkshop>(BsWorkshop.class); util.exportExcel(response, list, "车é´ä¿¡æ¯æ°æ®"); } /** * è·å车é´ä¿¡æ¯è¯¦ç»ä¿¡æ¯ */ @PreAuthorize("@ss.hasPermi('bs:workshop:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(bsWorkshopService.selectBsWorkshopById(id)); } /** * æ°å¢è½¦é´ä¿¡æ¯ */ @PreAuthorize("@ss.hasPermi('bs:workshop:add')") @Log(title = "车é´ä¿¡æ¯", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody BsWorkshop bsWorkshop) { return toAjax(bsWorkshopService.insertBsWorkshop(bsWorkshop)); } /** * ä¿®æ¹è½¦é´ä¿¡æ¯ */ @PreAuthorize("@ss.hasPermi('bs:workshop:edit')") @Log(title = "车é´ä¿¡æ¯", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody BsWorkshop bsWorkshop) { return toAjax(bsWorkshopService.updateBsWorkshop(bsWorkshop)); } /** * å é¤è½¦é´ä¿¡æ¯ */ @PreAuthorize("@ss.hasPermi('bs:workshop:remove')") @Log(title = "车é´ä¿¡æ¯", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(bsWorkshopService.deleteBsWorkshopByIds(ids)); } } billion-main/src/main/java/com/billion/main/domain/BsWorkshop.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,41 @@ package com.billion.main.domain; import com.billion.common.annotation.Excel; import com.billion.common.core.domain.BaseEntity; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 车é´ä¿¡æ¯å¯¹è±¡ bs_workshop * * @author Billion-Yi * @date 2024-11-19 */ @Data public class BsWorkshop extends BaseEntity { private static final long serialVersionUID = 1L; /** id */ private Long id; /** 车é´ç¼ç */ @Excel(name = "车é´ç¼ç ") private String workshopCode; /** 车é´å称 */ @Excel(name = "车é´å称") private String workshopName; /** å¤ç¨å段1 */ private String spareField1; /** å¤ç¨å段2 */ private String spareField2; /** å¤æ³¨ */ @Excel(name = "å¤æ³¨") private String remarks; } billion-main/src/main/java/com/billion/main/mapper/BsWorkshopMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,64 @@ package com.billion.main.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.billion.main.domain.BsWorkshop; import java.util.List; /** * 车é´ä¿¡æ¯Mapperæ¥å£ * * @author Billion-Yi * @date 2024-11-19 */ public interface BsWorkshopMapper extends BaseMapper<BsWorkshop> { /** * æ¥è¯¢è½¦é´ä¿¡æ¯ * * @param id 车é´ä¿¡æ¯ä¸»é® * @return 车é´ä¿¡æ¯ */ public BsWorkshop selectBsWorkshopById(Long id); /** * æ¥è¯¢è½¦é´ä¿¡æ¯å表 * * @param bsWorkshop 车é´ä¿¡æ¯ * @return 车é´ä¿¡æ¯éå */ public List<BsWorkshop> selectBsWorkshopList(BsWorkshop bsWorkshop); /** * æ°å¢è½¦é´ä¿¡æ¯ * * @param bsWorkshop 车é´ä¿¡æ¯ * @return ç»æ */ public int insertBsWorkshop(BsWorkshop bsWorkshop); /** * ä¿®æ¹è½¦é´ä¿¡æ¯ * * @param bsWorkshop 车é´ä¿¡æ¯ * @return ç»æ */ public int updateBsWorkshop(BsWorkshop bsWorkshop); /** * å é¤è½¦é´ä¿¡æ¯ * * @param id 车é´ä¿¡æ¯ä¸»é® * @return ç»æ */ public int deleteBsWorkshopById(Long id); /** * æ¹éå é¤è½¦é´ä¿¡æ¯ * * @param ids éè¦å é¤çæ°æ®ä¸»é®éå * @return ç»æ */ public int deleteBsWorkshopByIds(Long[] ids); } billion-main/src/main/java/com/billion/main/service/IBsWorkshopService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,64 @@ package com.billion.main.service; import com.baomidou.mybatisplus.extension.service.IService; import com.billion.main.domain.BsWorkshop; import java.util.List; /** * 车é´ä¿¡æ¯Serviceæ¥å£ * * @author Billion-Yi * @date 2024-11-19 */ public interface IBsWorkshopService extends IService<BsWorkshop> { /** * æ¥è¯¢è½¦é´ä¿¡æ¯ * * @param id 车é´ä¿¡æ¯ä¸»é® * @return 车é´ä¿¡æ¯ */ public BsWorkshop selectBsWorkshopById(Long id); /** * æ¥è¯¢è½¦é´ä¿¡æ¯å表 * * @param bsWorkshop 车é´ä¿¡æ¯ * @return 车é´ä¿¡æ¯éå */ public List<BsWorkshop> selectBsWorkshopList(BsWorkshop bsWorkshop); /** * æ°å¢è½¦é´ä¿¡æ¯ * * @param bsWorkshop 车é´ä¿¡æ¯ * @return ç»æ */ public int insertBsWorkshop(BsWorkshop bsWorkshop); /** * ä¿®æ¹è½¦é´ä¿¡æ¯ * * @param bsWorkshop 车é´ä¿¡æ¯ * @return ç»æ */ public int updateBsWorkshop(BsWorkshop bsWorkshop); /** * æ¹éå é¤è½¦é´ä¿¡æ¯ * * @param ids éè¦å é¤ç车é´ä¿¡æ¯ä¸»é®éå * @return ç»æ */ public int deleteBsWorkshopByIds(Long[] ids); /** * å é¤è½¦é´ä¿¡æ¯ä¿¡æ¯ * * @param id 车é´ä¿¡æ¯ä¸»é® * @return ç»æ */ public int deleteBsWorkshopById(Long id); } billion-main/src/main/java/com/billion/main/service/impl/BsWorkshopServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,98 @@ package com.billion.main.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.billion.common.utils.DateUtils; import com.billion.main.domain.BsWorkshop; import com.billion.main.mapper.BsWorkshopMapper; import com.billion.main.service.IBsWorkshopService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * 车é´ä¿¡æ¯Serviceä¸å¡å±å¤ç * * @author Billion-Yi * @date 2024-11-19 */ @Service public class BsWorkshopServiceImpl extends ServiceImpl<BsWorkshopMapper, BsWorkshop> implements IBsWorkshopService { @Autowired private BsWorkshopMapper bsWorkshopMapper; /** * æ¥è¯¢è½¦é´ä¿¡æ¯ * * @param id 车é´ä¿¡æ¯ä¸»é® * @return 车é´ä¿¡æ¯ */ @Override public BsWorkshop selectBsWorkshopById(Long id) { return bsWorkshopMapper.selectBsWorkshopById(id); } /** * æ¥è¯¢è½¦é´ä¿¡æ¯å表 * * @param bsWorkshop 车é´ä¿¡æ¯ * @return 车é´ä¿¡æ¯ */ @Override public List<BsWorkshop> selectBsWorkshopList(BsWorkshop bsWorkshop) { return bsWorkshopMapper.selectBsWorkshopList(bsWorkshop); } /** * æ°å¢è½¦é´ä¿¡æ¯ * * @param bsWorkshop 车é´ä¿¡æ¯ * @return ç»æ */ @Override public int insertBsWorkshop(BsWorkshop bsWorkshop) { bsWorkshop.setCreateTime(DateUtils.getNowDate()); return bsWorkshopMapper.insertBsWorkshop(bsWorkshop); } /** * ä¿®æ¹è½¦é´ä¿¡æ¯ * * @param bsWorkshop 车é´ä¿¡æ¯ * @return ç»æ */ @Override public int updateBsWorkshop(BsWorkshop bsWorkshop) { bsWorkshop.setUpdateTime(DateUtils.getNowDate()); return bsWorkshopMapper.updateBsWorkshop(bsWorkshop); } /** * æ¹éå é¤è½¦é´ä¿¡æ¯ * * @param ids éè¦å é¤ç车é´ä¿¡æ¯ä¸»é® * @return ç»æ */ @Override public int deleteBsWorkshopByIds(Long[] ids) { return bsWorkshopMapper.deleteBsWorkshopByIds(ids); } /** * å é¤è½¦é´ä¿¡æ¯ä¿¡æ¯ * * @param id 车é´ä¿¡æ¯ä¸»é® * @return ç»æ */ @Override public int deleteBsWorkshopById(Long id) { return bsWorkshopMapper.deleteBsWorkshopById(id); } } billion-main/src/main/java/com/billion/main/service/impl/DaMaterialCollectionServiceImpl.java
@@ -19,7 +19,6 @@ implements DaMaterialCollectionService{ } billion-main/src/main/resources/mapper/BsWorkshopMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,91 @@ <?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.billion.main.mapper.BsWorkshopMapper"> <resultMap type="BsWorkshop" id="BsWorkshopResult"> <result property="id" column="id" /> <result property="workshopCode" column="workshop_code" /> <result property="workshopName" column="workshop_name" /> <result property="spareField1" column="spare_field1" /> <result property="spareField2" column="spare_field2" /> <result property="remarks" column="remarks" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> </resultMap> <sql id="selectBsWorkshopVo"> select id, workshop_code, workshop_name, spare_field1, spare_field2, remarks, create_by, create_time, update_by, update_time from bs_workshop </sql> <select id="selectBsWorkshopList" parameterType="BsWorkshop" resultMap="BsWorkshopResult"> <include refid="selectBsWorkshopVo"/> <where> <if test="workshopCode != null and workshopCode != ''"> and workshop_code = #{workshopCode}</if> <if test="workshopName != null and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if> </where> </select> <select id="selectBsWorkshopById" parameterType="Long" resultMap="BsWorkshopResult"> <include refid="selectBsWorkshopVo"/> where id = #{id} </select> <insert id="insertBsWorkshop" parameterType="BsWorkshop"> insert into bs_workshop <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="workshopCode != null">workshop_code,</if> <if test="workshopName != null">workshop_name,</if> <if test="spareField1 != null">spare_field_1,</if> <if test="spareField2 != null">spare_field_2,</if> <if test="remarks != null">remarks,</if> <if test="createBy != null">create_by,</if> <if test="createTime != null">create_time,</if> <if test="updateBy != null">update_by,</if> <if test="updateTime != null">update_time,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> <if test="workshopCode != null">#{workshopCode},</if> <if test="workshopName != null">#{workshopName},</if> <if test="spareField1 != null">#{spareField1},</if> <if test="spareField2 != null">#{spareField2},</if> <if test="remarks != null">#{remarks},</if> <if test="createBy != null">#{createBy},</if> <if test="createTime != null">#{createTime},</if> <if test="updateBy != null">#{updateBy},</if> <if test="updateTime != null">#{updateTime},</if> </trim> </insert> <update id="updateBsWorkshop" parameterType="BsWorkshop"> update bs_workshop <trim prefix="SET" suffixOverrides=","> <if test="workshopCode != null">workshop_code = #{workshopCode},</if> <if test="workshopName != null">workshop_name = #{workshopName},</if> <if test="spareField1 != null">spare_field_1 = #{spareField1},</if> <if test="spareField2 != null">spare_field_2 = #{spareField2},</if> <if test="remarks != null">remarks = #{remarks},</if> <if test="createBy != null">create_by = #{createBy},</if> <if test="createTime != null">create_time = #{createTime},</if> <if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateTime != null">update_time = #{updateTime},</if> </trim> where id = #{id} </update> <delete id="deleteBsWorkshopById" parameterType="Long"> delete from bs_workshop where id = #{id} </delete> <delete id="deleteBsWorkshopByIds" parameterType="String"> delete from bs_workshop where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper> sql/table.sql
@@ -20,7 +20,7 @@ -- ---------------------------- -- 2ãåæ°ééé ç½® -- ---------------------------- drop table if exists sc_opc_conf; drop table if exists sc_collection_param_conf; create table sc_collection_param_conf ( id bigint(20) not null auto_increment comment '主é®id', product_code varchar(64) default '' comment '产åç¼ç ',