小程序-绑定仪器
parent
d7d5241366
commit
c3809e3512
@ -0,0 +1,62 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentSerialLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 仪器序列号关联日志Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-22
|
||||
*/
|
||||
public interface WxInstrumentSerialLogMapper {
|
||||
/**
|
||||
* 查询仪器序列号关联日志
|
||||
*
|
||||
* @param id 仪器序列号关联日志主键
|
||||
* @return 仪器序列号关联日志
|
||||
*/
|
||||
public WxInstrumentSerialLog selectWxInstrumentSerialLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询仪器序列号关联日志列表
|
||||
*
|
||||
* @param wxInstrumentSerialLog 仪器序列号关联日志
|
||||
* @return 仪器序列号关联日志集合
|
||||
*/
|
||||
public List<WxInstrumentSerialLog> selectWxInstrumentSerialLogList(WxInstrumentSerialLog wxInstrumentSerialLog);
|
||||
|
||||
/**
|
||||
* 新增仪器序列号关联日志
|
||||
*
|
||||
* @param wxInstrumentSerialLog 仪器序列号关联日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxInstrumentSerialLog(WxInstrumentSerialLog wxInstrumentSerialLog);
|
||||
|
||||
/**
|
||||
* 修改仪器序列号关联日志
|
||||
*
|
||||
* @param wxInstrumentSerialLog 仪器序列号关联日志
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxInstrumentSerialLog(WxInstrumentSerialLog wxInstrumentSerialLog);
|
||||
|
||||
/**
|
||||
* 删除仪器序列号关联日志
|
||||
*
|
||||
* @param id 仪器序列号关联日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentSerialLogById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除仪器序列号关联日志
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxInstrumentSerialLogByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
<?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.WxInstrumentSerialLogMapper">
|
||||
|
||||
<resultMap type="WxInstrumentSerialLog" id="WxInstrumentSerialLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="userMobile" column="user_mobile" />
|
||||
<result property="userHeadimg" column="user_headimg" />
|
||||
<result property="instrumentId" column="instrument_id" />
|
||||
<result property="instrumentName" column="instrument_name" />
|
||||
<result property="serial" column="serial" />
|
||||
<result property="bindingStatus" column="binding_status" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxInstrumentSerialLogVo">
|
||||
select id, user_id, user_name, user_mobile, user_headimg, instrument_id, instrument_name, serial, binding_status, status, create_by, create_time, remark from wx_instrument_serial_log
|
||||
</sql>
|
||||
|
||||
<select id="selectWxInstrumentSerialLogList" parameterType="WxInstrumentSerialLog" resultMap="WxInstrumentSerialLogResult">
|
||||
<include refid="selectWxInstrumentSerialLogVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userMobile != null and userMobile != ''"> and user_mobile = #{userMobile}</if>
|
||||
<if test="userHeadimg != null and userHeadimg != ''"> and user_headimg = #{userHeadimg}</if>
|
||||
<if test="instrumentId != null "> and instrument_id = #{instrumentId}</if>
|
||||
<if test="instrumentName != null and instrumentName != ''"> and instrument_name like concat('%', #{instrumentName}, '%')</if>
|
||||
<if test="serial != null and serial != ''"> and serial = #{serial}</if>
|
||||
<if test="bindingStatus != null "> and binding_status = #{bindingStatus}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWxInstrumentSerialLogById" parameterType="Long" resultMap="WxInstrumentSerialLogResult">
|
||||
<include refid="selectWxInstrumentSerialLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWxInstrumentSerialLog" parameterType="WxInstrumentSerialLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wx_instrument_serial_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="userMobile != null">user_mobile,</if>
|
||||
<if test="userHeadimg != null">user_headimg,</if>
|
||||
<if test="instrumentId != null">instrument_id,</if>
|
||||
<if test="instrumentName != null and instrumentName != ''">instrument_name,</if>
|
||||
<if test="serial != null and serial != ''">serial,</if>
|
||||
<if test="bindingStatus != null">binding_status,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="userMobile != null">#{userMobile},</if>
|
||||
<if test="userHeadimg != null">#{userHeadimg},</if>
|
||||
<if test="instrumentId != null">#{instrumentId},</if>
|
||||
<if test="instrumentName != null and instrumentName != ''">#{instrumentName},</if>
|
||||
<if test="serial != null and serial != ''">#{serial},</if>
|
||||
<if test="bindingStatus != null">#{bindingStatus},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxInstrumentSerialLog" parameterType="WxInstrumentSerialLog">
|
||||
update wx_instrument_serial_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="userMobile != null">user_mobile = #{userMobile},</if>
|
||||
<if test="userHeadimg != null">user_headimg = #{userHeadimg},</if>
|
||||
<if test="instrumentId != null">instrument_id = #{instrumentId},</if>
|
||||
<if test="instrumentName != null and instrumentName != ''">instrument_name = #{instrumentName},</if>
|
||||
<if test="serial != null and serial != ''">serial = #{serial},</if>
|
||||
<if test="bindingStatus != null">binding_status = #{bindingStatus},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWxInstrumentSerialLogById" parameterType="Long">
|
||||
delete from wx_instrument_serial_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxInstrumentSerialLogByIds" parameterType="String">
|
||||
delete from wx_instrument_serial_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,15 @@
|
||||
package com.flossom.miniProgram.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxInstrumentSerial;
|
||||
|
||||
/**
|
||||
* 仪器列Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-06
|
||||
*/
|
||||
public interface IWxInstrumentService {
|
||||
WxInstrumentSerial getInstrumentInfoBySerial(String serial);
|
||||
|
||||
void binding(String serial);
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.flossom.miniProgram.service.impl;
|
||||
|
||||
import com.flossom.common.core.mapper.WxInstrumentSerialMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 仪器序列号关联Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-01-10
|
||||
*/
|
||||
@Service
|
||||
public class WxInstrumentSerialServiceImpl {
|
||||
|
||||
@Autowired
|
||||
private WxInstrumentSerialMapper wxInstrumentSerialMapper;
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue