sql编写 trim删除指定字符串

	@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);

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值