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