设备标签二改 新增下拉框
This commit is contained in:
parent
04d79ac8b0
commit
2495ce88f5
|
|
@ -4,8 +4,10 @@ package com.bonus.sgzb.base.api.domain;
|
||||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
@ApiModel(value="com.bonus.sgzb.base.api.domain.MaMachine")
|
@ApiModel(value="com.bonus.sgzb.base.api.domain.MaMachine")
|
||||||
|
@Data
|
||||||
public class MaMachine extends BaseEntity {
|
public class MaMachine extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 机具ID
|
* 机具ID
|
||||||
|
|
@ -149,9 +151,7 @@ public class MaMachine extends BaseEntity {
|
||||||
private String labelCode;
|
private String labelCode;
|
||||||
|
|
||||||
|
|
||||||
public long getMaId() {
|
|
||||||
return maId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaId(long maId) {
|
public void setMaId(long maId) {
|
||||||
this.maId = maId;
|
this.maId = maId;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.sgzb.base.mapper;
|
package com.bonus.sgzb.base.mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||||
import com.bonus.sgzb.base.domain.MaLabelBind;
|
import com.bonus.sgzb.base.domain.MaLabelBind;
|
||||||
import com.bonus.sgzb.base.vo.MaLabelBindVO;
|
import com.bonus.sgzb.base.vo.MaLabelBindVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
@ -44,6 +45,14 @@ public interface MaLabelBindMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertMaLabelBindS(MaLabelBindVO maLabelBindVO);
|
public int insertMaLabelBindS(MaLabelBindVO maLabelBindVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增机具设备标签ma_label_bind
|
||||||
|
*
|
||||||
|
* @param maMachine 机具设备标签ma_label_bind
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMaLabel(MaMachine maMachine);
|
||||||
/**
|
/**
|
||||||
* 查询机具设备ma_id
|
* 查询机具设备ma_id
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.sgzb.base.service.impl;
|
package com.bonus.sgzb.base.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||||
import com.bonus.sgzb.base.mapper.MaLabelBindMapper;
|
import com.bonus.sgzb.base.mapper.MaLabelBindMapper;
|
||||||
import com.bonus.sgzb.base.service.IMaLabelBindService;
|
import com.bonus.sgzb.base.service.IMaLabelBindService;
|
||||||
import com.bonus.sgzb.base.vo.MaLabelBindVO;
|
import com.bonus.sgzb.base.vo.MaLabelBindVO;
|
||||||
|
|
@ -8,6 +9,7 @@ import lombok.extern.flogger.Flogger;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -58,7 +60,7 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService
|
||||||
return maLabelBindMapper.selecthistoryList(maLabelBindVO);
|
return maLabelBindMapper.selecthistoryList(maLabelBindVO);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 新增机具设备标签ma_label_bind
|
* 绑定机具设备标签ma_label_bind
|
||||||
*
|
*
|
||||||
* @param maLabelBind 机具设备标签ma_label_bind
|
* @param maLabelBind 机具设备标签ma_label_bind
|
||||||
* @return 结果
|
* @return 结果
|
||||||
|
|
@ -69,9 +71,14 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int b =0;
|
int b =0;
|
||||||
MaLabelBindVO bean = maLabelBindMapper.selectMaMachineMaId(maLabelBind.getMaCode());
|
MaLabelBindVO bean = maLabelBindMapper.selectMaMachineMaId(maLabelBind.getMaCode());
|
||||||
if(StringHelper.isNotEmpty(bean.getMaId())){
|
if(null != bean){
|
||||||
maLabelBind.setMaId(bean.getMaId());
|
return b;
|
||||||
maLabelBind.setTypeId(bean.getTypeId());
|
}else {
|
||||||
|
MaMachine maMachine =new MaMachine();
|
||||||
|
maMachine.setMaCode(maLabelBind.getMaCode());
|
||||||
|
maMachine.setTypeId(maLabelBind.getTypeId());
|
||||||
|
maLabelBindMapper.insertMaLabel(maMachine);
|
||||||
|
maLabelBind.setMaId(String.valueOf(maMachine.getMaId()));
|
||||||
maLabelBind.setStatus("1");
|
maLabelBind.setStatus("1");
|
||||||
maLabelBind.setIsBind("1");
|
maLabelBind.setIsBind("1");
|
||||||
b=maLabelBindMapper.updateMaLabelBindMaIds(maLabelBind);
|
b=maLabelBindMapper.updateMaLabelBindMaIds(maLabelBind);
|
||||||
|
|
|
||||||
|
|
@ -176,4 +176,19 @@
|
||||||
ma_id = #{maId},is_bind =#{isBind}
|
ma_id = #{maId},is_bind =#{isBind}
|
||||||
where label_id =#{labelId}
|
where label_id =#{labelId}
|
||||||
</update>
|
</update>
|
||||||
|
<insert id="insertMaLabels">
|
||||||
|
insert into ma_maLabel
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="typeId != null">type_id,</if>
|
||||||
|
<if test="maCode != null">ma_code,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="typeId != null">#{typeId},</if>
|
||||||
|
<if test="labelCode != null">#{maCode},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<insert id="insertMaLabel" useGeneratedKeys="true" keyProperty="maId">
|
||||||
|
insert into ma_machine (type_id,ma_code,create_time)
|
||||||
|
values (#{typeId},#{maCode},now());
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue