传单个参数
略
传多个参数
sql中按照 #{arg0},#{arg1}… 的顺序排列即可
示例
List<ChannelInfo> selectTest(String vo_dev, String password);
<select id="selectTest" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from aaa_channel_info
where vo_dev = #{arg0} and
password= #{arg1}
</select>
传值中含有字段名(动态拼接字段)
例如查表中title为JAVA的列,此时需要
按照顺序字段名以**${arg0}的格式,而字段值以#{}**的格式
示例
List<ChannelInfo> selectTest(String fieldName, String fieldValue);
<select id="selectTest" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from aaa_channel_info
where ${arg0} = #{arg1}
</select>
891

被折叠的 条评论
为什么被折叠?



