当前位置:网站首页>MySQL multi condition matching fuzzy query

MySQL multi condition matching fuzzy query

2022-06-25 01:15:00 wcdunf

  // mysql edition  
select * from nf_massif where
        concat(IFNULL(id,''),
        IFNULL(plot_number,''),
        IFNULL(respective_region,''),
        IFNULL(land_name,''),
        IFNULL(land_area,''),
        IFNULL(geographic_coordinates,''),
        IFNULL(land_type,''),
        IFNULL(land_price,''),
        IFNULL(land_condition,''),
        IFNULL(suitable_crop,''),
        IFNULL(lease_term,''),
        IFNULL(tenant,''),
        IFNULL(create_time,''),
        IFNULL(update_time,''))

        like CONCAT ('% Jiyang %','% laboratory %')

//mybatis edition 

  select * from nf_massif where
        concat(IFNULL(id,''),
        IFNULL(plot_number,''),
        IFNULL(respective_region,''),
        IFNULL(land_name,''),
        IFNULL(land_area,''),
        IFNULL(geographic_coordinates,''),
        IFNULL(land_type,''),
        IFNULL(land_price,''),
        IFNULL(land_condition,''),
        IFNULL(suitable_crop,''),
        IFNULL(lease_term,''),
        IFNULL(tenant,''),
        IFNULL(create_time,''),
        IFNULL(update_time,''))
        like CONCAT ('%', #{content},'%','%', #{hotZone},'%')

// Be careful : When there are many conditions , A wide range of conditions come first , The condition with small scope is placed after the condition with large scope , Once reversed , A wide range of conditions will not work 

 

原网站

版权声明
本文为[wcdunf]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210541517905.html