| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <?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.com.goldenwater.dcproj.dao.AttRtuBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttRtuBase" id="attRtuBaseResultMap">
- <result property="id" column="ID"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="orgNm" column="ORG_NM"/>
- <result property="imei" column="IMEI"/>
- <result property="serialNum" column="SERIAL_NUM"/>
- <result property="meid" column="MEID"/>
- <result property="deviceNm" column="DEVICE_NM"/>
- <result property="rtuPhone" column="RTU_PHONE"/>
- <result property="brand" column="BRAND"/>
- <result property="phoneType" column="PHONE_TYPE"/>
- <result property="model" column="MODEL"/>
- <result property="make" column="MAKE"/>
- <result property="osVersion" column="OS_VERSION"/>
- <result property="cpu" column="CPU"/>
- <result property="fillMan" column="FILL_MAN"/>
- <result property="fillManPhone" column="FILL_MAN_PHONE"/>
- <result property="owner" column="OWNER"/>
- <result property="ownerPhone" column="OWNER_PHONE"/>
- <result property="inTm" column="IN_TM"/>
- <result property="upTm" column="UP_TM"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- ORG_ID,
- ORG_NM,
- IMEI,
- SERIAL_NUM,
- MEID,
- DEVICE_NM,
- RTU_PHONE,
- BRAND,
- PHONE_TYPE,
- MODEL,
- MAKE,
- OS_VERSION,
- CPU,
- FILL_MAN,
- FILL_MAN_PHONE,
- OWNER,
- OWNER_PHONE,
- IN_TM,
- UP_TM
- </sql>
- <sql id="entity_properties">
- #{id},
- #{orgId},
- #{orgNm},
- #{imei},
- #{serialNum},
- #{meid},
- #{deviceNm},
- #{rtuPhone},
- #{brand},
- #{phoneType},
- #{model},
- #{make},
- #{osVersion},
- #{cpu},
- #{fillMan},
- #{fillManPhone},
- #{owner},
- #{ownerPhone},
- #{inTm},
- #{upTm}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
- <if test="imei != null and imei != ''">and IMEI = #{imei}</if>
- <if test="serialNum != null and serialNum != ''">and SERIAL_NUM = #{serialNum}</if>
- <if test="meid != null and meid != ''">and MEID = #{meid}</if>
- <if test="deviceNm != null and deviceNm != ''">and DEVICE_NM = #{deviceNm}</if>
- <if test="rtuPhone != null and rtuPhone != ''">and RTU_PHONE = #{rtuPhone}</if>
- <if test="brand != null and brand != ''">and BRAND = #{brand}</if>
- <if test="phoneType != null and phoneType != ''">and PHONE_TYPE = #{phoneType}</if>
- <if test="model != null and model != ''">and MODEL = #{model}</if>
- <if test="make != null and make != ''">and MAKE = #{make}</if>
- <if test="osVersion != null and osVersion != ''">and OS_VERSION = #{osVersion}</if>
- <if test="cpu != null and cpu != ''">and CPU = #{cpu}</if>
- <if test="fillMan != null and fillMan != ''">and FILL_MAN = #{fillMan}</if>
- <if test="fillManPhone != null and fillManPhone != ''">and FILL_MAN_PHONE = #{fillManPhone}</if>
- <if test="owner != null and owner != ''">and OWNER = #{owner}</if>
- <if test="ownerPhone != null and ownerPhone != ''">and OWNER_PHONE = #{ownerPhone}</if>
- <if test="inTm != null">and IN_TM = #{inTm}</if>
- <if test="upTm != null">and UP_TM = #{upTm}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attRtuBaseResultMap" parameterType="String" >
- select <include refid="table_columns" /> from ATT_RTU_BASE where ID = #{id}
- </select>
- <select id="getBy" resultMap="attRtuBaseResultMap">
- select <include refid="table_columns" /> from ATT_RTU_BASE <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attRtuBaseResultMap">
- select <include refid="table_columns" /> from ATT_RTU_BASE
- </select>
- <select id="findList" resultMap="attRtuBaseResultMap">
- select <include refid="table_columns" /> from ATT_RTU_BASE <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from ATT_RTU_BASE <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttRtuBase">
- insert into ATT_RTU_BASE( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_RTU_BASE where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttRtuBase">
- delete from ATT_RTU_BASE <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_RTU_BASE set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttRtuBase">
- update ATT_RTU_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="imei != null and imei != ''">IMEI = #{imei},</if>
- <if test="serialNum != null and serialNum != ''">SERIAL_NUM = #{serialNum},</if>
- <if test="meid != null and meid != ''">MEID = #{meid},</if>
- <if test="deviceNm != null and deviceNm != ''">DEVICE_NM = #{deviceNm},</if>
- <if test="rtuPhone != null and rtuPhone != ''">RTU_PHONE = #{rtuPhone},</if>
- <if test="brand != null and brand != ''">BRAND = #{brand},</if>
- <if test="phoneType != null and phoneType != ''">PHONE_TYPE = #{phoneType},</if>
- <if test="model != null and model != ''">MODEL = #{model},</if>
- <if test="make != null and make != ''">MAKE = #{make},</if>
- <if test="osVersion != null and osVersion != ''">OS_VERSION = #{osVersion},</if>
- <if test="cpu != null and cpu != ''">CPU = #{cpu},</if>
- <if test="fillMan != null and fillMan != ''">FILL_MAN = #{fillMan},</if>
- <if test="fillManPhone != null and fillManPhone != ''">FILL_MAN_PHONE = #{fillManPhone},</if>
- <if test="owner != null and owner != ''">OWNER = #{owner},</if>
- <if test="ownerPhone != null and ownerPhone != ''">OWNER_PHONE = #{ownerPhone},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttRtuBase">
- update ATT_RTU_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="imei != null and imei != ''">IMEI = #{imei},</if>
- <if test="serialNum != null and serialNum != ''">SERIAL_NUM = #{serialNum},</if>
- <if test="meid != null and meid != ''">MEID = #{meid},</if>
- <if test="deviceNm != null and deviceNm != ''">DEVICE_NM = #{deviceNm},</if>
- <if test="rtuPhone != null and rtuPhone != ''">RTU_PHONE = #{rtuPhone},</if>
- <if test="brand != null and brand != ''">BRAND = #{brand},</if>
- <if test="phoneType != null and phoneType != ''">PHONE_TYPE = #{phoneType},</if>
- <if test="model != null and model != ''">MODEL = #{model},</if>
- <if test="make != null and make != ''">MAKE = #{make},</if>
- <if test="osVersion != null and osVersion != ''">OS_VERSION = #{osVersion},</if>
- <if test="cpu != null and cpu != ''">CPU = #{cpu},</if>
- <if test="fillMan != null and fillMan != ''">FILL_MAN = #{fillMan},</if>
- <if test="fillManPhone != null and fillManPhone != ''">FILL_MAN_PHONE = #{fillManPhone},</if>
- <if test="owner != null and owner != ''">OWNER = #{owner},</if>
- <if test="ownerPhone != null and ownerPhone != ''">OWNER_PHONE = #{ownerPhone},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|