from pot_libs.mysql_util.mysql_util import MysqlUtil


async def change_sensor_record_by_location_id(location_id):
    """根据location_id查询change_sensor_record表"""
    sql = 'select sid,field from change_sensor_record where location_id=%s ' \
          'order by start_time desc limit 1'
    async with MysqlUtil() as conn:
        change_sensor_dic = await conn.fetchone(sql, args=(location_id,))
    return change_sensor_dic
