仪器管理-关联正品控名称
parent
9c9aaf4c81
commit
22cc022b63
@ -0,0 +1,61 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仪器关联正品控产品名Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-15
|
||||
*/
|
||||
public interface WxInstrumentNameRelateMapper {
|
||||
/**
|
||||
* 查询仪器关联正品控产品名
|
||||
*
|
||||
* @param id 仪器关联正品控产品名主键
|
||||
* @return 仪器关联正品控产品名
|
||||
*/
|
||||
public WxInstrumentNameRelate selectWxInstrumentNameRelateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仪器关联正品控产品名列表
|
||||
*
|
||||
* @param wxInstrumentNameRelate 仪器关联正品控产品名
|
||||
* @return 仪器关联正品控产品名集合
|
||||
*/
|
||||
public List<WxInstrumentNameRelate> selectWxInstrumentNameRelateList(WxInstrumentNameRelate wxInstrumentNameRelate);
|
||||
|
||||
/**
|
||||
* 新增仪器关联正品控产品名
|
||||
*
|
||||
* @param wxInstrumentNameRelate 仪器关联正品控产品名
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate);
|
||||
|
||||
/**
|
||||
* 修改仪器关联正品控产品名
|
||||
*
|
||||
* @param wxInstrumentNameRelate 仪器关联正品控产品名
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate);
|
||||
|
||||
/**
|
||||
* 删除仪器关联正品控产品名
|
||||
*
|
||||
* @param id 仪器关联正品控产品名主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentNameRelateById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除仪器关联正品控产品名
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentNameRelateByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
<?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.WxInstrumentNameRelateMapper">
|
||||
|
||||
<resultMap type="WxInstrumentNameRelate" id="WxInstrumentNameRelateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="instrumentId" column="instrument_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxInstrumentNameRelateVo">
|
||||
select id, instrument_id, product_name, status, create_by, create_time from wx_instrument_name_relate
|
||||
</sql>
|
||||
|
||||
<select id="selectWxInstrumentNameRelateList" parameterType="WxInstrumentNameRelate" resultMap="WxInstrumentNameRelateResult">
|
||||
<include refid="selectWxInstrumentNameRelateVo"/>
|
||||
<where>
|
||||
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWxInstrumentNameRelateById" parameterType="Long" resultMap="WxInstrumentNameRelateResult">
|
||||
<include refid="selectWxInstrumentNameRelateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWxInstrumentNameRelate" parameterType="WxInstrumentNameRelate" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wx_instrument_name_relate
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="instrumentId != null">instrument_id,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</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="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxInstrumentNameRelate" parameterType="WxInstrumentNameRelate">
|
||||
update wx_instrument_name_relate
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
|
||||
<if test="productName != null and productName != ''">product_name = #{productName},</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="deleteWxInstrumentNameRelateById" parameterType="Long">
|
||||
delete from wx_instrument_name_relate where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxInstrumentNameRelateByIds" parameterType="String">
|
||||
delete from wx_instrument_name_relate where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,18 @@
|
||||
package com.flossom.miniProgram.controller;
|
||||
|
||||
import com.flossom.common.core.web.controller.BaseController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 仪器关联正品控产品名Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/instrument")
|
||||
public class WxInstrumenController extends BaseController {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.flossom.system.controller;
|
||||
|
||||
|
||||
import com.flossom.common.core.domain.R;
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
|
||||
import com.flossom.common.core.web.controller.BaseController;
|
||||
import com.flossom.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.flossom.system.service.IWxInstrumentNameRelateService;
|
||||
|
||||
|
||||
/**
|
||||
* 仪器关联正品控产品名Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/instrumentRelateName")
|
||||
public class WxInstrumentNameRelateController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWxInstrumentNameRelateService wxInstrumentNameRelateService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public R list(WxInstrumentNameRelate wxInstrumentNameRelate) {
|
||||
return R.ok(wxInstrumentNameRelateService.selectWxInstrumentNameRelateList(wxInstrumentNameRelate));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WxInstrumentNameRelate wxInstrumentNameRelate) {
|
||||
return toAjax(wxInstrumentNameRelateService.insertWxInstrumentNameRelate(wxInstrumentNameRelate));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WxInstrumentNameRelate wxInstrumentNameRelate) {
|
||||
return toAjax(wxInstrumentNameRelateService.updateWxInstrumentNameRelate(wxInstrumentNameRelate));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(wxInstrumentNameRelateService.deleteWxInstrumentNameRelateByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仪器关联正品控产品名Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-15
|
||||
*/
|
||||
public interface IWxInstrumentNameRelateService {
|
||||
/**
|
||||
* 查询仪器关联正品控产品名
|
||||
*
|
||||
* @param id 仪器关联正品控产品名主键
|
||||
* @return 仪器关联正品控产品名
|
||||
*/
|
||||
public WxInstrumentNameRelate selectWxInstrumentNameRelateById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仪器关联正品控产品名列表
|
||||
*
|
||||
* @param wxInstrumentNameRelate 仪器关联正品控产品名
|
||||
* @return 仪器关联正品控产品名集合
|
||||
*/
|
||||
public List<WxInstrumentNameRelate> selectWxInstrumentNameRelateList(WxInstrumentNameRelate wxInstrumentNameRelate);
|
||||
|
||||
/**
|
||||
* 新增仪器关联正品控产品名
|
||||
*
|
||||
* @param wxInstrumentNameRelate 仪器关联正品控产品名
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate);
|
||||
|
||||
/**
|
||||
* 修改仪器关联正品控产品名
|
||||
*
|
||||
* @param wxInstrumentNameRelate 仪器关联正品控产品名
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate);
|
||||
|
||||
/**
|
||||
* 批量删除仪器关联正品控产品名
|
||||
*
|
||||
* @param ids 需要删除的仪器关联正品控产品名主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentNameRelateByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除仪器关联正品控产品名信息
|
||||
*
|
||||
* @param id 仪器关联正品控产品名主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentNameRelateById(Long id);
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
|
||||
import com.flossom.common.core.mapper.WxInstrumentNameRelateMapper;
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import com.flossom.system.service.IWxInstrumentNameRelateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仪器关联正品控产品名Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-15
|
||||
*/
|
||||
@Service
|
||||
public class WxInstrumentNameRelateServiceImpl implements IWxInstrumentNameRelateService {
|
||||
|
||||
@Autowired
|
||||
private WxInstrumentNameRelateMapper wxInstrumentNameRelateMapper;
|
||||
|
||||
/**
|
||||
* 查询仪器关联正品控产品名
|
||||
*
|
||||
* @param id 仪器关联正品控产品名主键
|
||||
* @return 仪器关联正品控产品名
|
||||
*/
|
||||
@Override
|
||||
public WxInstrumentNameRelate selectWxInstrumentNameRelateById(Long id) {
|
||||
return wxInstrumentNameRelateMapper.selectWxInstrumentNameRelateById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仪器关联正品控产品名列表
|
||||
*
|
||||
* @param wxInstrumentNameRelate 仪器关联正品控产品名
|
||||
* @return 仪器关联正品控产品名
|
||||
*/
|
||||
@Override
|
||||
public List<WxInstrumentNameRelate> selectWxInstrumentNameRelateList(WxInstrumentNameRelate wxInstrumentNameRelate) {
|
||||
return wxInstrumentNameRelateMapper.selectWxInstrumentNameRelateList(wxInstrumentNameRelate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仪器关联正品控产品名
|
||||
*
|
||||
* @param wxInstrumentNameRelate 仪器关联正品控产品名
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate) {
|
||||
wxInstrumentNameRelate.setCreateTime(DateUtils.getNowDate());
|
||||
return wxInstrumentNameRelateMapper.insertWxInstrumentNameRelate(wxInstrumentNameRelate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仪器关联正品控产品名
|
||||
*
|
||||
* @param wxInstrumentNameRelate 仪器关联正品控产品名
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate) {
|
||||
return wxInstrumentNameRelateMapper.updateWxInstrumentNameRelate(wxInstrumentNameRelate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仪器关联正品控产品名
|
||||
*
|
||||
* @param ids 需要删除的仪器关联正品控产品名主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxInstrumentNameRelateByIds(Long[] ids) {
|
||||
return wxInstrumentNameRelateMapper.deleteWxInstrumentNameRelateByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仪器关联正品控产品名信息
|
||||
*
|
||||
* @param id 仪器关联正品控产品名主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxInstrumentNameRelateById(Long id) {
|
||||
return wxInstrumentNameRelateMapper.deleteWxInstrumentNameRelateById(id);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue