mapper.java层代码
@Select("<script>" + "select p.* " + " from PropertyCostInfo p, RoomInfo r, Layer l, Building b" + " where 1=1 and b.B_id = l.L_bid and l.L_id= r.R_lid and p.Pc_rid=r.R_address " + " <if test='buildId != null and buildId > 0'>" + " AND b.B_id=#{buildId}" + " </if>" + " <if test='layerId != null and layerId > 0'>" + " AND l.L_id=#{layerId}" + " </if>" + " <if test='roomNumber != null and roomNumber != \"\"' >" + " AND r.R_address =#{roomNumber}" + " </if>" + " <if test='remarks != null and remarks != \"\"'>" + &#