package com.slcf.dao;
|
|
import java.util.List;
|
import java.util.Map;
|
|
import org.apache.ibatis.annotations.Delete;
|
import org.apache.ibatis.annotations.Insert;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Update;
|
import org.springframework.stereotype.Repository;
|
|
import com.slcf.pojo.GroupBean;
|
|
@Repository
|
public interface GroupDao {
|
|
/**
|
*根据部门名称或部门id验证部门名称是否唯一
|
* @param map
|
* @return
|
*/
|
public List<GroupBean> getGroupByCon(Map<String,Object>map);
|
|
/**
|
* 添加部门
|
* @param group
|
* @return
|
*/
|
@Insert("insert into t_b_Group(f_GroupName,f_GroupNO) values(#{f_GroupName},#{f_GroupNO})")
|
public int insertGroup(GroupBean group);
|
|
|
//分页查询所以部门
|
// @Select("select * from tb_dept ORDER BY dept_id desc LIMIT #{spage},#{epage}")
|
@Select("select top (#{epage}) * from t_b_Group where f_GroupID not in "
|
+ "(select top (#{spage}) f_GroupID from t_b_Group order by f_GroupID desc) order by f_GroupID desc")
|
public List<GroupBean> queryGroupList(@Param("spage")int spage,@Param("epage")int epage);
|
|
//统计所有部门数量
|
@Select("select count(*) from t_b_Group")
|
public int getGroupCount();
|
|
/**
|
* 查询所有部门
|
* @return
|
*/
|
@Select("select * from t_b_Group order by f_GroupID desc")
|
public List<GroupBean> getGroupList();
|
|
/**
|
* 根据部门id查询部门信息
|
* @param id
|
* @return
|
*/
|
@Select("select * from t_b_Group where f_GroupID=#{id}")
|
public GroupBean getGroupById(int id);
|
|
//更新
|
@Update("update t_b_Group set f_GroupName=#{f_GroupName},f_GroupNO=#{f_GroupNO} where f_GroupID=#{f_GroupID}")
|
public int upGroup(GroupBean group);
|
|
//根据部门id删除部门表的信息
|
@Delete("delete from t_b_Group where f_GroupID=#{id}")
|
public int delGroupById(int id);
|
|
// /**
|
// * 添加部门操作记录表的信息
|
// * @param did 部门id
|
// * @param dname 操作人名字
|
// * @param dtype 操作类型
|
// * @return
|
// */
|
// @Insert("insert into tb_dept_opt(d_id,dopt_name,dopt_type,dopt_time) values(#{did},#{dname},#{dtype},getdate())")
|
// public int insertGroupOpt(@Param("did")int did,@Param("dname")String dname,@Param("dtype")String dtype);
|
|
// //根据部门id删除部门操作记录表信息
|
// @Delete("delete from tb_dept_opt where d_id=#{id}")
|
// public int delGroupOpt(int id);
|
|
// /**
|
// * 根据部门id查询部门操作表
|
// * @param id
|
// * @return
|
// */
|
// @Select("select * from tb_dept_opt where d_id=#{id}")
|
// public List<DeptOpt> getOptList(int id);
|
}
|