/* * 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.SysUser; import com.miniframe.system.model.SysUserSQLBuilder; import java.sql.SQLException; import java.util.List; public class SysUserDAOImpl implements SysUserDAO { /** * 用户表 : 用户表 * @generated */ private SqlMapClient sqlMapClient; /** * @generated */ public SysUserDAOImpl(SqlMapClient sqlMapClient) { super(); this.sqlMapClient = sqlMapClient; } /** * 获取记录行数 * @generated */ public int countByExample(SysUserSQLBuilder example) throws SQLException { Integer count = (Integer) sqlMapClient.queryForObject("sys_user.countByExample", example); return count; } /** * 条件删除 * @generated */ public int deleteByExample(SysUserSQLBuilder example) throws SQLException { int rows = sqlMapClient.delete("sys_user.deleteByExample", example); return rows; } /** * 根据主键删除 * @generated */ public int deleteByPrimaryKey(String userid) throws SQLException { SysUser _key = new SysUser(); _key.setUserid(userid); int rows = sqlMapClient.delete("sys_user.deleteByPrimaryKey", _key); return rows; } /** * 插入,所有字段 * @generated */ public void insert(SysUser record) throws SQLException { sqlMapClient.insert("sys_user.insert", record); } /** * 动态插入,忽略空字段 * @generated */ public void insertSelective(SysUser record) throws SQLException { sqlMapClient.insert("sys_user.insertSelective", record); } /** * 条件查询 * @generated */ @SuppressWarnings("unchecked") public List selectByExample(SysUserSQLBuilder example) throws SQLException { List list = sqlMapClient.queryForList("sys_user.selectByExample", example); return list; } /** * 根据主键查询 * @generated */ public SysUser selectByPrimaryKey(String userid) throws SQLException { SysUser _key = new SysUser(); _key.setUserid(userid); Object obj = sqlMapClient.queryForObject("sys_user.selectByPrimaryKey", _key); if(!(obj instanceof SysUser)) return null; SysUser record = (SysUser) obj; return record; } /** * 动态修改,不包含空字段 * @generated */ public int updateByExampleSelective(SysUser record, SysUserSQLBuilder example) throws SQLException { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = sqlMapClient.update("sys_user.updateByExampleSelective", parms); return rows; } /** * 条件修改 * @generated */ public int updateByExample(SysUser record, SysUserSQLBuilder example) throws SQLException { UpdateByExampleParms parms = new UpdateByExampleParms(record, example); int rows = sqlMapClient.update("sys_user.updateByExample", parms); return rows; } /** * 动态根据主键修改,为空字段不修改 * @generated */ public int updateByPrimaryKeySelective(SysUser record) throws SQLException { int rows = sqlMapClient.update("sys_user.updateByPrimaryKeySelective", record); return rows; } /** * 根据主键修改 * @generated */ public int updateByPrimaryKey(SysUser record) throws SQLException { int rows = sqlMapClient.update("sys_user.updateByPrimaryKey", record); return rows; } /** * 用户表 : 用户表 * @generated */ protected static class UpdateByExampleParms extends SysUserSQLBuilder { /** * 用户表 : 用户表 * @generated */ private Object record; /** * @generated */ public UpdateByExampleParms(Object record, SysUserSQLBuilder example) { super(example); this.record = record; } /** * @generated */ public Object getRecord() { return record; } } }