使用Map 达到使用需要数据进行sql查询

Map map = new HashMap();
String attachId=request.getParameter("attachId");
String specialId=specialTask.getId();
map.put("attachId",attachId);
map.put("specialId",specialId);
specialTaskService.myupdate(map);

=================Service=========================

  @Transactional(readOnly = false)
 public void myupdate(Map map){
  dao.myupdate(map);
 }
 
}

==================dao=======================

public void myupdate(Map map);

==================xml=======================

<update id="myupdate" parameterType="Map">
   update sys_attachment set  table_id= #{specialId} where id=#{attachId}
</update>

猜你喜欢

转载自blog.csdn.net/ccclych1/article/details/88735553
今日推荐