<?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="net.northking.cctp.device.db.dao.CdDeviceTokenDao">

  <select id="queryDeviceList" resultMap="BaseResultMap">
    SELECT
    <include refid="Base_Column_List"/>
    FROM cd_device_token
    WHERE
    user_id = #{userId, jdbcType=VARCHAR}
    <if test="ids != null and ids.size > 0">
      AND id in
      <foreach collection="ids" item="idItem" open="(" separator="," close=")">
        #{idItem, jdbcType=VARCHAR}
      </foreach>
    </if>
  </select>

  <select id="queryByEngineIds" resultMap="BaseResultMap">
    SELECT
    <include refid="Base_Column_List"/>
    FROM cd_device_token
    WHERE
    user_id in
      <foreach collection="ids" item="idItem" open="(" separator="," close=")">
        #{idItem, jdbcType=VARCHAR}
      </foreach>
  </select>

  <!-- 请在本文件内添加自定义SQL语句 -->
</mapper>