change - pda优化

master
yinq 1 year ago
parent dfd864b4fa
commit 14d996b26a

@ -23,8 +23,6 @@ public interface PdaBindingMapper {
@Param("innerCode")String innerCode);
int countQualityRecordByCode(String code);
@DataSource(value = DataSourceType.SLAVE)
int updateCodeBinding(@Param("boxCode") String boxCode, @Param("innerCode")String innerCode);
int submitRepair(@Param("info")RepairSubmitInfoDto info);
@ -73,4 +71,12 @@ public interface PdaBindingMapper {
String selectBoxNameBarCode(String boxCode);
@DataSource(value = DataSourceType.SLAVE)
int updateCodeBinding(@Param("boxCode") String boxCode, @Param("innerCode")String innerCode);
@DataSource(value = DataSourceType.SLAVE)
int insertCodeBinding(@Param("boxCode") String boxCode);
}

@ -59,7 +59,12 @@ public class PdaServiceImpl implements IPdaBindingService {
@Override
public int updateCodeBinding(String boxCode, String innerCode) {
return mapper.updateCodeBinding(boxCode,innerCode);
int flag = mapper.updateCodeBinding(boxCode, innerCode);
if (flag == 0){
mapper.insertCodeBinding(boxCode);
flag = mapper.updateCodeBinding(boxCode, innerCode);
}
return flag;
}
/**

@ -17,19 +17,24 @@
</select>
<insert id="insertBindingInfo">
INSERT INTO CODE_BINDING(OBJ_ID, BOX_CODE, BOX_NAME, LINER_CODE, BINDING_RESULT, RECORD_TIME1)
INSERT INTO C##AUCMA_SCADA.CODE_BINDING(OBJ_ID, BOX_CODE, BOX_NAME, LINER_CODE, BINDING_RESULT, RECORD_TIME1)
VALUES (SEQ_CODE_BINDING.nextval, #{boxCode}, #{boxName,jdbcType=NVARCHAR}, #{innerCode}, '成功', SYSDATE)
</insert>
<update id="updateCodeBinding">
UPDATE CODE_BINDING
UPDATE C##AUCMA_SCADA.CODE_BINDING
SET PRODUCT_CODE = #{innerCode}, BINDING_RESULT = '成功',RECORD_TIME2 = SYSDATE,IS_PASS= 1
where BOX_CODE = #{boxCode}
</update>
<insert id="insertCodeBinding">
INSERT INTO C##AUCMA_SCADA.CODE_BINDING(OBJ_ID, BOX_CODE)
VALUES (SEQ_CODE_BINDING.nextval, #{boxCode})
</insert>
<select id="countQualityRecordByCode" resultType="int">
select count(OBJ_ID)
from REPORT_QUALITY_INSPECTION
where BAR_CODE = #{code} and IS_FLAG !=1
where BAR_CODE = #{code} and TREATMENT_MEASURE = 1 and PROCESS_RESULT is null
</select>
<update id="submitRepair" parameterType="com.aucma.api.domain.dto.RepairSubmitInfoDto">
UPDATE REPORT_QUALITY_INSPECTION
@ -117,13 +122,11 @@
<update id="unbindBarCode">
UPDATE CODE_BINDING
UPDATE C##AUCMA_SCADA.CODE_BINDING
SET PRODUCT_CODE = NULL, RECORD_TIME2 = NULL
WHERE BOX_CODE = #{boxCode}
</update>
<update id="updateExceptionProcess">
</update>
<insert id="printSupplementBarcode">
INSERT INTO PRINT_SUPPLEMENTBARCODE
@ -144,4 +147,5 @@
<if test="PRINT_NAME != null">#{PRINT_NAME},</if>
</trim>
</insert>
</mapper>

@ -74,7 +74,7 @@
<if test="lineNo != null ">and line_no = #{lineNo}</if>
<if test="gongwno != null ">and gongwno = #{gongwno}</if>
<if test="cpno != null and cpno != ''">and cpno = #{cpno}</if>
<if test="cpmodel != null and cpmodel != ''">and cpmodel = #{cpmodel}</if>
<if test="cpmodel != null and cpmodel != ''">and cpmodel like concat(concat('%', #{cpmodel}), '%')</if>
<if test="factorymodel != null and factorymodel != ''">and factorymodel = #{factorymodel}</if>
<if test="voltage != null ">and voltage = #{voltage}</if>
<if test="point2 != null and point2 != ''">and point2 = #{point2}</if>

Loading…
Cancel
Save