<?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.casic.missiles.modular.system.dao.DeviceImeiMapper">

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        DEVICE_ID AS "deviceId", WELL_ID AS "wellId", TS AS ts, VALID AS valid
    </sql>

    <sql id="dateTime_toChar" databaseId="mysql">
        DATE_FORMAT(${paramTime},'%Y-%m-%d %H:%i:%s')
    </sql>

    <sql id="dateTime_toChar" databaseId="pgsql">
          TO_CHAR(${paramTime},'yyyy-mm-dd hh24:mi:ss')
    </sql>

    <sql id="dateTime_toChar" databaseId="oracle">
          TO_CHAR(${paramTime},'yyyy-mm-dd hh24:mi:ss')
    </sql>

    <select id="getImeiListPage" resultType="MAP">
        SELECT id  AS "id",devcode AS "devcode",imei AS "imei",iccid AS  "iccid",
        <include refid="dateTime_toChar">
            <property name="paramTime" value="logtime"/>
        </include>  AS  "logtime"
        FROM bus_imei_iccid
        WHERE 1=1
        <if test="devcode != null and devcode !=''">
            AND DEVCODE = #{devcode}
        </if>
    </select>

</mapper>
