设备标签缺陷
This commit is contained in:
parent
54a6c380d0
commit
54eed165b5
|
|
@ -75,6 +75,7 @@ public interface MaLabelBindMapper
|
|||
*/
|
||||
public int updateMaLabelBindByMaIds(Long id);
|
||||
|
||||
public int updateMaLabelBindMaIds(MaLabelBindVO maLabelBindVO);
|
||||
MaLabelBindVO selectMaMachineMaId(String maCode);
|
||||
|
||||
int insertLabelBind(MaLabelBind maLabelBind);
|
||||
|
|
|
|||
|
|
@ -67,10 +67,14 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService
|
|||
public int insertMaLabelBind(MaLabelBindVO maLabelBind)
|
||||
{
|
||||
int i = 0;
|
||||
int b =0;
|
||||
MaLabelBindVO bean = maLabelBindMapper.selectMaMachineMaId(maLabelBind.getMaCode());
|
||||
if(StringHelper.isNotEmpty(bean.getMaId())){
|
||||
maLabelBind.setMaId(bean.getMaId());
|
||||
maLabelBind.setTypeId(bean.getTypeId());
|
||||
maLabelBind.setStatus("1");
|
||||
maLabelBind.setIsBind("1");
|
||||
b=maLabelBindMapper.updateMaLabelBindMaIds(maLabelBind);
|
||||
i = maLabelBindMapper.insertMaLabelBindS(maLabelBind);
|
||||
}
|
||||
return i ;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public class MaMachineLabelServiceImpl implements IMaMachineLabelService
|
|||
code = format + "-000" + lableNum;
|
||||
}
|
||||
lableNum++;
|
||||
maMachineLabel.setIsBind("0");
|
||||
maMachineLabel.setLabelCode(code);
|
||||
maMachineLabelMapper.insertMaMachineLabel(maMachineLabel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</sql>
|
||||
|
||||
<select id="selectMaLabelBindList" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO" resultMap="MaLabelBindVOResult">
|
||||
SELECT b.label_id,a.id,b.label_code,a.bind_time,b.label_type,mt.type_id,mt.type_name,
|
||||
SELECT b.label_id,a.id,b.is_bind,b.label_code,a.bind_time,b.label_type,mt.type_id,mt.type_name,
|
||||
mt2.type_id as modelId , mt2.type_name as modelName,mt3.type_name as wpName,
|
||||
mt4.type_name as kindName ,a.status,a.binder,dic.name,ma.ma_code,user.user_name
|
||||
FROM ma_machine_label b
|
||||
|
|
@ -55,7 +55,9 @@
|
|||
<if test="companyId != null and companyId != ''"> and a.company_id = #{companyId}</if>
|
||||
<if test="modelId != null and modelId != ''"> and mt2.type_id= #{modelId}</if>
|
||||
<if test="wpName != null and wpName != ''"> and mt3.type_name = #{wpName}</if>
|
||||
<if test="isBind != null and isBind != ''"> and b.is_bind = #{isBind}</if>
|
||||
</where>
|
||||
ORDER BY b.is_bind ASC
|
||||
</select>
|
||||
<select id="selecthistoryList" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO" resultMap="MaLabelBindVOResult">
|
||||
SELECT a.ma_id,a.label_code,a.bind_time,a.label_type,mt.type_id,mt.type_name,
|
||||
|
|
@ -106,7 +108,7 @@
|
|||
<if test="binder != null">#{binder},</if>
|
||||
<if test="labelType != null">#{labelType},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="isBind != null">#{binderTime},</if>
|
||||
<if test="bindTime != null">#{bindTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -119,7 +121,7 @@
|
|||
<if test="binder != null">binder,</if>
|
||||
<if test="labelType != null">label_type,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="isBind != null">binder_time,</if>
|
||||
<if test="bindTime != null">bind_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -129,7 +131,7 @@
|
|||
<if test="binder != null">#{binder},</if>
|
||||
<if test="labelType != null">#{labelType},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="bindTime != null">#{binderTime},</if>
|
||||
<if test="bindTime != null">#{bindTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -161,12 +163,17 @@
|
|||
</delete>
|
||||
|
||||
<update id="updateMaLabelBindByMaIds" parameterType="Long">
|
||||
update ma_label_bind set status = '0' where ma_id = #{id}
|
||||
update ma_label_bind set status = '0' where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectMaMachineMaId" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO">
|
||||
select ma_id as maId
|
||||
select ma_id as maId,type_id as typeId
|
||||
from ma_machine
|
||||
where ma_code = #{maCode}
|
||||
</select>
|
||||
<update id="updateMaLabelBindMaIds" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO">
|
||||
update ma_machine_label set
|
||||
ma_id = #{maId},is_bind =#{isBind}
|
||||
where label_id =#{labelId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<result property="companyId" column="company_id" />
|
||||
</resultMap>
|
||||
<sql id="selectMaMachineLabelVo">
|
||||
select label_id, label_code, type_id, is_bind, label_type, company_id
|
||||
select label_id, label_code, ma_id, is_bind, label_type, company_id
|
||||
from ma_machine_label
|
||||
</sql>
|
||||
<select id="selectMaMachineLabelList" parameterType="com.bonus.sgzb.base.domain.MaMachineLabel" resultMap="MaMachineLabelResult">
|
||||
|
|
|
|||
Loading…
Reference in New Issue