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