1.查询

//    查询
@Select("select id, name, type, numbers, cancelled, completed, percentage from customer_list")
List<CustomerList> selectCustomerListAll();   //多表联查
  //所有的关联实体类必须引入此注解 @JsonIgnoreProperties(value = {"handler","hibernateLazyInitializer","fieldHandler"})
  @Select("select id, user_name, remarks, service_id, from jurisdiction_role ")
  @Results(id="resultMap", value = {
@Result(column = "id" , property = "id" ,id=true),
@Result(column = "user_name" ,property = "user_name"),
@Result(column = "remarks",property = "remarks"),
@Result(property = "service_id",column = "service_id" , //com.cn.test.mapper.JurisdictionServiceMapper.selectJurisdictionServiceOneId 引入的此mapper必须实现此查询方法
                many = @Many(select = "com.cn.test.mapper.JurisdictionServiceMapper.selectJurisdictionServiceOneId",
fetchType = FetchType.LAZY)),
  })
  List<JurisdictionRole> selectJurisdictionRoleAll();   //com.cn.test.mapper.JurisdictionServiceMapper.selectJurisdictionServiceOneId
  @Select("select id, name, imports, repair_statistics, annual_completion_rate, work_order_statistics, app_amount, app_times, usage_statistics, " +
"satisfaction_survey, device_status from jurisdiction_service where id = #{id}")
  JurisdictionService selectJurisdictionServiceOneId(Integer id);

2.修改
//    修改
@Update("<script> update customer_list set <if test = 'name != null'> name = #{name} ,</if>" +
"<if test = 'type != null'> type = #{type} ,</if>" +
"<if test = 'numbers != null'> numbers = #{numbers} ,</if>" +
"<if test = 'cancelled != null'> cancelled = #{cancelled} ,</if>" +
"<if test = 'completed != null'> completed = #{completed} ,</if>" +
"<if test = 'percentage != null'> percentage = #{percentage} ,</if>" +
"id = #{id} where id = #{id}</script>")
int updateCustomerListOneId(CustomerList customerList); 3.添加
  @Insert("insert into jurisdiction_role (user_name, remarks, state)" +
"values (#{user_name}, #{remarks}, #{state})")
  int insertIntoJurisdictionRoleIdOne(JurisdictionRole jurisdictionRole);
4.删除
  @Delete("delete from locks where id = #{id}")
  int deleteLocksOneId(Integer id);
 
注:以上内容仅供个人学习记录使用,如有问题,请慎用!

最新文章

  1. ASP.NET MVC Form验证
  2. Android 数据存储五种方式
  3. SVN迁移到Git的过程(+ 一些技巧)
  4. linux 中的斜杠 ‘/’ ‘\’ 的区别 - 服务器是LINUX的注意了, 和windows 的不一样哦!
  5. C#与XML Schema的问题
  6. 动态加载js,css
  7. struct--file_operations
  8. hdu 1800 Flying to the Mars
  9. JAVA 堆设置
  10. StringEscapeUtils.unescapeHtml的使用
  11. NSIndexPath 延伸
  12. Kettle 5.0源码编译
  13. .6-Vue源码之AST(2)
  14. JS 三目运算符和RETURN
  15. Struct_2路径问题
  16. vue实现商品购物车全选与全不选项目实战
  17. Intellij IDEA 阅读源码的 4 个绝技,我必须分享给你!
  18. zabbix学习笔记----安装----2019.03.26
  19. Sping boot和mybatis整合
  20. 用 python 生成一个简单的词云图

热门文章

  1. PDF的来源——概率密度函数
  2. eric4 中pyqt 字符串 输入 获取
  3. [Hei-Ocelot-Gateway ].Net Core Api网关Ocelot的开箱即用版本
  4. Kubernetes实战指南(三十三):都0202了,你还在手写k8s的yaml文件?
  5. 基础知识、DOS命令
  6. Jmeter系列(51)- 详解 Transaction Controller 事务控制器
  7. max user processes 导致的服务器大量close_wait问题解决过程
  8. Deep Learning-Based Video Coding: A Review and A Case Study
  9. 从零开始的SpringBoot项目 ( 三 ) 项目打包( jar包篇 )
  10. C# 解析获取Url参数值