Mybatis update時判斷為空的寫法和like的寫法
阿新 • • 發佈:2018-12-21
update zendtao_new.customcalendarinfo a <set> <if test="pdu != null"> a.pduname = #{pdu,jdbcType=VARCHAR}, </if> <if test="name != null"> a.name = #{name,jdbcType=VARCHAR}, </if> <if test="start != null"> a.start = #{start,jdbcType=VARCHAR}, </if> <if test="end != null"> a.end = #{end,jdbcType=VARCHAR}, </if> <if test="title != null"> a.title = #{title,jdbcType=VARCHAR}, </if> <if test="url != null"> a.url = #{url,jdbcType=VARCHAR}, </if> <if test="env != null"> a.env = #{env,jdbcType=VARCHAR}, </if> </set> where a.relativeguid = #{guid,jdbcType=VARCHAR} and a.name like CONCAT('%',#{symbol,jdbcType=VARCHAR},'%')