WHERE channelmodule_id=(SELECT id from channelmodule WHERE name=#{channelModuleName,jdbcType=VARCHAR} AND company_id=(SELECT id FROM company where companyName=#{companyName,jdbcType=VARCHAR}))
SELECT TDLName,TDLSN,counts,FROM_UNIXTIME(lastTime) lastTime,useScene,(SELECT warehouseName from warehouse WHERE id=t.warehouse_id) warehouseName,
SELECT TDLName,TDLSN,counts,FROM_UNIXTIME(lastTime) lastTime,useScene,(SELECT warehouseName from warehouse WHERE id=t.warehouse_id) warehouseName,
(SELECT transportationNo from circuit WHERE id=t.circuit_id) transportationNo
(SELECT transportationNo from circuit WHERE id=t.circuit_id) transportationNo,(SELECT SN from gateway WHERE id=t.gateway_id) gatewaySN,(SELECT type from gateway WHERE id=t.gateway_id) gatewayType
from tdldevice t WHERE 1=1
from tdldevice t where 1=1
<iftest="TDLName!=null">
<iftest="TDLName!=null">
AND TDLName like CONCAT(CONCAT('%',#{TDLName,jdbcType=VARCHAR}), '%')
AND TDLName like CONCAT(CONCAT('%',#{TDLName,jdbcType=VARCHAR}), '%')
SELECT TDLName,TDLSN,counts,FROM_UNIXTIME(lastTime) lastTime,useScene,(SELECT warehouseName from warehouse WHERE id=t.warehouse_id) warehouseName,
SELECT TDLName,TDLSN,counts,FROM_UNIXTIME(lastTime) lastTime,useScene,(SELECT warehouseName from warehouse WHERE id=t.warehouse_id) warehouseName,
(SELECT transportationNo from circuit WHERE id=t.circuit_id) transportationNo
(SELECT transportationNo from circuit WHERE id=t.circuit_id) transportationNo,(SELECT SN from gateway WHERE id=t.gateway_id) gatewaySN,(SELECT type from gateway WHERE id=t.gateway_id) gatewayType
from tdldevice t WHERE TDLSN=#{TDLSN,jdbcType=VARCHAR}