仪器管理-模式关联
parent
f441055b92
commit
886d3e911a
@ -0,0 +1,64 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentMode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仪器与模式的关联Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-17
|
||||
*/
|
||||
public interface WxInstrumentModeMapper {
|
||||
/**
|
||||
* 查询仪器与模式的关联
|
||||
*
|
||||
* @param id 仪器与模式的关联主键
|
||||
* @return 仪器与模式的关联
|
||||
*/
|
||||
public WxInstrumentMode selectWxInstrumentModeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仪器与模式的关联列表
|
||||
*
|
||||
* @param wxInstrumentMode 仪器与模式的关联
|
||||
* @return 仪器与模式的关联集合
|
||||
*/
|
||||
public List<WxInstrumentMode> selectWxInstrumentModeList(WxInstrumentMode wxInstrumentMode);
|
||||
|
||||
/**
|
||||
* 新增仪器与模式的关联
|
||||
*
|
||||
* @param wxInstrumentMode 仪器与模式的关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxInstrumentMode(WxInstrumentMode wxInstrumentMode);
|
||||
|
||||
/**
|
||||
* 修改仪器与模式的关联
|
||||
*
|
||||
* @param wxInstrumentMode 仪器与模式的关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxInstrumentMode(WxInstrumentMode wxInstrumentMode);
|
||||
|
||||
/**
|
||||
* 删除仪器与模式的关联
|
||||
*
|
||||
* @param id 仪器与模式的关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentModeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除仪器与模式的关联
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentModeByIds(Long[] ids);
|
||||
|
||||
public int deleteByInstrumentId(Long instrumentId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
<?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.WxInstrumentModeMapper">
|
||||
|
||||
<resultMap type="WxInstrumentMode" id="WxInstrumentModeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="instrumentId" column="instrument_id" />
|
||||
<result property="modeId" column="mode_id" />
|
||||
<result property="modeSort" column="mode_sort" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxInstrumentModeVo">
|
||||
select id, instrument_id, mode_id, mode_sort, status, create_by, create_time from wx_instrument_mode
|
||||
</sql>
|
||||
|
||||
<select id="selectWxInstrumentModeList" parameterType="WxInstrumentMode" resultMap="WxInstrumentModeResult">
|
||||
<include refid="selectWxInstrumentModeVo"/>
|
||||
<where>
|
||||
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
|
||||
<if test="modeId != null "> and mode_id = #{modeId}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
order by mode_sort
|
||||
</select>
|
||||
|
||||
<select id="selectWxInstrumentModeById" parameterType="Long" resultMap="WxInstrumentModeResult">
|
||||
<include refid="selectWxInstrumentModeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWxInstrumentMode" parameterType="WxInstrumentMode" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wx_instrument_mode
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="instrumentId != null">instrument_id,</if>
|
||||
<if test="modeId != null">mode_id,</if>
|
||||
<if test="modeSort != null">mode_sort,</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="modeId != null">#{modeId},</if>
|
||||
<if test="modeSort != null">#{modeSort},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxInstrumentMode" parameterType="WxInstrumentMode">
|
||||
update wx_instrument_mode
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
|
||||
<if test="modeId != null">mode_id = #{modeId},</if>
|
||||
<if test="modeSort != null">mode_sort = #{modeSort},</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="deleteWxInstrumentModeById" parameterType="Long">
|
||||
delete from wx_instrument_mode where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxInstrumentModeByIds" parameterType="String">
|
||||
delete from wx_instrument_mode where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByInstrumentId" parameterType="Long">
|
||||
delete from wx_instrument_mode where instrument_id = #{instrumentId}
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentMode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 仪器与模式的关联Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-17
|
||||
*/
|
||||
public interface IWxInstrumentModeService {
|
||||
/**
|
||||
* 查询仪器与模式的关联
|
||||
*
|
||||
* @param id 仪器与模式的关联主键
|
||||
* @return 仪器与模式的关联
|
||||
*/
|
||||
public WxInstrumentMode selectWxInstrumentModeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仪器与模式的关联列表
|
||||
*
|
||||
* @param wxInstrumentMode 仪器与模式的关联
|
||||
* @return 仪器与模式的关联集合
|
||||
*/
|
||||
public List<WxInstrumentMode> selectWxInstrumentModeList(WxInstrumentMode wxInstrumentMode);
|
||||
|
||||
/**
|
||||
* 新增仪器与模式的关联
|
||||
*
|
||||
* @param wxInstrumentMode 仪器与模式的关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxInstrumentMode(WxInstrumentMode wxInstrumentMode);
|
||||
|
||||
/**
|
||||
* 修改仪器与模式的关联
|
||||
*
|
||||
* @param wxInstrumentMode 仪器与模式的关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxInstrumentMode(WxInstrumentMode wxInstrumentMode);
|
||||
|
||||
/**
|
||||
* 批量删除仪器与模式的关联
|
||||
*
|
||||
* @param ids 需要删除的仪器与模式的关联主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentModeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除仪器与模式的关联信息
|
||||
*
|
||||
* @param id 仪器与模式的关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentModeById(Long id);
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentMode;
|
||||
import com.flossom.common.core.mapper.WxInstrumentModeMapper;
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.IWxInstrumentModeService;
|
||||
|
||||
/**
|
||||
* 仪器与模式的关联Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-17
|
||||
*/
|
||||
@Service
|
||||
public class WxInstrumentModeServiceImpl implements IWxInstrumentModeService {
|
||||
|
||||
@Autowired
|
||||
private WxInstrumentModeMapper wxInstrumentModeMapper;
|
||||
|
||||
/**
|
||||
* 查询仪器与模式的关联
|
||||
*
|
||||
* @param id 仪器与模式的关联主键
|
||||
* @return 仪器与模式的关联
|
||||
*/
|
||||
@Override
|
||||
public WxInstrumentMode selectWxInstrumentModeById(Long id) {
|
||||
return wxInstrumentModeMapper.selectWxInstrumentModeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仪器与模式的关联列表
|
||||
*
|
||||
* @param wxInstrumentMode 仪器与模式的关联
|
||||
* @return 仪器与模式的关联
|
||||
*/
|
||||
@Override
|
||||
public List<WxInstrumentMode> selectWxInstrumentModeList(WxInstrumentMode wxInstrumentMode) {
|
||||
return wxInstrumentModeMapper.selectWxInstrumentModeList(wxInstrumentMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仪器与模式的关联
|
||||
*
|
||||
* @param wxInstrumentMode 仪器与模式的关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWxInstrumentMode(WxInstrumentMode wxInstrumentMode) {
|
||||
wxInstrumentMode.setCreateTime(DateUtils.getNowDate());
|
||||
return wxInstrumentModeMapper.insertWxInstrumentMode(wxInstrumentMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仪器与模式的关联
|
||||
*
|
||||
* @param wxInstrumentMode 仪器与模式的关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWxInstrumentMode(WxInstrumentMode wxInstrumentMode) {
|
||||
return wxInstrumentModeMapper.updateWxInstrumentMode(wxInstrumentMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仪器与模式的关联
|
||||
*
|
||||
* @param ids 需要删除的仪器与模式的关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxInstrumentModeByIds(Long[] ids) {
|
||||
return wxInstrumentModeMapper.deleteWxInstrumentModeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仪器与模式的关联信息
|
||||
*
|
||||
* @param id 仪器与模式的关联主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxInstrumentModeById(Long id) {
|
||||
return wxInstrumentModeMapper.deleteWxInstrumentModeById(id);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue