mybatis传实体参数

[复制链接]
发表于 2024-10-24 15:23:24 | 显示全部楼层 |阅读模式
<select id="selectByRecord" resultMap="BaseResultMap" parameterType="com.hka.api.staff.StaffInfo.Staff" >
    select
    <include refid="Base_Column_List"/>
    from staff
    <where>
      <if test="staffNo!=null and staffNo!='' ">
        staff_no = #{staffNo,jdbcType=VARCHAR}
      </if>
      <if test="staffCode!=null  and staffCode!=''">
        staff_code = #{staffCode,jdbcType=VARCHAR}
      </if>
    </where>
  </select>
List<Staff> selectByRecord( Staff staff);

不需要用@Param 注解

GMT+8, 2025-4-20 18:17 , Processed in 0.073882 second(s), 33 queries Archiver|手机版|小黑屋|Attic ( 京ICP备2020048627号 )

快速回复 返回顶部 返回列表