1. 动态sql : 传入的 是Map (查询)
<select id = "findall" parameterType="map" resultMap=" XXXX" >
select * from student
<where>
<if test="id!=null"> and id=#{id} </if>
<if test="name!=null"> and name=#{name} </if>
<if test="type!=null"> and type=#{type} </if>
</where>
</select>
2.
<update id="updateByPrimaryKeySelective" parameterType="com.iris.live.data.model.LSH休假信息表Dto">
update LSH休假信息表
<set>
<if test="许可 != null">
许可 = #{许可,jdbcType=VARCHAR},
</if>
<if test="是否通过 != null">
是否通过 = #{是否通过,jdbcType=CHAR},
</if>
</set>
where 销售顾问 = #{销售顾问,jdbcType=VARCHAR}
and 休假日期 = #{休假日期,jdbcType=DATE}
</update>
3.
<insert id="insertSelective" parameterType="com.iris.live.data.model.LSH休假信息表Dto">
insert into LSH休假信息表
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="销售顾问 != null">
销售顾问,
</if>
<if test="更新时间 != null">
更新时间,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="销售顾问 != null">
#{销售顾问,jdbcType=VARCHAR},
</if>
<if test="休假日期 != null">
#{休假日期,jdbcType=DATE},
</if>
<if test="更新账号 != null">
#{更新账号,jdbcType=VARCHAR},
</if>
<if test="更新时间 != null">
#{更新时间,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>