/* * Copyright 2010 The YAPULAN Software Foundation * * Licensed under the YAPULAN License, Version 2.0 (the "License"); */ package com.miniframe.system.model.dao; import com.ibatis.sqlmap.client.SqlMapClient; import com.miniframe.system.model.SysRole; import com.miniframe.system.model.SysRoleSQLBuilder; import java.sql.SQLException; import java.util.List; public class SysRoleDAOImpl implements SysRoleDAO { /** * 角色信息表 : 角色信息表 * @generated */ private SqlMapClient sqlMapClient; /** * @generated */ public SysRoleDAOImpl(SqlMapClient sqlMapClient) { super(); this.sqlMapClient = sqlMapClient; } /** * 获取记录行数 * @generated */ public int countByExample(SysRoleSQLBuilder example) throws SQLException { Integer count = (Integer) sqlMapClient.queryForObject("sys_role.countByExample", example); return count; } /** * 条件删除 * @generated */ public int deleteByExample(SysRoleSQLBuilder example) throws SQLException { int rows = sqlMapClient.delete("sys_role.deleteByExample", example); return rows; } /** * 根据主键删除 * @generated */ public int deleteByPrimaryKey(String roleid) throws SQLException { SysRole _key = new SysRole(); _key.setRoleid(roleid); int rows = sqlMapClient.delete("sys_role.deleteByPrimaryKey", _key); return rows; } /** * 插入,所有字段 * @generated */ public void insert(SysRole record) throws SQLException { sqlMapClient.insert("sys_role.insert", record); } /** * 动态插入,忽略空字段 * @generated */ public void insertSelective(SysRole record) throws SQLException { sqlMapClient.insert("sys_role.insertSelective", record); } /** * 条件查询 * @generated */ @SuppressWarnings("unchecked") public List selectByExample(SysRoleSQLBuilder example) throws SQLException { List list = sqlMapClient.queryForList("sys_role.selectByExample", example); return list; } /** * 根据主键查询 * @generated */ public SysRole selectByPrimaryKey(String roleid) throws SQLException { SysRole _key = new SysRole(); _key.setRoleid(roleid); Object obj = sqlMapClient.queryForObject("sys_role.selectByPrimaryKey", _key); if(!(obj instanceof SysRole)) return null; SysRole record = (SysRole) obj; return record; } /** * 动态修改,不包含空字段 * @generated */ public int updateByExampleSelective(SysRole record, SysRoleSQLBuilder example) throws SQLException { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = sqlMapClient.update("sys_role.updateByExampleSelective", parms); return rows; } /** * 条件修改 * @generated */ public int updateByExample(SysRole record, SysRoleSQLBuilder example) throws SQLException { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = sqlMapClient.update("sys_role.updateByExample", parms); return rows; } /** * 动态根据主键修改,为空字段不修改 * @generated */ public int updateByPrimaryKeySelective(SysRole record) throws SQLException { int rows = sqlMapClient.update("sys_role.updateByPrimaryKeySelective", record); return rows; } /** * 根据主键修改 * @generated */ public int updateByPrimaryKey(SysRole record) throws SQLException { int rows = sqlMapClient.update("sys_role.updateByPrimaryKey", record); return rows; } /** * 角色信息表 : 角色信息表 * @generated */ protected static class UpdateByExampleParms extends SysRoleSQLBuilder { /** * 角色信息表 : 角色信息表 * @generated */ private Object record; /** * @generated */ public UpdateByExampleParms(Object record, SysRoleSQLBuilder example) { super(example); this.record = record; } /** * @generated */ public Object getRecord() { return record; } } }