| | |
| | | |
| | | |
| | | <select id="searchByCondition" resultType="com.whyc.pojo.BtsStateChangeInf"> |
| | | select distinct(db_batt_history.tb_btsstaechange_inf.num),dev_id,db_batt_history.tb_btsstaechange_inf.record_time,last_state,now_state,event_type,note |
| | | ,db_battinf.tb_battinf.stationName |
| | | select distinct(inf.num),dev_id,record_time,last_state,now_state,event_type,note |
| | | ,b.stationName |
| | | from |
| | | db_batt_history.tb_btsstaechange_inf, |
| | | db_battinf.tb_battinf |
| | | db_batt_history.tb_btsstaechange_inf inf, |
| | | db_battinf.tb_battinf b |
| | | <where> |
| | | db_batt_history.tb_btsstaechange_inf.dev_id=db_battinf.tb_battinf.FBSDeviceId |
| | | inf.dev_id=b.FBSDeviceId |
| | | <if test="binf.devId!=null and binf.devId!=0"> |
| | | and dev_id=#{binf.devId} |
| | | and inf.dev_id=#{binf.devId} |
| | | </if> |
| | | <if test="binf.province!=null and binf.province!='' and binf.province!='null'"> |
| | | and b.stationName1=#{binf.province} |
| | | </if> |
| | | <if test="binf.city!=null and binf.city!='' and binf.city!='null'"> |
| | | and b.stationName2=#{binf.city} |
| | | </if> |
| | | <if test="binf.county!=null and binf.county!='' and binf.county!='null'"> |
| | | and b.stationName5=#{binf.county} |
| | | </if> |
| | | <if test="binf.recordTime!=null and binf.recordTime1!=null"> |
| | | and db_batt_history.tb_btsstaechange_inf.record_time>=#{binf.recordTime} |
| | | and db_batt_history.tb_btsstaechange_inf.record_time<=#{binf.recordTime1} |
| | | and inf.record_time>=#{binf.recordTime} |
| | | and inf.record_time<=#{binf.recordTime1} |
| | | </if> |
| | | <if test="binf.eventType!=0"> |
| | | and event_type=#{binf.eventType} |
| | | and inf.event_type=#{binf.eventType} |
| | | </if> |
| | | </where> |
| | | order by db_batt_history.tb_btsstaechange_inf.record_time asc |
| | | order by inf.record_time desc |
| | | </select> |
| | | </mapper> |