随笔分类 -  mybatis

摘要:mapper.xml 简化技巧insert 可复用 <sql id="setField"> <set> <if test="taskVersionId != null">task_version_id = #{taskVersionId},</if> <if test="uid != null">u 阅读全文
posted @ 2022-01-19 10:23 隔壁w王叔叔 阅读(84) 评论(0) 推荐(0)
摘要:1. Orace 存在更新,不存在插入的写法 【MERGE INTO】-【when not matched then insert】-【when matched then update】 <insert id="updateUserRole" > MERGE INTO SVC_ROLE_USER R 阅读全文
posted @ 2020-06-23 11:16 隔壁w王叔叔 阅读(433) 评论(0) 推荐(0)
摘要:1.我们希望返回的实体对象结构如下: @Data public class OrderPaymentInfoRetDTO { private Integer id;//id字段必须要写,他作为过层级1对多的重要滤条件存在的 RespOrderListDTO respOrderListDTO;//一个 阅读全文
posted @ 2020-04-14 14:14 隔壁w王叔叔 阅读(273) 评论(0) 推荐(0)
摘要:在事务发生错误时进行异常回滚,而且,Spring会将产生的MyBatis异常转换成适当的 DataAccessExceptions,从而提供具体的异常信息。 阅读全文
posted @ 2019-01-09 09:53 隔壁w王叔叔 阅读(215) 评论(0) 推荐(0)