首页 试题广场 > 试题详情
多选题

【C017117】在MyBatis中,对以下错误代码片段修改正确的选项是( )。
dao接口:
public List findAll(String id,String name);
Mapper:
<select id="findAll" resultType="user" parameterType="string" >
???????? select * from sys_users
???????? <where>
???????????? <if test="id != null">
???????????????? and id=#{id}
???????????? </if>
<if test="name != null">
???????????????? and name=#{name}
???????????? </if>
???????? </where>
</select>

  • A.修改dao接口代码为:public User findAll(String id,String name);
  • B.修改mapper代码为:
    <!--省略list定义-->
    <select id="findAll" resultType="list" parameterType="map" >
    ???????? select * from sys_users
    ???????? <where>
    ???????????? <if test="id != null">
    ???????????????? and id=#{id}
    ???????????? </if>
    <if test="name != null">
    ???????????????? and name=#{name}
    ???????????? </if>
    ???????? </where>
    </select>
  • C.修改dao接口代码为:public List findById(@Param("id") String id,@Param("id") String id);
  • D.修改dao接口代码为:public List findById(Map<String,String> map);
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 6个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部