PlatformDAOImpl.java 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * Copyright 2010 The YAPULAN Software Foundation
  3. *
  4. * Licensed under the YAPULAN License, Version 2.0 (the "License");
  5. */
  6. package com.miniframe.system.model.dao;
  7. import com.ibatis.sqlmap.client.SqlMapClient;
  8. import com.miniframe.system.model.Platform;
  9. import com.miniframe.system.model.PlatformSQLBuilder;
  10. import java.sql.SQLException;
  11. import java.util.List;
  12. public class PlatformDAOImpl implements PlatformDAO {
  13. /**
  14. * 平台配置表 : 平台配置表
  15. * @generated
  16. */
  17. private SqlMapClient sqlMapClient;
  18. /**
  19. * @generated
  20. */
  21. public PlatformDAOImpl(SqlMapClient sqlMapClient) {
  22. super();
  23. this.sqlMapClient = sqlMapClient;
  24. }
  25. /**
  26. * 获取记录行数
  27. * @generated
  28. */
  29. public int countByExample(PlatformSQLBuilder example) throws SQLException {
  30. Integer count = (Integer) sqlMapClient.queryForObject("platform.countByExample", example);
  31. return count;
  32. }
  33. /**
  34. * 条件删除
  35. * @generated
  36. */
  37. public int deleteByExample(PlatformSQLBuilder example) throws SQLException {
  38. int rows = sqlMapClient.delete("platform.deleteByExample", example);
  39. return rows;
  40. }
  41. /**
  42. * 根据主键删除
  43. * @generated
  44. */
  45. public int deleteByPrimaryKey(String id) throws SQLException {
  46. Platform _key = new Platform();
  47. _key.setId(id);
  48. int rows = sqlMapClient.delete("platform.deleteByPrimaryKey", _key);
  49. return rows;
  50. }
  51. /**
  52. * 插入,所有字段
  53. * @generated
  54. */
  55. public void insert(Platform record) throws SQLException {
  56. sqlMapClient.insert("platform.insert", record);
  57. }
  58. /**
  59. * 动态插入,忽略空字段
  60. * @generated
  61. */
  62. public void insertSelective(Platform record) throws SQLException {
  63. sqlMapClient.insert("platform.insertSelective", record);
  64. }
  65. /**
  66. * 条件查询
  67. * @generated
  68. */
  69. @SuppressWarnings("unchecked")
  70. public List<Platform> selectByExample(PlatformSQLBuilder example) throws SQLException {
  71. List<Platform> list = sqlMapClient.queryForList("platform.selectByExample", example);
  72. return list;
  73. }
  74. /**
  75. * 根据主键查询
  76. * @generated
  77. */
  78. public Platform selectByPrimaryKey(String id) throws SQLException {
  79. Platform _key = new Platform();
  80. _key.setId(id);
  81. Object obj = sqlMapClient.queryForObject("platform.selectByPrimaryKey", _key);
  82. if(!(obj instanceof Platform))
  83. return null;
  84. Platform record = (Platform) obj;
  85. return record;
  86. }
  87. /**
  88. * 动态修改,不包含空字段
  89. * @generated
  90. */
  91. public int updateByExampleSelective(Platform record, PlatformSQLBuilder example) throws SQLException {
  92. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  93. int rows = sqlMapClient.update("platform.updateByExampleSelective", parms);
  94. return rows;
  95. }
  96. /**
  97. * 条件修改
  98. * @generated
  99. */
  100. public int updateByExample(Platform record, PlatformSQLBuilder example) throws SQLException {
  101. UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
  102. int rows = sqlMapClient.update("platform.updateByExample", parms);
  103. return rows;
  104. }
  105. /**
  106. * 动态根据主键修改,为空字段不修改
  107. * @generated
  108. */
  109. public int updateByPrimaryKeySelective(Platform record) throws SQLException {
  110. int rows = sqlMapClient.update("platform.updateByPrimaryKeySelective", record);
  111. return rows;
  112. }
  113. /**
  114. * 根据主键修改
  115. * @generated
  116. */
  117. public int updateByPrimaryKey(Platform record) throws SQLException {
  118. int rows = sqlMapClient.update("platform.updateByPrimaryKey", record);
  119. return rows;
  120. }
  121. /**
  122. * 平台配置表 : 平台配置表
  123. * @generated
  124. */
  125. protected static class UpdateByExampleParms extends PlatformSQLBuilder {
  126. /**
  127. * 平台配置表 : 平台配置表
  128. * @generated
  129. */
  130. private Object record;
  131. /**
  132. * @generated
  133. */
  134. public UpdateByExampleParms(Object record, PlatformSQLBuilder example) {
  135. super(example);
  136. this.record = record;
  137. }
  138. /**
  139. * @generated
  140. */
  141. public Object getRecord() {
  142. return record;
  143. }
  144. }
  145. }