<?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="cn.cecep.talroad.mapper.PcFactoryAccessControlMapper">
  <resultMap id="BaseResultMap" type="cn.cecep.talroad.domain.PcFactoryAccessControl">
    <!--@mbg.generated-->
    <!--@Table pc_factory_access_control-->
    <result column="factory_id" jdbcType="VARCHAR" property="factoryId" />
    <result column="access_control_name" jdbcType="VARCHAR" property="accessControlName" />
    <result column="access_control_code" jdbcType="VARCHAR" property="accessControlCode" />
    <result column="access_control_lng" jdbcType="VARCHAR" property="accessControlLng" />
    <result column="access_control_lat" jdbcType="VARCHAR" property="accessControlLat" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    factory_id, access_control_name, access_control_code, access_control_lng, access_control_lat
  </sql>

  <update id="updateBatchCoordinate" parameterType="java.util.List">
    <foreach collection="list" item="item" index="index" separator=";">
      UPDATE pc_factory_access_control
      <set>
        <if test="item.accessControlLng != null and item.accessControlLng != ''">access_control_lng=#{item.accessControlLng},</if>
        <if test="item.accessControlLng == null or item.accessControlLng == ''">access_control_lng = '',</if>
        <if test="item.accessControlLat != null  and item.accessControlLat != ''">access_control_lat=#{item.accessControlLat},</if>
        <if test="item.accessControlLat == null or item.accessControlLat == ''">access_control_lat = '',</if>
      </set>
      WHERE factory_id=#{item.factoryId}
      and   access_control_code = #{item.accessControlCode}
    </foreach>
  </update>
</mapper>