Переглянути джерело

Merge remote-tracking branch 'origin/20200908' into 20200908

lin 4 роки тому
батько
коміт
2890838bd7

+ 1 - 0
meter-reading-common/src/main/java/com/huaxu/zoniot/common/ResultStatus.java

@@ -43,6 +43,7 @@ public enum ResultStatus {
     WATER_METER_CITY_ERROR(-829,"水表市异常"),
     WATER_METER_REGION_ERROR(-8291,"水表区异常"),
     WATER_METER_EXIST_ERROR(-8292,"水表已存在异常"),
+    WATER_METER_CRM_ERROR(-8292,"CRM系统中档案缺失"),
     // 迁移相关异常
     MIGRATE_ERROR(-830,"迁移请求信息异常"),
     MIGRATE_CUSTOMER_ERROR(-831,"迁移客户信息异常"),

+ 5 - 0
meter-reading-common/src/main/java/com/huaxu/zoniot/dao/WaterMeterMapper.java

@@ -54,6 +54,9 @@ public interface WaterMeterMapper {
     WaterMeter findWaterMeterByDeviceNoAndCustomerList(@Param("deviceNo") String deviceNo,
                                                      @Param("customerList") List<Integer> customerList);
 
+    WaterMeter findWaterMeterByMeterNoAndCustomerList(@Param("meterNo") String meterNo,
+                                                       @Param("customerList") List<Integer> customerList);
+
     WaterMeter findWaterMeterByDeviceNoAndCustomerId(@Param("deviceNo") String deviceNo,
                                                      @Param("customerId") Integer customerId);
 
@@ -73,6 +76,8 @@ public interface WaterMeterMapper {
 
     List<WaterMeter> findWaterMeterByDeviceNoAndChildrenCustomer(@Param("deviceNoList")List<String> deviceNoList , @Param("customerList") List<Integer> customerList);
 
+    List<WaterMeter> findWaterMeterByMeterNoAndChildrenCustomer(@Param("meterNoList")List<String> meterNoList , @Param("customerList") List<Integer> customerList);
+
     List<WaterMeter> getMeterListByRange(
             @Param("customers") String customers,
             @Param("communitys") String communitys,

+ 1 - 1
meter-reading-common/src/main/java/com/huaxu/zoniot/service/WaterMeterService.java

@@ -24,5 +24,5 @@ public interface WaterMeterService {
 
     List<WaterMeter> findWaterMeterList(List<String> deviceNoList , Integer customerId ) ;
 
-    List<WaterMeter> findWaterMeterListWithChildrenCustomer(List<String> deviceNoList , Integer customerId ) ;
+    List<WaterMeter> findWaterMeterListWithChildrenCustomer(List<String> deviceNoList , Integer customerId ,boolean isMeterCode) ;
 }

+ 10 - 2
meter-reading-common/src/main/java/com/huaxu/zoniot/service/impl/WaterMeterServiceImpl.java

@@ -132,9 +132,17 @@ public class WaterMeterServiceImpl implements WaterMeterService, ModelValidate<W
     }
 
     @Override
-    public List<WaterMeter> findWaterMeterListWithChildrenCustomer(List<String> deviceNoList, Integer customerId) {
+    public List<WaterMeter> findWaterMeterListWithChildrenCustomer(List<String> deviceNoList, Integer customerId,boolean isMeterCode) {
         List<Integer> customerIdsWithChildren = findCustomerIdsWithChildren(customerId);
-        return waterMeterMapper.findWaterMeterByDeviceNoAndChildrenCustomer(deviceNoList,customerIdsWithChildren);
+        if(isMeterCode){
+            // 需要查询的是水表电子号
+            return waterMeterMapper.findWaterMeterByMeterNoAndChildrenCustomer(deviceNoList,customerIdsWithChildren);
+        }
+        else{
+            // 需要查询的是水表设备编号
+            return waterMeterMapper.findWaterMeterByDeviceNoAndChildrenCustomer(deviceNoList,customerIdsWithChildren);
+        }
+
     }
 
 

+ 16 - 0
meter-reading-common/src/main/resources/mapper/WaterMeterMapper.xml

@@ -224,6 +224,14 @@
             #{customerId}
         </foreach>
     </select>
+    <select id="findWaterMeterByMeterNoAndChildrenCustomer" resultMap="BaseResultMap">
+        <include refid="Base_Meter_Query" />
+        and d.water_meter_no in <foreach collection="meterNoList" item="meterNo" open="(" close=")" separator=",">#{meterNo}</foreach>
+        and d.customer_id  in
+        <foreach collection="customerList" item="customerId" open="(" close=")" separator=",">
+            #{customerId}
+        </foreach>
+    </select>
     <select id="findWaterMeterByDeviceNoAndCustomerList" resultMap="BaseResultMap">
         <include refid="Base_Meter_Query" />
         and d.device_no = #{deviceNo,jdbcType=INTEGER}
@@ -232,6 +240,14 @@
             #{customerId}
         </foreach>
     </select>
+    <select id="findWaterMeterByMeterNoAndCustomerList" resultMap="BaseResultMap">
+        <include refid="Base_Meter_Query" />
+        and d.water_meter_no = #{meterNo,jdbcType=INTEGER}
+        and d.customer_id  in
+        <foreach collection="customerList" item="customerId" open="(" close=")" separator=",">
+            #{customerId}
+        </foreach>
+    </select>
     <select id="getMeterListByRange" resultMap="BaseResultMap">
         <include refid="Base_Meter_Query" />
         AND d.sys_id != - 99

+ 34 - 0
meter-reading-tianjin/src/main/java/com/huaxu/zoniot/dao/CrmSyncInfoMapper.java

@@ -0,0 +1,34 @@
+package com.huaxu.zoniot.dao;
+
+import com.huaxu.zoniot.entity.CrmSyncInfo;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p></p>
+ * @Author wilian.peng
+ * @Date 2021/3/25 10:35
+ * @Version 1.0
+ */
+@Mapper
+public interface CrmSyncInfoMapper {
+    int deleteByPrimaryKey(String crmId);
+
+    int insert(CrmSyncInfo record);
+
+    int insertSelective(CrmSyncInfo record);
+
+    CrmSyncInfo selectByPrimaryKey(String crmId);
+
+    int updateByPrimaryKeySelective(CrmSyncInfo record);
+
+    int updateByPrimaryKey(CrmSyncInfo record);
+
+    int batchInsert(@Param("list") List<CrmSyncInfo> list);
+
+    CrmSyncInfo findByMeterCode(@Param("meterCode") String meterCode);
+
+    CrmSyncInfo findByNccid(@Param("nccid") String nccid);
+}

+ 1 - 1
meter-reading-tianjin/src/main/java/com/huaxu/zoniot/dto/RegistIMEIRequest.java

@@ -82,7 +82,7 @@ public class RegistIMEIRequest implements Serializable {
     }
     @Override
     public String toString() {
-        return "RegistData [customerNo=" + customerNo + ", registNo=" + registNo + ", smallZone=" + smallZone
+        return "RegistData [customerNo=" + customerNo + ", meterType=" + meterType+", registNo=" + registNo + ", smallZone=" + smallZone
                 + ", addr=" + addr + ", location=" + location + ", imei=" + imei + ", apiKey=" + apiKey + "]";
     }
 }

+ 292 - 0
meter-reading-tianjin/src/main/java/com/huaxu/zoniot/entity/CrmSyncInfo.java

@@ -0,0 +1,292 @@
+package com.huaxu.zoniot.entity;
+
+import lombok.Data;
+
+/**
+ * <p></p>
+ * @Author wilian.peng
+ * @Date 2021/3/25 10:35
+ * @Version 1.0
+ */
+@Data
+public class CrmSyncInfo {
+    /**
+    * Fid
+    */
+    private String crmId;
+
+    /**
+    * 创建组织
+    */
+    private String createOrg;
+
+    /**
+    * 订单编号
+    */
+    private String orderNo;
+
+    /**
+    * 出厂读数
+    */
+    private String factoryRead;
+
+    /**
+    * IMEI号2
+    */
+    private String imei2;
+
+    /**
+    * 收货人
+    */
+    private String shipPerson;
+
+    /**
+    * 波特率编码
+    */
+    private String rateId;
+
+    /**
+    * 规则型号
+    */
+    private String btSize;
+
+    /**
+    * 表具ID
+    */
+    private String prodId;
+
+    /**
+    * 阀门状态编码
+    */
+    private String valeId;
+
+    /**
+    * 表具更新时间
+    */
+    private String updateTime;
+
+    /**
+    * 流量检测信息
+    */
+    private String checkInfo;
+
+    /**
+    * 运营商
+    */
+    private String operators;
+
+    /**
+    * 预支水量编码
+    */
+    private String advanceId;
+
+    /**
+    * 节点号
+    */
+    private String nodeNo;
+
+    /**
+    * 传输方式
+    */
+    private String commType;
+
+    /**
+    * 产品名称
+    */
+    private String product;
+
+    /**
+    * 波特率
+    */
+    private String baudRate;
+
+    /**
+    * NCCID号
+    */
+    private String nccid;
+
+    /**
+    * 收货地址
+    */
+    private String address;
+
+    /**
+    * 阀门状态,1开 2关 3无阀门
+    */
+    private String valveStatus;
+
+    /**
+    * IMEI号
+    */
+    private String imei;
+
+    /**
+    * 表类型
+    */
+    private String meterType;
+
+    /**
+    * ERP客户ID
+    */
+    private String custErpId;
+
+    /**
+    * 付费模式
+    */
+    private String payMode;
+
+    /**
+    * 出厂日期,格式“yyyy-MM-dd”
+    */
+    private String deliveryDate;
+
+    /**
+    * 用户
+    */
+    private String userId;
+
+    /**
+    * 联系电话
+    */
+    private String telphone;
+
+    /**
+    * 水表电子号
+    */
+    private String meterCode;
+
+    /**
+    * 数据上报地址
+    */
+    private String dataAddress;
+
+    /**
+    * 物料名称(水表型号)
+    */
+    private String meterModel;
+
+    /**
+    * 物料编码
+    */
+    private String materialId;
+
+    /**
+    * 销售组织
+    */
+    private String salesOrg;
+
+    /**
+    * 客户名称
+    */
+    private String customerName;
+
+    /**
+    * 付费模式编码
+    */
+    private String paytypeId;
+
+    /**
+    * 通讯协议
+    */
+    private String commProtrol;
+
+    /**
+    * ERP订单ID
+    */
+    private String orderId;
+
+    /**
+    * Q1检测用水量(L)
+    */
+    private String water1;
+
+    /**
+    * Q3终止值(L)
+    */
+    private String end3;
+
+    /**
+    * Q3最小标准误差值
+    */
+    private String mix3;
+
+    /**
+    * Q3检测用水量(L)
+    */
+    private String qwater3;
+
+    /**
+    * 预支水量
+    */
+    private String advanceNum;
+
+    /**
+    * Q2终止值(L)
+    */
+    private String end2;
+
+    /**
+    * Q2最小标准误差值
+    */
+    private String mix2;
+
+    /**
+    * Q3起始值(L)
+    */
+    private String begin3;
+
+    /**
+    * Q2示值误差(%)
+    */
+    private String error2;
+
+    /**
+    * Q3最大标准误差值
+    */
+    private String max3;
+
+    /**
+    * Q2起始值(L)
+    */
+    private String begin2;
+
+    /**
+    * Q2检测用水量(L)
+    */
+    private String water2;
+
+    /**
+    * Q1终止值(L)
+    */
+    private String end1;
+
+    /**
+    * Q2最大标准误差值
+    */
+    private String max2;
+
+    /**
+    * Q1示值误差(%)
+    */
+    private String error1;
+
+    /**
+    * Q1最小标准误差值
+    */
+    private String mix1;
+
+    /**
+    * Q1最小标准误差值
+    */
+    private String begin1;
+
+    /**
+    * Q1最大标准误差值
+    */
+    private String max1;
+
+    /**
+    * Q3示值误差(%)
+    */
+    private String error3;
+}

+ 1 - 1
meter-reading-tianjin/src/main/java/com/huaxu/zoniot/service/TianJinMeterReadingService.java

@@ -31,6 +31,6 @@ public interface TianJinMeterReadingService {
      * @param imei
      * @return
      */
-    RespData queryImei(String imei);
+    RespData queryImei(String imei,Integer meterType);
 
 }

+ 90 - 24
meter-reading-tianjin/src/main/java/com/huaxu/zoniot/service/impl/TianJinMeterReadingServiceImpl.java

@@ -5,6 +5,7 @@ import com.huaxu.zoniot.common.Constants;
 import com.huaxu.zoniot.common.ErrorConstants;
 import com.huaxu.zoniot.common.ResultStatus;
 import com.huaxu.zoniot.common.ServiceException;
+import com.huaxu.zoniot.dao.CrmSyncInfoMapper;
 import com.huaxu.zoniot.dao.CustomerMapper;
 import com.huaxu.zoniot.dao.WaterMeterMapper;
 import com.huaxu.zoniot.dto.RegistIMEIRequest;
@@ -77,6 +78,8 @@ public class TianJinMeterReadingServiceImpl implements TianJinMeterReadingServic
     @Autowired
     MongoTemplate mongoTemplate ; 
 
+    @Autowired
+    CrmSyncInfoMapper crmSyncInfoMapper ;
 
     @Override
     public RespData registImei(RegistIMEIRequest request) {
@@ -90,17 +93,46 @@ public class TianJinMeterReadingServiceImpl implements TianJinMeterReadingServic
             // 3,保存设备
             WaterMeter waterMeter = new WaterMeter();
             waterMeter.setBuildingId(building.getId());
-            waterMeter.setDeviceNo(request.getImei());
-            waterMeter.setMeterNo(request.getRegistNo());
-            waterMeter.setMeterFileNo(request.getCustomerNo());
+            waterMeter.setMeterFileNo(request.getRegistNo());
             waterMeter.setLocation(request.getAddr()+request.getLocation());
+            List<Integer> customerIds = findCustomerIdsWithChildren(customerCode);
             if(request.getMeterType() == 1){
                 // Lora表
                 waterMeter.setDeviceTypeId(deviceTypeLoraCode);
+                waterMeter.setMeterNo(request.getImei());
+                // 校验设备是否已经注册
+                WaterMeter exists = waterMeterMapper.findWaterMeterByMeterNoAndCustomerList(request.getImei(),customerIds);
+                if(exists != null){
+                    throw new ServiceException(ResultStatus.WATER_METER_EXIST_ERROR);
+                }
+                // 关联CRM中的信息,查询设备节点编号,如果不存在则抛出注册失败的异常
+                CrmSyncInfo crmInfo = crmSyncInfoMapper.findByMeterCode(request.getImei());
+                if(crmInfo == null){
+                    throw new ServiceException(ResultStatus.WATER_METER_CRM_ERROR);
+                }
+                else{
+                    waterMeter.setDeviceNo(crmInfo.getNccid());
+                }
             }
             else if(request.getMeterType() == 2){
                 // nb表
+                waterMeter.setDeviceNo(request.getImei());
                 waterMeter.setDeviceTypeId(deviceTypeNBCode);
+                // 校验设备是否已经注册
+                WaterMeter exists = waterMeterMapper.findWaterMeterByDeviceNoAndCustomerList(request.getImei(),customerIds);
+                if(exists != null){
+                    throw new ServiceException(ResultStatus.WATER_METER_EXIST_ERROR);
+                }
+                // 关联CRM中的信息,查询水表电子号信息
+                CrmSyncInfo crmInfo = crmSyncInfoMapper.findByNccid(request.getImei());
+                if(crmInfo != null){
+                    waterMeter.setMeterNo(crmInfo.getMeterCode());
+                }
+                else{
+                    log.warn("{} Can not get meter code from CRM !",request.getImei());
+                    // 做此标记方便查询
+                    waterMeter.setMeterNo("EFF"+request.getImei());
+                }
             }
             waterMeter.setSiteId(community.getSiteId());
             waterMeter.setCustomerId(community.getCustomerId());
@@ -153,34 +185,47 @@ public class TianJinMeterReadingServiceImpl implements TianJinMeterReadingServic
     }
     @Override
     public RespData queryReadRecordData(String[] imeiArray,Integer readDay,Integer meterType){
+        List<String> deviceNoList = Arrays.asList(imeiArray);
+        List<WaterMeter> waterMeterList = null ;
         if(readDay == null){
             // Lora表,默认查询前一天的数据,NB表,默认查询当天的数据
+            // Lora表,传入的是水表电子号
             if(meterType == 1){
                 readDay = Integer.parseInt(DateUtil.format(DateUtil.offsetDay(DateUtil.date(),-1),
                         Constants.DEFAULT_METER_READ_DATE_FORMAT));
+                waterMeterList = waterMeterService.findWaterMeterListWithChildrenCustomer(deviceNoList,
+                        customerCode,true);
             }
             else{
-                // 默认查询今天的
+                // NB表,默认查询今天的
+                // NB表,传入的是水表设备编号
                 readDay = Integer.parseInt(DateUtil.format(DateUtil.date(),
                         Constants.DEFAULT_METER_READ_DATE_FORMAT));
+                waterMeterList = waterMeterService.findWaterMeterListWithChildrenCustomer(deviceNoList,
+                        customerCode,false);
             }
         }
+        List<Long> deviceIds = new ArrayList<>(200);
         RespData  respData = new RespData();
-        List<String> deviceNoList = Arrays.asList(imeiArray);
-        //List<Integer> customerIds = findCustomerIdsWithChildren(customerCode);
-        List<WaterMeter> waterMeterList = waterMeterService.findWaterMeterListWithChildrenCustomer(deviceNoList,
-                customerCode);
-        Criteria criteria = Criteria.where("readDate").is(readDay)
-                .and("status").is(1)
-                .and("readStatus").is("2")
-                .and("deviceNo").in(deviceNoList);
-        Query query = new Query();
-        query.addCriteria(criteria);
-        List<MeterReadRecord> meterReadRecords = mongoTemplate.find(query, MeterReadRecord.class);
         List<RtnData>  rtnDataList = new ArrayList<>();
-        Map<String, WaterMeter> waterMeterMap =  transformWaterMeterList(waterMeterList);
-        Map<String, MeterReadRecord> meterReadRecordMap = transformMeterReadRecordList(meterReadRecords);
-
+        List<MeterReadRecord> meterReadRecords = null ;
+        if(waterMeterList != null){
+            for(WaterMeter waterMeter : waterMeterList){
+                deviceIds.add(waterMeter.getDeviceId());
+            }
+            Criteria criteria = Criteria.where("readDate").is(readDay)
+                    .and("status").is(1)
+                    .and("readStatus").is("2")
+                    .and("deviceId").in(deviceIds);
+            Query query = new Query();
+            query.addCriteria(criteria);
+            meterReadRecords = mongoTemplate.find(query, MeterReadRecord.class);
+        }
+        else{
+            meterReadRecords = new ArrayList<>();
+        }
+        Map<String, WaterMeter> waterMeterMap =  transformWaterMeterList(waterMeterList,meterType);
+        Map<String, MeterReadRecord> meterReadRecordMap = transformMeterReadRecordList(meterReadRecords,meterType);
         for(String imei : imeiArray){
             RtnData rtnData = new RtnData();
             rtnData.setECUID(imei);
@@ -380,26 +425,47 @@ public class TianJinMeterReadingServiceImpl implements TianJinMeterReadingServic
         }
         return result ;
     }
-    protected Map<String, WaterMeter> transformWaterMeterList(List<WaterMeter> waterMeterList){
+    protected Map<String, WaterMeter> transformWaterMeterList(List<WaterMeter> waterMeterList,Integer meterType){
         Map<String , WaterMeter> waterMeterMap = new HashMap<>(waterMeterList.size());
         for(WaterMeter waterMeter : waterMeterList ){
-            waterMeterMap.put(waterMeter.getDeviceNo(), waterMeter);
+            if(meterType == 1){
+                waterMeterMap.put(waterMeter.getMeterNo(), waterMeter);
+            }
+            else{
+                waterMeterMap.put(waterMeter.getDeviceNo(), waterMeter);
+            }
         }
         return waterMeterMap ;
     }
 
-    protected Map<String, MeterReadRecord> transformMeterReadRecordList(List<MeterReadRecord> meterReadRecordList){
+    protected Map<String, MeterReadRecord> transformMeterReadRecordList(List<MeterReadRecord> meterReadRecordList,Integer meterType){
         Map<String , MeterReadRecord> meterReadRecordMap = new HashMap<>(meterReadRecordList.size());
         for(MeterReadRecord meterReadRecord : meterReadRecordList){
-            meterReadRecordMap.put(meterReadRecord.getDeviceNo(),meterReadRecord);
+            if(meterType == 1){
+                meterReadRecordMap.put(meterReadRecord.getMeterNo(),meterReadRecord);
+            }
+            else{
+                meterReadRecordMap.put(meterReadRecord.getDeviceNo(),meterReadRecord);
+            }
         }
         return meterReadRecordMap;
     }
     @Override
-    public RespData queryImei(String imei) {
+    public RespData queryImei(String imei,Integer meterType) {
         RespData respData = new RespData();
         List<Integer> customerIds = findCustomerIdsWithChildren(customerCode);
-        WaterMeter waterMeter = waterMeterMapper.findWaterMeterByDeviceNoAndCustomerList(imei,customerIds);
+        WaterMeter waterMeter = null ;
+        if(meterType == 1){
+            // 表类型为Lora时,imei对应为物联网平台电子号;
+            waterMeter = waterMeterMapper.findWaterMeterByMeterNoAndCustomerList(imei,customerIds);
+        }
+        else if(meterType == 2){
+            // 表类型为NB时,imei对应为物联网平台设备编号;
+            waterMeter = waterMeterMapper.findWaterMeterByDeviceNoAndCustomerList(imei,customerIds);
+        }
+        else{
+            log.error("Not Support Meter Type {}!",meterType);
+        }
         if(waterMeter == null){
             // 设备未注册
             respData.setRtnId(RespData.SUCCESS);

+ 8 - 3
meter-reading-tianjin/src/main/java/com/huaxu/zoniot/web/IntegrationController.java

@@ -43,6 +43,8 @@ public class IntegrationController {
 
     /**
      *  天津查询数据接口,根据IMEI号查询当天的抄表数据
+     *  新增MeterType参数,1:LoRa ,2:NB ;LoRa表查询数据为前一天数据,NB表查询数据为今日数据
+     *  当查询表型为LoRa时,IMEI对应为平台中电子号,dang
      * @param imei
      * @param apiKey
      * @return
@@ -93,19 +95,22 @@ public class IntegrationController {
     }
 
     /**
-     * 根据IMEI查询是否已注册
+     * 根据水表编号查询是否已注册
+     * 新增MeterType参数,1:LoRa ,2:NB ;
+     * 查询表型为LoRa时,IMEI对应为平台电子号;查询表型为NB时,IMEI对应为平台设备编号
      * @param imei
      * @param apiKey
      * @return
      */
     @PostMapping("/queryIMEI")
     @ApiOperation(value = "查询是否已注册")
-    public RespData queryIMEI(  @ApiParam(value = "IMEI号", required = true)@RequestParam String imei ,
+    public RespData queryIMEI(  @ApiParam(value = "水表编号", required = true)@RequestParam String imei ,
+                                @ApiParam(value = "表类型,1:LoRa,2:NB",required = true,defaultValue="2")@RequestParam(defaultValue="2") Integer meterType ,
                                 @ApiParam(value = "apiKey", required = true)@RequestParam String apiKey) {
         RespData respData = new RespData();
         if(StringUtils.isNotBlank(apiKey)&& apiKey.equals(this.apiKey)){
             if(StringUtils.isNotBlank(imei)){
-                respData = tianJinMeterReadingService.queryImei(imei) ;
+                respData = tianJinMeterReadingService.queryImei(imei,meterType) ;
             }else{	//有空值直接返回
                 respData.setRtnId(RespData.FAIL);
                 respData.setMsg(ErrorConstants.IMEI_EMPTY);

+ 749 - 0
meter-reading-tianjin/src/main/resources/mapper/CrmSyncInfoMapper.xml

@@ -0,0 +1,749 @@
+<?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.huaxu.zoniot.dao.CrmSyncInfoMapper">
+  <resultMap id="BaseResultMap" type="com.huaxu.zoniot.entity.CrmSyncInfo">
+    <!--@mbg.generated-->
+    <!--@Table sc_crm_sync_info-->
+    <id column="crm_id" jdbcType="VARCHAR" property="crmId" />
+    <result column="create_org" jdbcType="VARCHAR" property="createOrg" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+    <result column="factory_read" jdbcType="VARCHAR" property="factoryRead" />
+    <result column="imei2" jdbcType="VARCHAR" property="imei2" />
+    <result column="ship_person" jdbcType="VARCHAR" property="shipPerson" />
+    <result column="rate_id" jdbcType="VARCHAR" property="rateId" />
+    <result column="bt_size" jdbcType="VARCHAR" property="btSize" />
+    <result column="prod_id" jdbcType="VARCHAR" property="prodId" />
+    <result column="vale_id" jdbcType="VARCHAR" property="valeId" />
+    <result column="update_time" jdbcType="VARCHAR" property="updateTime" />
+    <result column="check_info" jdbcType="VARCHAR" property="checkInfo" />
+    <result column="operators" jdbcType="VARCHAR" property="operators" />
+    <result column="advance_id" jdbcType="VARCHAR" property="advanceId" />
+    <result column="node_no" jdbcType="VARCHAR" property="nodeNo" />
+    <result column="comm_type" jdbcType="VARCHAR" property="commType" />
+    <result column="product" jdbcType="VARCHAR" property="product" />
+    <result column="baud_rate" jdbcType="VARCHAR" property="baudRate" />
+    <result column="nccid" jdbcType="VARCHAR" property="nccid" />
+    <result column="address" jdbcType="VARCHAR" property="address" />
+    <result column="valve_status" jdbcType="VARCHAR" property="valveStatus" />
+    <result column="imei" jdbcType="VARCHAR" property="imei" />
+    <result column="meter_type" jdbcType="VARCHAR" property="meterType" />
+    <result column="cust_erp_id" jdbcType="VARCHAR" property="custErpId" />
+    <result column="pay_mode" jdbcType="VARCHAR" property="payMode" />
+    <result column="delivery_date" jdbcType="VARCHAR" property="deliveryDate" />
+    <result column="user_id" jdbcType="VARCHAR" property="userId" />
+    <result column="telphone" jdbcType="VARCHAR" property="telphone" />
+    <result column="meter_code" jdbcType="VARCHAR" property="meterCode" />
+    <result column="data_address" jdbcType="VARCHAR" property="dataAddress" />
+    <result column="meter_model" jdbcType="VARCHAR" property="meterModel" />
+    <result column="material_id" jdbcType="VARCHAR" property="materialId" />
+    <result column="sales_org" jdbcType="VARCHAR" property="salesOrg" />
+    <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
+    <result column="paytype_id" jdbcType="VARCHAR" property="paytypeId" />
+    <result column="comm_protrol" jdbcType="VARCHAR" property="commProtrol" />
+    <result column="order_id" jdbcType="VARCHAR" property="orderId" />
+    <result column="water1" jdbcType="VARCHAR" property="water1" />
+    <result column="end3" jdbcType="VARCHAR" property="end3" />
+    <result column="mix3" jdbcType="VARCHAR" property="mix3" />
+    <result column="qwater3" jdbcType="VARCHAR" property="qwater3" />
+    <result column="advance_num" jdbcType="VARCHAR" property="advanceNum" />
+    <result column="end2" jdbcType="VARCHAR" property="end2" />
+    <result column="mix2" jdbcType="VARCHAR" property="mix2" />
+    <result column="begin3" jdbcType="VARCHAR" property="begin3" />
+    <result column="error2" jdbcType="VARCHAR" property="error2" />
+    <result column="max3" jdbcType="VARCHAR" property="max3" />
+    <result column="begin2" jdbcType="VARCHAR" property="begin2" />
+    <result column="water2" jdbcType="VARCHAR" property="water2" />
+    <result column="end1" jdbcType="VARCHAR" property="end1" />
+    <result column="max2" jdbcType="VARCHAR" property="max2" />
+    <result column="error1" jdbcType="VARCHAR" property="error1" />
+    <result column="mix1" jdbcType="VARCHAR" property="mix1" />
+    <result column="begin1" jdbcType="VARCHAR" property="begin1" />
+    <result column="max1" jdbcType="VARCHAR" property="max1" />
+    <result column="error3" jdbcType="VARCHAR" property="error3" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    crm_id, create_org, order_no, factory_read, imei2, ship_person, rate_id, bt_size, 
+    prod_id, vale_id, update_time, check_info, operators, advance_id, node_no, comm_type, 
+    product, baud_rate, nccid, address, valve_status, imei, meter_type, cust_erp_id, 
+    pay_mode, delivery_date, user_id, telphone, meter_code, data_address, meter_model, 
+    material_id, sales_org, customer_name, paytype_id, comm_protrol, order_id, water1, 
+    end3, mix3, qwater3, advance_num, end2, mix2, begin3, error2, max3, begin2, water2, 
+    end1, max2, error1, mix1, begin1, max1, error3
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--@mbg.generated-->
+    select 
+    <include refid="Base_Column_List" />
+    from sc_crm_sync_info
+    where crm_id = #{crmId,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--@mbg.generated-->
+    delete from sc_crm_sync_info
+    where crm_id = #{crmId,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.huaxu.zoniot.entity.CrmSyncInfo">
+    <!--@mbg.generated-->
+    insert into sc_crm_sync_info (crm_id, create_org, order_no, 
+      factory_read, imei2, ship_person, 
+      rate_id, bt_size, prod_id, 
+      vale_id, update_time, check_info, 
+      operators, advance_id, node_no, 
+      comm_type, product, baud_rate, 
+      nccid, address, valve_status, 
+      imei, meter_type, cust_erp_id, 
+      pay_mode, delivery_date, user_id, 
+      telphone, meter_code, data_address, 
+      meter_model, material_id, sales_org, 
+      customer_name, paytype_id, comm_protrol, 
+      order_id, water1, end3, 
+      mix3, qwater3, advance_num, 
+      end2, mix2, begin3, 
+      error2, max3, begin2, 
+      water2, end1, max2, 
+      error1, mix1, begin1, 
+      max1, error3)
+    values (#{crmId,jdbcType=VARCHAR}, #{createOrg,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, 
+      #{factoryRead,jdbcType=VARCHAR}, #{imei2,jdbcType=VARCHAR}, #{shipPerson,jdbcType=VARCHAR}, 
+      #{rateId,jdbcType=VARCHAR}, #{btSize,jdbcType=VARCHAR}, #{prodId,jdbcType=VARCHAR}, 
+      #{valeId,jdbcType=VARCHAR}, #{updateTime,jdbcType=VARCHAR}, #{checkInfo,jdbcType=VARCHAR}, 
+      #{operators,jdbcType=VARCHAR}, #{advanceId,jdbcType=VARCHAR}, #{nodeNo,jdbcType=VARCHAR}, 
+      #{commType,jdbcType=VARCHAR}, #{product,jdbcType=VARCHAR}, #{baudRate,jdbcType=VARCHAR}, 
+      #{nccid,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{valveStatus,jdbcType=VARCHAR}, 
+      #{imei,jdbcType=VARCHAR}, #{meterType,jdbcType=VARCHAR}, #{custErpId,jdbcType=VARCHAR}, 
+      #{payMode,jdbcType=VARCHAR}, #{deliveryDate,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, 
+      #{telphone,jdbcType=VARCHAR}, #{meterCode,jdbcType=VARCHAR}, #{dataAddress,jdbcType=VARCHAR}, 
+      #{meterModel,jdbcType=VARCHAR}, #{materialId,jdbcType=VARCHAR}, #{salesOrg,jdbcType=VARCHAR}, 
+      #{customerName,jdbcType=VARCHAR}, #{paytypeId,jdbcType=VARCHAR}, #{commProtrol,jdbcType=VARCHAR}, 
+      #{orderId,jdbcType=VARCHAR}, #{water1,jdbcType=VARCHAR}, #{end3,jdbcType=VARCHAR}, 
+      #{mix3,jdbcType=VARCHAR}, #{qwater3,jdbcType=VARCHAR}, #{advanceNum,jdbcType=VARCHAR}, 
+      #{end2,jdbcType=VARCHAR}, #{mix2,jdbcType=VARCHAR}, #{begin3,jdbcType=VARCHAR}, 
+      #{error2,jdbcType=VARCHAR}, #{max3,jdbcType=VARCHAR}, #{begin2,jdbcType=VARCHAR}, 
+      #{water2,jdbcType=VARCHAR}, #{end1,jdbcType=VARCHAR}, #{max2,jdbcType=VARCHAR}, 
+      #{error1,jdbcType=VARCHAR}, #{mix1,jdbcType=VARCHAR}, #{begin1,jdbcType=VARCHAR}, 
+      #{max1,jdbcType=VARCHAR}, #{error3,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.huaxu.zoniot.entity.CrmSyncInfo">
+    <!--@mbg.generated-->
+    insert into sc_crm_sync_info
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="crmId != null">
+        crm_id,
+      </if>
+      <if test="createOrg != null">
+        create_org,
+      </if>
+      <if test="orderNo != null">
+        order_no,
+      </if>
+      <if test="factoryRead != null">
+        factory_read,
+      </if>
+      <if test="imei2 != null">
+        imei2,
+      </if>
+      <if test="shipPerson != null">
+        ship_person,
+      </if>
+      <if test="rateId != null">
+        rate_id,
+      </if>
+      <if test="btSize != null">
+        bt_size,
+      </if>
+      <if test="prodId != null">
+        prod_id,
+      </if>
+      <if test="valeId != null">
+        vale_id,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="checkInfo != null">
+        check_info,
+      </if>
+      <if test="operators != null">
+        operators,
+      </if>
+      <if test="advanceId != null">
+        advance_id,
+      </if>
+      <if test="nodeNo != null">
+        node_no,
+      </if>
+      <if test="commType != null">
+        comm_type,
+      </if>
+      <if test="product != null">
+        product,
+      </if>
+      <if test="baudRate != null">
+        baud_rate,
+      </if>
+      <if test="nccid != null">
+        nccid,
+      </if>
+      <if test="address != null">
+        address,
+      </if>
+      <if test="valveStatus != null">
+        valve_status,
+      </if>
+      <if test="imei != null">
+        imei,
+      </if>
+      <if test="meterType != null">
+        meter_type,
+      </if>
+      <if test="custErpId != null">
+        cust_erp_id,
+      </if>
+      <if test="payMode != null">
+        pay_mode,
+      </if>
+      <if test="deliveryDate != null">
+        delivery_date,
+      </if>
+      <if test="userId != null">
+        user_id,
+      </if>
+      <if test="telphone != null">
+        telphone,
+      </if>
+      <if test="meterCode != null">
+        meter_code,
+      </if>
+      <if test="dataAddress != null">
+        data_address,
+      </if>
+      <if test="meterModel != null">
+        meter_model,
+      </if>
+      <if test="materialId != null">
+        material_id,
+      </if>
+      <if test="salesOrg != null">
+        sales_org,
+      </if>
+      <if test="customerName != null">
+        customer_name,
+      </if>
+      <if test="paytypeId != null">
+        paytype_id,
+      </if>
+      <if test="commProtrol != null">
+        comm_protrol,
+      </if>
+      <if test="orderId != null">
+        order_id,
+      </if>
+      <if test="water1 != null">
+        water1,
+      </if>
+      <if test="end3 != null">
+        end3,
+      </if>
+      <if test="mix3 != null">
+        mix3,
+      </if>
+      <if test="qwater3 != null">
+        qwater3,
+      </if>
+      <if test="advanceNum != null">
+        advance_num,
+      </if>
+      <if test="end2 != null">
+        end2,
+      </if>
+      <if test="mix2 != null">
+        mix2,
+      </if>
+      <if test="begin3 != null">
+        begin3,
+      </if>
+      <if test="error2 != null">
+        error2,
+      </if>
+      <if test="max3 != null">
+        max3,
+      </if>
+      <if test="begin2 != null">
+        begin2,
+      </if>
+      <if test="water2 != null">
+        water2,
+      </if>
+      <if test="end1 != null">
+        end1,
+      </if>
+      <if test="max2 != null">
+        max2,
+      </if>
+      <if test="error1 != null">
+        error1,
+      </if>
+      <if test="mix1 != null">
+        mix1,
+      </if>
+      <if test="begin1 != null">
+        begin1,
+      </if>
+      <if test="max1 != null">
+        max1,
+      </if>
+      <if test="error3 != null">
+        error3,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="crmId != null">
+        #{crmId,jdbcType=VARCHAR},
+      </if>
+      <if test="createOrg != null">
+        #{createOrg,jdbcType=VARCHAR},
+      </if>
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="factoryRead != null">
+        #{factoryRead,jdbcType=VARCHAR},
+      </if>
+      <if test="imei2 != null">
+        #{imei2,jdbcType=VARCHAR},
+      </if>
+      <if test="shipPerson != null">
+        #{shipPerson,jdbcType=VARCHAR},
+      </if>
+      <if test="rateId != null">
+        #{rateId,jdbcType=VARCHAR},
+      </if>
+      <if test="btSize != null">
+        #{btSize,jdbcType=VARCHAR},
+      </if>
+      <if test="prodId != null">
+        #{prodId,jdbcType=VARCHAR},
+      </if>
+      <if test="valeId != null">
+        #{valeId,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=VARCHAR},
+      </if>
+      <if test="checkInfo != null">
+        #{checkInfo,jdbcType=VARCHAR},
+      </if>
+      <if test="operators != null">
+        #{operators,jdbcType=VARCHAR},
+      </if>
+      <if test="advanceId != null">
+        #{advanceId,jdbcType=VARCHAR},
+      </if>
+      <if test="nodeNo != null">
+        #{nodeNo,jdbcType=VARCHAR},
+      </if>
+      <if test="commType != null">
+        #{commType,jdbcType=VARCHAR},
+      </if>
+      <if test="product != null">
+        #{product,jdbcType=VARCHAR},
+      </if>
+      <if test="baudRate != null">
+        #{baudRate,jdbcType=VARCHAR},
+      </if>
+      <if test="nccid != null">
+        #{nccid,jdbcType=VARCHAR},
+      </if>
+      <if test="address != null">
+        #{address,jdbcType=VARCHAR},
+      </if>
+      <if test="valveStatus != null">
+        #{valveStatus,jdbcType=VARCHAR},
+      </if>
+      <if test="imei != null">
+        #{imei,jdbcType=VARCHAR},
+      </if>
+      <if test="meterType != null">
+        #{meterType,jdbcType=VARCHAR},
+      </if>
+      <if test="custErpId != null">
+        #{custErpId,jdbcType=VARCHAR},
+      </if>
+      <if test="payMode != null">
+        #{payMode,jdbcType=VARCHAR},
+      </if>
+      <if test="deliveryDate != null">
+        #{deliveryDate,jdbcType=VARCHAR},
+      </if>
+      <if test="userId != null">
+        #{userId,jdbcType=VARCHAR},
+      </if>
+      <if test="telphone != null">
+        #{telphone,jdbcType=VARCHAR},
+      </if>
+      <if test="meterCode != null">
+        #{meterCode,jdbcType=VARCHAR},
+      </if>
+      <if test="dataAddress != null">
+        #{dataAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="meterModel != null">
+        #{meterModel,jdbcType=VARCHAR},
+      </if>
+      <if test="materialId != null">
+        #{materialId,jdbcType=VARCHAR},
+      </if>
+      <if test="salesOrg != null">
+        #{salesOrg,jdbcType=VARCHAR},
+      </if>
+      <if test="customerName != null">
+        #{customerName,jdbcType=VARCHAR},
+      </if>
+      <if test="paytypeId != null">
+        #{paytypeId,jdbcType=VARCHAR},
+      </if>
+      <if test="commProtrol != null">
+        #{commProtrol,jdbcType=VARCHAR},
+      </if>
+      <if test="orderId != null">
+        #{orderId,jdbcType=VARCHAR},
+      </if>
+      <if test="water1 != null">
+        #{water1,jdbcType=VARCHAR},
+      </if>
+      <if test="end3 != null">
+        #{end3,jdbcType=VARCHAR},
+      </if>
+      <if test="mix3 != null">
+        #{mix3,jdbcType=VARCHAR},
+      </if>
+      <if test="qwater3 != null">
+        #{qwater3,jdbcType=VARCHAR},
+      </if>
+      <if test="advanceNum != null">
+        #{advanceNum,jdbcType=VARCHAR},
+      </if>
+      <if test="end2 != null">
+        #{end2,jdbcType=VARCHAR},
+      </if>
+      <if test="mix2 != null">
+        #{mix2,jdbcType=VARCHAR},
+      </if>
+      <if test="begin3 != null">
+        #{begin3,jdbcType=VARCHAR},
+      </if>
+      <if test="error2 != null">
+        #{error2,jdbcType=VARCHAR},
+      </if>
+      <if test="max3 != null">
+        #{max3,jdbcType=VARCHAR},
+      </if>
+      <if test="begin2 != null">
+        #{begin2,jdbcType=VARCHAR},
+      </if>
+      <if test="water2 != null">
+        #{water2,jdbcType=VARCHAR},
+      </if>
+      <if test="end1 != null">
+        #{end1,jdbcType=VARCHAR},
+      </if>
+      <if test="max2 != null">
+        #{max2,jdbcType=VARCHAR},
+      </if>
+      <if test="error1 != null">
+        #{error1,jdbcType=VARCHAR},
+      </if>
+      <if test="mix1 != null">
+        #{mix1,jdbcType=VARCHAR},
+      </if>
+      <if test="begin1 != null">
+        #{begin1,jdbcType=VARCHAR},
+      </if>
+      <if test="max1 != null">
+        #{max1,jdbcType=VARCHAR},
+      </if>
+      <if test="error3 != null">
+        #{error3,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.huaxu.zoniot.entity.CrmSyncInfo">
+    <!--@mbg.generated-->
+    update sc_crm_sync_info
+    <set>
+      <if test="createOrg != null">
+        create_org = #{createOrg,jdbcType=VARCHAR},
+      </if>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
+      <if test="factoryRead != null">
+        factory_read = #{factoryRead,jdbcType=VARCHAR},
+      </if>
+      <if test="imei2 != null">
+        imei2 = #{imei2,jdbcType=VARCHAR},
+      </if>
+      <if test="shipPerson != null">
+        ship_person = #{shipPerson,jdbcType=VARCHAR},
+      </if>
+      <if test="rateId != null">
+        rate_id = #{rateId,jdbcType=VARCHAR},
+      </if>
+      <if test="btSize != null">
+        bt_size = #{btSize,jdbcType=VARCHAR},
+      </if>
+      <if test="prodId != null">
+        prod_id = #{prodId,jdbcType=VARCHAR},
+      </if>
+      <if test="valeId != null">
+        vale_id = #{valeId,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=VARCHAR},
+      </if>
+      <if test="checkInfo != null">
+        check_info = #{checkInfo,jdbcType=VARCHAR},
+      </if>
+      <if test="operators != null">
+        operators = #{operators,jdbcType=VARCHAR},
+      </if>
+      <if test="advanceId != null">
+        advance_id = #{advanceId,jdbcType=VARCHAR},
+      </if>
+      <if test="nodeNo != null">
+        node_no = #{nodeNo,jdbcType=VARCHAR},
+      </if>
+      <if test="commType != null">
+        comm_type = #{commType,jdbcType=VARCHAR},
+      </if>
+      <if test="product != null">
+        product = #{product,jdbcType=VARCHAR},
+      </if>
+      <if test="baudRate != null">
+        baud_rate = #{baudRate,jdbcType=VARCHAR},
+      </if>
+      <if test="nccid != null">
+        nccid = #{nccid,jdbcType=VARCHAR},
+      </if>
+      <if test="address != null">
+        address = #{address,jdbcType=VARCHAR},
+      </if>
+      <if test="valveStatus != null">
+        valve_status = #{valveStatus,jdbcType=VARCHAR},
+      </if>
+      <if test="imei != null">
+        imei = #{imei,jdbcType=VARCHAR},
+      </if>
+      <if test="meterType != null">
+        meter_type = #{meterType,jdbcType=VARCHAR},
+      </if>
+      <if test="custErpId != null">
+        cust_erp_id = #{custErpId,jdbcType=VARCHAR},
+      </if>
+      <if test="payMode != null">
+        pay_mode = #{payMode,jdbcType=VARCHAR},
+      </if>
+      <if test="deliveryDate != null">
+        delivery_date = #{deliveryDate,jdbcType=VARCHAR},
+      </if>
+      <if test="userId != null">
+        user_id = #{userId,jdbcType=VARCHAR},
+      </if>
+      <if test="telphone != null">
+        telphone = #{telphone,jdbcType=VARCHAR},
+      </if>
+      <if test="meterCode != null">
+        meter_code = #{meterCode,jdbcType=VARCHAR},
+      </if>
+      <if test="dataAddress != null">
+        data_address = #{dataAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="meterModel != null">
+        meter_model = #{meterModel,jdbcType=VARCHAR},
+      </if>
+      <if test="materialId != null">
+        material_id = #{materialId,jdbcType=VARCHAR},
+      </if>
+      <if test="salesOrg != null">
+        sales_org = #{salesOrg,jdbcType=VARCHAR},
+      </if>
+      <if test="customerName != null">
+        customer_name = #{customerName,jdbcType=VARCHAR},
+      </if>
+      <if test="paytypeId != null">
+        paytype_id = #{paytypeId,jdbcType=VARCHAR},
+      </if>
+      <if test="commProtrol != null">
+        comm_protrol = #{commProtrol,jdbcType=VARCHAR},
+      </if>
+      <if test="orderId != null">
+        order_id = #{orderId,jdbcType=VARCHAR},
+      </if>
+      <if test="water1 != null">
+        water1 = #{water1,jdbcType=VARCHAR},
+      </if>
+      <if test="end3 != null">
+        end3 = #{end3,jdbcType=VARCHAR},
+      </if>
+      <if test="mix3 != null">
+        mix3 = #{mix3,jdbcType=VARCHAR},
+      </if>
+      <if test="qwater3 != null">
+        qwater3 = #{qwater3,jdbcType=VARCHAR},
+      </if>
+      <if test="advanceNum != null">
+        advance_num = #{advanceNum,jdbcType=VARCHAR},
+      </if>
+      <if test="end2 != null">
+        end2 = #{end2,jdbcType=VARCHAR},
+      </if>
+      <if test="mix2 != null">
+        mix2 = #{mix2,jdbcType=VARCHAR},
+      </if>
+      <if test="begin3 != null">
+        begin3 = #{begin3,jdbcType=VARCHAR},
+      </if>
+      <if test="error2 != null">
+        error2 = #{error2,jdbcType=VARCHAR},
+      </if>
+      <if test="max3 != null">
+        max3 = #{max3,jdbcType=VARCHAR},
+      </if>
+      <if test="begin2 != null">
+        begin2 = #{begin2,jdbcType=VARCHAR},
+      </if>
+      <if test="water2 != null">
+        water2 = #{water2,jdbcType=VARCHAR},
+      </if>
+      <if test="end1 != null">
+        end1 = #{end1,jdbcType=VARCHAR},
+      </if>
+      <if test="max2 != null">
+        max2 = #{max2,jdbcType=VARCHAR},
+      </if>
+      <if test="error1 != null">
+        error1 = #{error1,jdbcType=VARCHAR},
+      </if>
+      <if test="mix1 != null">
+        mix1 = #{mix1,jdbcType=VARCHAR},
+      </if>
+      <if test="begin1 != null">
+        begin1 = #{begin1,jdbcType=VARCHAR},
+      </if>
+      <if test="max1 != null">
+        max1 = #{max1,jdbcType=VARCHAR},
+      </if>
+      <if test="error3 != null">
+        error3 = #{error3,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where crm_id = #{crmId,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.huaxu.zoniot.entity.CrmSyncInfo">
+    <!--@mbg.generated-->
+    update sc_crm_sync_info
+    set create_org = #{createOrg,jdbcType=VARCHAR},
+      order_no = #{orderNo,jdbcType=VARCHAR},
+      factory_read = #{factoryRead,jdbcType=VARCHAR},
+      imei2 = #{imei2,jdbcType=VARCHAR},
+      ship_person = #{shipPerson,jdbcType=VARCHAR},
+      rate_id = #{rateId,jdbcType=VARCHAR},
+      bt_size = #{btSize,jdbcType=VARCHAR},
+      prod_id = #{prodId,jdbcType=VARCHAR},
+      vale_id = #{valeId,jdbcType=VARCHAR},
+      update_time = #{updateTime,jdbcType=VARCHAR},
+      check_info = #{checkInfo,jdbcType=VARCHAR},
+      operators = #{operators,jdbcType=VARCHAR},
+      advance_id = #{advanceId,jdbcType=VARCHAR},
+      node_no = #{nodeNo,jdbcType=VARCHAR},
+      comm_type = #{commType,jdbcType=VARCHAR},
+      product = #{product,jdbcType=VARCHAR},
+      baud_rate = #{baudRate,jdbcType=VARCHAR},
+      nccid = #{nccid,jdbcType=VARCHAR},
+      address = #{address,jdbcType=VARCHAR},
+      valve_status = #{valveStatus,jdbcType=VARCHAR},
+      imei = #{imei,jdbcType=VARCHAR},
+      meter_type = #{meterType,jdbcType=VARCHAR},
+      cust_erp_id = #{custErpId,jdbcType=VARCHAR},
+      pay_mode = #{payMode,jdbcType=VARCHAR},
+      delivery_date = #{deliveryDate,jdbcType=VARCHAR},
+      user_id = #{userId,jdbcType=VARCHAR},
+      telphone = #{telphone,jdbcType=VARCHAR},
+      meter_code = #{meterCode,jdbcType=VARCHAR},
+      data_address = #{dataAddress,jdbcType=VARCHAR},
+      meter_model = #{meterModel,jdbcType=VARCHAR},
+      material_id = #{materialId,jdbcType=VARCHAR},
+      sales_org = #{salesOrg,jdbcType=VARCHAR},
+      customer_name = #{customerName,jdbcType=VARCHAR},
+      paytype_id = #{paytypeId,jdbcType=VARCHAR},
+      comm_protrol = #{commProtrol,jdbcType=VARCHAR},
+      order_id = #{orderId,jdbcType=VARCHAR},
+      water1 = #{water1,jdbcType=VARCHAR},
+      end3 = #{end3,jdbcType=VARCHAR},
+      mix3 = #{mix3,jdbcType=VARCHAR},
+      qwater3 = #{qwater3,jdbcType=VARCHAR},
+      advance_num = #{advanceNum,jdbcType=VARCHAR},
+      end2 = #{end2,jdbcType=VARCHAR},
+      mix2 = #{mix2,jdbcType=VARCHAR},
+      begin3 = #{begin3,jdbcType=VARCHAR},
+      error2 = #{error2,jdbcType=VARCHAR},
+      max3 = #{max3,jdbcType=VARCHAR},
+      begin2 = #{begin2,jdbcType=VARCHAR},
+      water2 = #{water2,jdbcType=VARCHAR},
+      end1 = #{end1,jdbcType=VARCHAR},
+      max2 = #{max2,jdbcType=VARCHAR},
+      error1 = #{error1,jdbcType=VARCHAR},
+      mix1 = #{mix1,jdbcType=VARCHAR},
+      begin1 = #{begin1,jdbcType=VARCHAR},
+      max1 = #{max1,jdbcType=VARCHAR},
+      error3 = #{error3,jdbcType=VARCHAR}
+    where crm_id = #{crmId,jdbcType=VARCHAR}
+  </update>
+  <insert id="batchInsert" parameterType="map">
+    <!--@mbg.generated-->
+    insert into sc_crm_sync_info
+    (crm_id, create_org, order_no, factory_read, imei2, ship_person, rate_id, bt_size, 
+      prod_id, vale_id, update_time, check_info, operators, advance_id, node_no, comm_type, 
+      product, baud_rate, nccid, address, valve_status, imei, meter_type, cust_erp_id, 
+      pay_mode, delivery_date, user_id, telphone, meter_code, data_address, meter_model, 
+      material_id, sales_org, customer_name, paytype_id, comm_protrol, order_id, water1, 
+      end3, mix3, qwater3, advance_num, end2, mix2, begin3, error2, max3, begin2, water2, 
+      end1, max2, error1, mix1, begin1, max1, error3)
+    values
+    <foreach collection="list" item="item" separator=",">
+      (#{item.crmId,jdbcType=VARCHAR}, #{item.createOrg,jdbcType=VARCHAR}, #{item.orderNo,jdbcType=VARCHAR}, 
+        #{item.factoryRead,jdbcType=VARCHAR}, #{item.imei2,jdbcType=VARCHAR}, #{item.shipPerson,jdbcType=VARCHAR}, 
+        #{item.rateId,jdbcType=VARCHAR}, #{item.btSize,jdbcType=VARCHAR}, #{item.prodId,jdbcType=VARCHAR}, 
+        #{item.valeId,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=VARCHAR}, #{item.checkInfo,jdbcType=VARCHAR}, 
+        #{item.operators,jdbcType=VARCHAR}, #{item.advanceId,jdbcType=VARCHAR}, #{item.nodeNo,jdbcType=VARCHAR}, 
+        #{item.commType,jdbcType=VARCHAR}, #{item.product,jdbcType=VARCHAR}, #{item.baudRate,jdbcType=VARCHAR}, 
+        #{item.nccid,jdbcType=VARCHAR}, #{item.address,jdbcType=VARCHAR}, #{item.valveStatus,jdbcType=VARCHAR}, 
+        #{item.imei,jdbcType=VARCHAR}, #{item.meterType,jdbcType=VARCHAR}, #{item.custErpId,jdbcType=VARCHAR}, 
+        #{item.payMode,jdbcType=VARCHAR}, #{item.deliveryDate,jdbcType=VARCHAR}, #{item.userId,jdbcType=VARCHAR}, 
+        #{item.telphone,jdbcType=VARCHAR}, #{item.meterCode,jdbcType=VARCHAR}, #{item.dataAddress,jdbcType=VARCHAR}, 
+        #{item.meterModel,jdbcType=VARCHAR}, #{item.materialId,jdbcType=VARCHAR}, #{item.salesOrg,jdbcType=VARCHAR}, 
+        #{item.customerName,jdbcType=VARCHAR}, #{item.paytypeId,jdbcType=VARCHAR}, #{item.commProtrol,jdbcType=VARCHAR}, 
+        #{item.orderId,jdbcType=VARCHAR}, #{item.water1,jdbcType=VARCHAR}, #{item.end3,jdbcType=VARCHAR}, 
+        #{item.mix3,jdbcType=VARCHAR}, #{item.qwater3,jdbcType=VARCHAR}, #{item.advanceNum,jdbcType=VARCHAR}, 
+        #{item.end2,jdbcType=VARCHAR}, #{item.mix2,jdbcType=VARCHAR}, #{item.begin3,jdbcType=VARCHAR}, 
+        #{item.error2,jdbcType=VARCHAR}, #{item.max3,jdbcType=VARCHAR}, #{item.begin2,jdbcType=VARCHAR}, 
+        #{item.water2,jdbcType=VARCHAR}, #{item.end1,jdbcType=VARCHAR}, #{item.max2,jdbcType=VARCHAR}, 
+        #{item.error1,jdbcType=VARCHAR}, #{item.mix1,jdbcType=VARCHAR}, #{item.begin1,jdbcType=VARCHAR}, 
+        #{item.max1,jdbcType=VARCHAR}, #{item.error3,jdbcType=VARCHAR})
+    </foreach>
+  </insert>
+  <select id="findByNccid" resultMap="BaseResultMap">
+    select
+        <include refid="Base_Column_List" />
+    from sc_crm_sync_info
+    where nccid = #{nccid,jdbcType=VARCHAR}
+    limit 1
+  </select>
+  <select id="findByMeterCode" resultMap="BaseResultMap">
+    select
+        <include refid="Base_Column_List" />
+    from sc_crm_sync_info
+    where meter_code = #{meterCode,jdbcType=VARCHAR}
+  </select>
+</mapper>