仪器管理-配置说明书
parent
6d67364e79
commit
726f36945e
@ -0,0 +1,62 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentInstructions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 仪器说明书Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-16
|
||||
*/
|
||||
public interface WxInstrumentInstructionsMapper {
|
||||
/**
|
||||
* 查询仪器说明书
|
||||
*
|
||||
* @param id 仪器说明书主键
|
||||
* @return 仪器说明书
|
||||
*/
|
||||
public WxInstrumentInstructions selectWxInstrumentInstructionsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仪器说明书列表
|
||||
*
|
||||
* @param wxInstrumentInstructions 仪器说明书
|
||||
* @return 仪器说明书集合
|
||||
*/
|
||||
public List<WxInstrumentInstructions> selectWxInstrumentInstructionsList(WxInstrumentInstructions wxInstrumentInstructions);
|
||||
|
||||
/**
|
||||
* 新增仪器说明书
|
||||
*
|
||||
* @param wxInstrumentInstructions 仪器说明书
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions);
|
||||
|
||||
/**
|
||||
* 修改仪器说明书
|
||||
*
|
||||
* @param wxInstrumentInstructions 仪器说明书
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions);
|
||||
|
||||
/**
|
||||
* 删除仪器说明书
|
||||
*
|
||||
* @param id 仪器说明书主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentInstructionsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除仪器说明书
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentInstructionsByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
<?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.flossom.common.core.mapper.WxInstrumentInstructionsMapper">
|
||||
|
||||
<resultMap type="WxInstrumentInstructions" id="WxInstrumentInstructionsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="instrumentId" column="instrument_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="link" column="link" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxInstrumentInstructionsVo">
|
||||
select id, instrument_id, name, link, status, create_by, create_time from wx_instrument_instructions
|
||||
</sql>
|
||||
|
||||
<select id="selectWxInstrumentInstructionsList" parameterType="WxInstrumentInstructions" resultMap="WxInstrumentInstructionsResult">
|
||||
<include refid="selectWxInstrumentInstructionsVo"/>
|
||||
<where>
|
||||
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="link != null and link != ''"> and link = #{link}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWxInstrumentInstructionsById" parameterType="Long" resultMap="WxInstrumentInstructionsResult">
|
||||
<include refid="selectWxInstrumentInstructionsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWxInstrumentInstructions" parameterType="WxInstrumentInstructions" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wx_instrument_instructions
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="instrumentId != null">instrument_id,</if>
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="link != null and link != ''">link,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="instrumentId != null">#{instrumentId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="link != null and link != ''">#{link},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxInstrumentInstructions" parameterType="WxInstrumentInstructions">
|
||||
update wx_instrument_instructions
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
|
||||
<if test="name != null and name != ''">name = #{name},</if>
|
||||
<if test="link != null and link != ''">link = #{link},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWxInstrumentInstructionsById" parameterType="Long">
|
||||
delete from wx_instrument_instructions where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxInstrumentInstructionsByIds" parameterType="String">
|
||||
delete from wx_instrument_instructions where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,78 @@
|
||||
package com.flossom.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.flossom.common.core.domain.R;
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentInstructions;
|
||||
import com.flossom.common.core.utils.poi.ExcelUtil;
|
||||
import com.flossom.common.core.web.controller.BaseController;
|
||||
import com.flossom.common.core.web.domain.AjaxResult;
|
||||
import com.flossom.common.core.web.page.TableDataInfo;
|
||||
import com.flossom.common.log.annotation.Log;
|
||||
import com.flossom.common.log.enums.BusinessType;
|
||||
import com.flossom.common.security.annotation.RequiresPermissions;
|
||||
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.flossom.system.service.IWxInstrumentInstructionsService;
|
||||
|
||||
/**
|
||||
* 仪器说明书Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/instructions")
|
||||
public class WxInstrumentInstructionsController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWxInstrumentInstructionsService wxInstrumentInstructionsService;
|
||||
|
||||
/**
|
||||
* 查询仪器说明书列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R list(WxInstrumentInstructions wxInstrumentInstructions) {
|
||||
return R.ok(wxInstrumentInstructionsService.selectWxInstrumentInstructionsList(wxInstrumentInstructions));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取仪器说明书详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(wxInstrumentInstructionsService.selectWxInstrumentInstructionsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仪器说明书
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WxInstrumentInstructions wxInstrumentInstructions) {
|
||||
return toAjax(wxInstrumentInstructionsService.insertWxInstrumentInstructions(wxInstrumentInstructions));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仪器说明书
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WxInstrumentInstructions wxInstrumentInstructions) {
|
||||
return toAjax(wxInstrumentInstructionsService.updateWxInstrumentInstructions(wxInstrumentInstructions));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仪器说明书
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(wxInstrumentInstructionsService.deleteWxInstrumentInstructionsByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentInstructions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仪器说明书Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-16
|
||||
*/
|
||||
public interface IWxInstrumentInstructionsService {
|
||||
/**
|
||||
* 查询仪器说明书
|
||||
*
|
||||
* @param id 仪器说明书主键
|
||||
* @return 仪器说明书
|
||||
*/
|
||||
public WxInstrumentInstructions selectWxInstrumentInstructionsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仪器说明书列表
|
||||
*
|
||||
* @param wxInstrumentInstructions 仪器说明书
|
||||
* @return 仪器说明书集合
|
||||
*/
|
||||
public List<WxInstrumentInstructions> selectWxInstrumentInstructionsList(WxInstrumentInstructions wxInstrumentInstructions);
|
||||
|
||||
/**
|
||||
* 新增仪器说明书
|
||||
*
|
||||
* @param wxInstrumentInstructions 仪器说明书
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions);
|
||||
|
||||
/**
|
||||
* 修改仪器说明书
|
||||
*
|
||||
* @param wxInstrumentInstructions 仪器说明书
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions);
|
||||
|
||||
/**
|
||||
* 批量删除仪器说明书
|
||||
*
|
||||
* @param ids 需要删除的仪器说明书主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentInstructionsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除仪器说明书信息
|
||||
*
|
||||
* @param id 仪器说明书主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentInstructionsById(Long id);
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentInstructions;
|
||||
import com.flossom.common.core.mapper.WxInstrumentInstructionsMapper;
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.IWxInstrumentInstructionsService;
|
||||
|
||||
/**
|
||||
* 仪器说明书Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-16
|
||||
*/
|
||||
@Service
|
||||
public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstructionsService {
|
||||
|
||||
@Autowired
|
||||
private WxInstrumentInstructionsMapper wxInstrumentInstructionsMapper;
|
||||
|
||||
/**
|
||||
* 查询仪器说明书
|
||||
*
|
||||
* @param id 仪器说明书主键
|
||||
* @return 仪器说明书
|
||||
*/
|
||||
@Override
|
||||
public WxInstrumentInstructions selectWxInstrumentInstructionsById(Long id) {
|
||||
return wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仪器说明书列表
|
||||
*
|
||||
* @param wxInstrumentInstructions 仪器说明书
|
||||
* @return 仪器说明书
|
||||
*/
|
||||
@Override
|
||||
public List<WxInstrumentInstructions> selectWxInstrumentInstructionsList(WxInstrumentInstructions wxInstrumentInstructions) {
|
||||
return wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(wxInstrumentInstructions);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仪器说明书
|
||||
*
|
||||
* @param wxInstrumentInstructions 仪器说明书
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) {
|
||||
wxInstrumentInstructions.setCreateTime(DateUtils.getNowDate());
|
||||
return wxInstrumentInstructionsMapper.insertWxInstrumentInstructions(wxInstrumentInstructions);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仪器说明书
|
||||
*
|
||||
* @param wxInstrumentInstructions 仪器说明书
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWxInstrumentInstructions(WxInstrumentInstructions wxInstrumentInstructions) {
|
||||
return wxInstrumentInstructionsMapper.updateWxInstrumentInstructions(wxInstrumentInstructions);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仪器说明书
|
||||
*
|
||||
* @param ids 需要删除的仪器说明书主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxInstrumentInstructionsByIds(Long[] ids) {
|
||||
return wxInstrumentInstructionsMapper.deleteWxInstrumentInstructionsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仪器说明书信息
|
||||
*
|
||||
* @param id 仪器说明书主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxInstrumentInstructionsById(Long id) {
|
||||
return wxInstrumentInstructionsMapper.deleteWxInstrumentInstructionsById(id);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue