@Select("<script>"
+ "<trim prefix='select' suffixOverrides=','>"
+ "<if test='villageId != null and villageId!=\"\" '> v.village_name as villageName, </if> "
+ "<if test='buildingId != null and buildingId!=\"\" '> b.building_name as buildingName, </if> "
+ "<if test='floorId != null and floorId!=\"\" '> f.floor_name as floorName, </if> "
+ "<if test='roomId != null and roomId!=\"\" '> r.alias as roomName </if> "
+ "</trim>"
+ "<trim prefix='from' suffixOverrides=','>"
+ "<if test='villageId != null and villageId!=\"\" '>m_village v, </if>"
+ "<if test='buildingId != null and buildingId!=\"\" '>m_building b, </if>"
+ "<if test='floorId != null and floorId!=\"\" '>m_floor f, </if>"
+ "<if test='roomId != null and roomId!=\"\" '>m_room r, </if>"
+ "</trim>"
+ "<where>"
+ "<if test='villageId != null and villageId!=\"\" '> v.id=#{villageId} </if>"
+ "<if test='buildingId != null and buildingId!=\"\" '> and b.id=#{buildingId} </if>"
+ "<if test='floorId != null and floorId!=\"\" '> and f.id=#{floorId} </if>"
+ "<if test='roomId != null and roomId!=\"\" '> and r.id=#{roomId} </if>"
+ "</where>"
+ "</script>")
Map<String, String> positionFormatter(String villageId, String buildingId, String floorId, String roomId);
sql编写 trim删除指定字符串
最新推荐文章于 2024-03-29 17:39:29 发布