mybatis多表查询:
<select id="selectFeeBillDetailByHouseId" resultType="com.zcsy.manage.model.property.FeeBillDetail"
parameterType="java.util.List">select b.start_date, b.bill_id, b.money, b.end_date, b.area,
b.unit_price, b.rate, b.state, b.pay_way, b.operator,
b.pay_time,c.cell_name cellName, c.region_name regionName,
c.building_name buildingName, c.unit_name unitName, c.name name
from
(select id, house_id from property_fee_bill where house_id in
<foreach item="housesID" index="index" collection="list"
open="(" separator="," close=")">
#{housesID}
</foreach>
) a
left join property_fee_bill_detail b on a.id = b.bill_id
left join
base_cell_house c on a.house_id = c.id
</select>
常用参数类型:
parameterType="java.lang.String"
parameterType="java.util.List"
Mybatis中javaType和jdbcType对应关系
JDBC Type Java Type CHAR String VARCHAR String LONGVARCHAR String NUMERIC java.math.BigDecimal DECIMAL java.math.BigDecimal BIT boolean BOOLEAN boolean TINYINT byte SMALLINT short INTEGER int BIGINT long REAL float FLOAT double DOUBLE double BINARY byte[] VARBINARY byte[] LONGVARBINARY byte[] DATE java.sql.Date TIME java.sql.Time TIMESTAMP java.sql.Timestamp CLOB Clob BLOB Blob ARRAY Array DISTINCT mapping of underlying type STRUCT Struct REF Ref DATALINK java.net.URL[color=red][/color]