| <?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.dy.pipIrrGlobal.daoRm.UgRtuProgramMapper"> | 
|   <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoUg.UgRtuProgram"> | 
|     <!--@mbg.generated--> | 
|     <!--@Table ug_rtu_program--> | 
|     <id column="id" jdbcType="BIGINT" property="id" /> | 
|     <result column="hex_file_name" jdbcType="VARCHAR" property="hexFileName" /> | 
|     <result column="store_ram_addr" jdbcType="VARCHAR" property="storeRamAddr" /> | 
|     <result column="start_ram_addr" jdbcType="VARCHAR" property="startRamAddr" /> | 
|     <result column="program_calculate_bytes" jdbcType="INTEGER" property="programCalculateBytes" /> | 
|     <result column="program_crc16" jdbcType="INTEGER" property="programCrc16" /> | 
|     <result column="program_bytes" jdbcType="BLOB" property="programBytes" /> | 
|     <result column="file_bytes" jdbcType="BLOB" property="fileBytes" /> | 
|     <result column="remark" jdbcType="VARCHAR" property="remark" /> | 
|     <result column="dt" jdbcType="TIMESTAMP" property="dt" /> | 
|     <result column="deleted" jdbcType="TINYINT" property="deleted" /> | 
|   </resultMap> | 
|   <sql id="Base_Column_List"> | 
|     <!--@mbg.generated--> | 
|     id, hex_file_name, store_ram_addr, start_ram_addr, program_calculate_bytes, program_crc16, | 
|     program_bytes, file_bytes, remark, dt, deleted | 
|   </sql> | 
|   <sql id="Base2_Column_List"> | 
|     <!--@mbg.generated--> | 
|     id, hex_file_name, store_ram_addr, start_ram_addr, program_calculate_bytes, program_crc16, | 
|     remark, dt, deleted | 
|   </sql> | 
|   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | 
|     <!--@mbg.generated--> | 
|     select  | 
|     <include refid="Base_Column_List" /> | 
|     from ug_rtu_program | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </select> | 
|   | 
|   <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long"> | 
|     <!--@mbg.generated--> | 
|     select | 
|     count(*) | 
|     from ug_rtu_program bd | 
|     where bd.deleted != 1 | 
|     <trim prefix="and" suffixOverrides="and"> | 
|       <if test="name != null and name != ''"> | 
|         bd.hex_file_name like concat('%', #{fileName}, '%') and | 
|       </if> | 
|     </trim> | 
|   </select> | 
|   <select id="selectSome" parameterType="java.util.Map" resultMap="BaseResultMap"> | 
|     <!--@mbg.generated--> | 
|     select | 
|     <include refid="Base2_Column_List" > | 
|       <property name="alias" value="bd"/> | 
|     </include> | 
|     from ug_rtu_program bd | 
|     where bd.deleted != 1 | 
|     <trim prefix="and" suffixOverrides="and"> | 
|       <if test="name != null and name != ''"> | 
|         bd.hex_file_name like concat('%', #{fileName}, '%') and | 
|       </if> | 
|     </trim> | 
|     order by bd.id DESC | 
|     <trim prefix="limit " > | 
|       <if test="start != null and count != null"> | 
|         #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} | 
|       </if> | 
|     </trim> | 
|   </select> | 
|  <select id="selectAll" parameterType="java.util.Map" resultMap="BaseResultMap"> | 
|     <!--@mbg.generated--> | 
|     select | 
|     id, hex_file_name | 
|     from ug_rtu_program bd | 
|     where bd.deleted != 1 | 
|     order by bd.id DESC | 
|   </select> | 
|   <select id="selectByFileName" parameterType="java.lang.String" resultType="java.lang.Long"> | 
|     select | 
|     count(*) | 
|     from ug_rtu_program bd | 
|     where bd.deleted != 1 | 
|     <trim prefix="and" suffixOverrides="and"> | 
|       <if test="programFileName != null and programFileName != ''"> | 
|         bd.hex_file_name = #{programFileName ,jdbcType=VARCHAR} | 
|       </if> | 
|     </trim> | 
|   </select> | 
|   | 
|   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | 
|     <!--@mbg.generated--> | 
|     delete from ug_rtu_program | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </delete> | 
|   <delete id="deleteLogicById" parameterType="java.lang.Long"> | 
|     <!--@mbg.generated--> | 
|     update ug_rtu_program set deleted = 1 | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </delete> | 
|   <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoUg.UgRtuProgram"> | 
|     <!--@mbg.generated--> | 
|     insert into ug_rtu_program (id, hex_file_name, store_ram_addr,  | 
|       start_ram_addr, program_calculate_bytes, program_crc16,  | 
|       program_bytes,file_bytes, remark, dt, | 
|       deleted) | 
|     values (#{id,jdbcType=BIGINT}, #{hexFileName,jdbcType=VARCHAR}, #{storeRamAddr,jdbcType=VARCHAR},  | 
|       #{startRamAddr,jdbcType=VARCHAR}, #{programCalculateBytes,jdbcType=INTEGER}, #{programCrc16,jdbcType=INTEGER}, | 
|       #{programBytes,jdbcType=BLOB}, #{fileBytes,jdbcType=BLOB}, #{remark,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, | 
|       #{deleted,jdbcType=TINYINT}) | 
|   </insert> | 
|   <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoUg.UgRtuProgram"> | 
|     <!--@mbg.generated--> | 
|     insert into ug_rtu_program | 
|     <trim prefix="(" suffix=")" suffixOverrides=","> | 
|       <if test="id != null"> | 
|         id, | 
|       </if> | 
|       <if test="hexFileName != null"> | 
|         hex_file_name, | 
|       </if> | 
|       <if test="storeRamAddr != null"> | 
|         store_ram_addr, | 
|       </if> | 
|       <if test="startRamAddr != null"> | 
|         start_ram_addr, | 
|       </if> | 
|       <if test="programCalculateBytes != null"> | 
|         program_calculate_bytes, | 
|       </if> | 
|       <if test="programCrc16 != null"> | 
|         program_crc16, | 
|       </if> | 
|       <if test="programBytes != null"> | 
|         program_bytes, | 
|       </if> | 
|       <if test="fileBytes != null"> | 
|         file_bytes, | 
|       </if> | 
|       <if test="remark != null"> | 
|         remark, | 
|       </if> | 
|       <if test="dt != null"> | 
|         dt, | 
|       </if> | 
|       <if test="deleted != null"> | 
|         deleted, | 
|       </if> | 
|     </trim> | 
|     <trim prefix="values (" suffix=")" suffixOverrides=","> | 
|       <if test="id != null"> | 
|         #{id,jdbcType=BIGINT}, | 
|       </if> | 
|       <if test="hexFileName != null"> | 
|         #{hexFileName,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="storeRamAddr != null"> | 
|         #{storeRamAddr,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="startRamAddr != null"> | 
|         #{startRamAddr,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="programCalculateBytes != null"> | 
|         #{programCalculateBytes,jdbcType=INTEGER}, | 
|       </if> | 
|       <if test="programCrc16 != null"> | 
|         #{programCrc16,jdbcType=INTEGER}, | 
|       </if> | 
|       <if test="programBytes != null"> | 
|         #{programBytes,jdbcType=BLOB}, | 
|       </if> | 
|       <if test="fileBytes != null"> | 
|         #{fileBytes,jdbcType=BLOB}, | 
|       </if> | 
|       <if test="remark != null"> | 
|         #{remark,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="dt != null"> | 
|         #{dt,jdbcType=TIMESTAMP}, | 
|       </if> | 
|       <if test="deleted != null"> | 
|         #{deleted,jdbcType=TINYINT}, | 
|       </if> | 
|     </trim> | 
|   </insert> | 
|   <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoUg.UgRtuProgram"> | 
|     <!--@mbg.generated--> | 
|     update ug_rtu_program | 
|     <set> | 
|       <if test="hexFileName != null"> | 
|         hex_file_name = #{hexFileName,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="storeRamAddr != null"> | 
|         store_ram_addr = #{storeRamAddr,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="startRamAddr != null"> | 
|         start_ram_addr = #{startRamAddr,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="programCalculateBytes != null"> | 
|         program_calculate_bytes = #{programCalculateBytes,jdbcType=INTEGER}, | 
|       </if> | 
|       <if test="programCrc16 != null"> | 
|         program_crc16 = #{programCrc16,jdbcType=INTEGER}, | 
|       </if> | 
|       <if test="programBytes != null"> | 
|         program_bytes = #{programBytes,jdbcType=BLOB}, | 
|       </if> | 
|       <if test="fileBytes != null"> | 
|         file_bytes = #{fileBytes,jdbcType=BLOB}, | 
|       </if> | 
|       <if test="remark != null"> | 
|         remark = #{remark,jdbcType=VARCHAR}, | 
|       </if> | 
|       <if test="dt != null"> | 
|         dt = #{dt,jdbcType=TIMESTAMP}, | 
|       </if> | 
|       <if test="deleted != null"> | 
|         deleted = #{deleted,jdbcType=TINYINT}, | 
|       </if> | 
|     </set> | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </update> | 
|   <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoUg.UgRtuProgram"> | 
|     <!--@mbg.generated--> | 
|     update ug_rtu_program | 
|     set hex_file_name = #{hexFileName,jdbcType=VARCHAR}, | 
|       store_ram_addr = #{storeRamAddr,jdbcType=VARCHAR}, | 
|       start_ram_addr = #{startRamAddr,jdbcType=VARCHAR}, | 
|       program_calculate_bytes = #{programCalculateBytes,jdbcType=INTEGER}, | 
|       program_crc16 = #{programCrc16,jdbcType=INTEGER}, | 
|       program_bytes = #{programBytes,jdbcType=BLOB}, | 
|       file_bytes = #{fileBytes,jdbcType=BLOB}, | 
|       remark = #{remark,jdbcType=VARCHAR}, | 
|       dt = #{dt,jdbcType=TIMESTAMP}, | 
|       deleted = #{deleted,jdbcType=TINYINT} | 
|     where id = #{id,jdbcType=BIGINT} | 
|   </update> | 
| </mapper> |