博客
关于我
Mybatis注解开发 @Select @Insert @Update @Delete
阅读量:201 次
发布时间:2019-02-28

本文共 1645 字,大约阅读时间需要 5 分钟。

Mybatis注解开发 @Select @Insert @Update @Delete

@Select用法

如果未使用mybatis的动态标签,则不需要加标签注意若数据库为在oracle,使用容易造成字段类型不匹配的问题
@Mapperpublic interface RtcCheckParamBussDao {    @Select(value = "")    int checkUserBranch(@Param(value = "branchCode" ) String branchCode, @Param(value = "subBranchCode" )String subBranchCode,@Param(value = "userId" ) String userId);    @Select(value = "")    int checkAccountContract(@Param(value = "account_no") String account_no,@Param(value = "contract_no") String contract_no);    @Select(value = "")    int checkProductSubProduct(@Param(value = "branchCode")String branchCode, @Param(value = "subBranchCode")String subBranchCode, @Param(value = "product")String product, @Param(value = "subProduct")String subProduct);    @Select(value = "")    int checkTillDepartmentCurrency(@Param(value = "branchCode")String branchCode, @Param(value = "subBranchCode")String subBranchCode, @Param(value = "department")String department, @Param(value = "tillCode")String tillCode,@Param(value = "currency") String currency);    @Select(value = "")    int checkAccountNoContractNo(@Param(value = "parm01") String parm01, @Param(value = "parm02") String parm02);    @Select(value = "")    String checkPageVerify(Map
map);}

@Update使用

@Update({ "update sys_role set role_name = #{roleName},enabled = #{enabled},create_by = #{createBy},create_time = #{createTime, jdbcType=TIMESTAMP} where id = #{id}" })    int updateSysRoleById(SysRole sysRole);

@Insert使用

// 批量插入数据@Insert("")void addBatch(@Param("Lines") List
Lines);

@Delete使用

@Delete("delete from sys_role where id = #{id}")    int deleteSysRoleById(Long id);

转载地址:http://fkji.baihongyu.com/

你可能感兴趣的文章
NIO蔚来 面试——IP地址你了解多少?
查看>>
NISP一级,NISP二级报考说明,零基础入门到精通,收藏这篇就够了
查看>>
NISP国家信息安全水平考试,收藏这一篇就够了
查看>>
NIS服务器的配置过程
查看>>
NIS认证管理域中的用户
查看>>
Nitrux 3.8 发布!性能全面提升,带来非凡体验
查看>>
NiuShop开源商城系统 SQL注入漏洞复现
查看>>
NI笔试——大数加法
查看>>
NLog 自定义字段 写入 oracle
查看>>
NLog类库使用探索——详解配置
查看>>
NLP 基于kashgari和BERT实现中文命名实体识别(NER)
查看>>
NLP 时事和见解【2023】
查看>>
NLP 模型中的偏差和公平性检测
查看>>
Vue3.0 性能提升主要是通过哪几方面体现的?
查看>>
NLP 项目:维基百科文章爬虫和分类【01】 - 语料库阅读器
查看>>
NLP_什么是统计语言模型_条件概率的链式法则_n元统计语言模型_马尔科夫链_数据稀疏(出现了词库中没有的词)_统计语言模型的平滑策略---人工智能工作笔记0035
查看>>
NLP、CV 很难入门?IBM 数据科学家带你梳理
查看>>
NLP三大特征抽取器:CNN、RNN与Transformer全面解析
查看>>
NLP入门(六)pyltp的介绍与使用
查看>>