mybits多参数传递
方式一:
public AddrInfo getAddrInfo(@Param("corpId")int corpId, @Param("addrId")int addrId);
xml配置这样写:
<select id="getAddrInfo" resultMap="com.xxx.xxx.AddrInfo">
SELECT * FROM addr__info
where addr_id=#{addrId} and corp_id=#{corpId}
</select>
以前在<select>语句中要带parameterType的,现在可以不要这样写。
方式二:
List<SqlRecord> getSqlList(String system,String name,String founder);
<select id="getSqlList" resultType="com.gilite.cn.data.common.entity.SqlRecord">
select
*
from
DM_SQL_RECORD
where 1=1
<if test="arg0 != null">
and SYSTEM_ = #{param1}//或者#{arg0}
</if>
<if test="arg1 != null">
and NAME_ = #{param2}
</if>
<if test="arg2 != null">
and FOUNDER = #{param3}
</if>
</select>