<?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.CdDeviceTenantDao">

  <delete id="recycleDevice">
    DELETE FROM
    <include refid="Table_Name"/>
    WHERE now() > expired_time
    and recycle_type = '1'
  </delete>

  <select id="queryExpiredDevice" resultType="string">
    SELECT *
    FROM
    <include refid="Table_Name"/>
    WHERE now() > expired_time
    and recycle_type = '1'
  </select>



  <select id="findDeviceByType" resultType="String">
    SELECT cdt.id
    FROM cd_device_tenant cdt
    LEFT JOIN cd_device_status cds ON cdt.id = cds.id
    WHERE cds.device_type = '2'
    AND cds.device_status = '1'
    AND cdt.tenant_id = #{tenantId,jdbcType=VARCHAR}
  </select>
  <!-- 请在本文件内添加自定义SQL语句 -->
</mapper>