resultMap标签  desc:使返回结果与vo类对应,可以用于接收对象集合与单个对象
<resultMap />
</resultMap>
<select >id,name,age</sql>
调用:<include ref/>
if标签与CONCAT使用    desc:if用于动态植入sql条件或要更新的内容,CONCAT用于连接字符串,否则非法-> %#{name}% 
<if test="property != null">content</if>
<if test="name !=null">
and NAME like CONCAT('%',#{name},'%')
</if>
set标签使用  desc:用于更新中,set标记会把最后一个逗号给去掉。
<set>
UPDATE_TIME = now(),
<if test="status != null">STATUS = #{status,jdbcType=VARCHAR},</if>
</set>
foreach标签使用      desc:用于动态植入多个值(集合)到sql语句中,常用在嵌套查询in后
<resultMap  />
</resultMap>
<select >
#{item}
</foreach>
</select>
<select >
select * from D_STRATEGY where ID = #{strategyId} and STATUS = 'ON'
</select>
parameterType属性   desc:用于指明传入的对象参数
<update >STATUS = #{status,jdbcType=VARCHAR},</if>
</set>
WHERE ID = #{id}
</update>
注意:一般添加和更新指明参数类型
STATUS = #{status,jdbcType=VARCHAR}

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
猜你喜欢
  • 2021-08-03
  • 2022-01-17
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-10-04
相关资源
相似解决方案