package com.slcf.dao;
|
|
import java.util.List;
|
|
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.CrnBean;
|
|
@Repository
|
public interface CrnDao {
|
|
/**
|
* 添加
|
* @param crn
|
* @return
|
*/
|
@Insert("insert into asr_bas_crnp(crn_no,in_enable,out_enable,modi_user,modi_time) "
|
+ " values(#{crn_no},#{in_enable},#{out_enable},#{modi_user},getdate())")
|
public int insertCrn(CrnBean crn);
|
|
|
//分页查询所有信息
|
// @Select("select * from tb_dept ORDER BY dept_id desc LIMIT #{spage},#{epage}")
|
@Select("select top (#{epage}) * from asr_bas_crnp where crn_no not in "
|
+ " (select top (#{spage}) crn_no from asr_bas_crnp order by crn_no asc) order by crn_no asc")
|
public List<CrnBean> queryCrnList(@Param("spage")int spage,@Param("epage")int epage);
|
|
//统计所有数据总数量
|
@Select("select count(*) from asr_bas_crnp")
|
public int getCrnCount();
|
|
/**
|
* 查询所有
|
* @return
|
*/
|
@Select("select * from asr_bas_crnp order by crn_no asc")
|
public List<CrnBean> getCrnList();
|
|
/**
|
* 根据id查询信息
|
* @param id
|
* @return
|
*/
|
@Select("select * from asr_bas_crnp where crn_no=#{id}")
|
public CrnBean getCrnById(int id);
|
|
//更新
|
@Update("update asr_bas_crnp set in_enable=#{in_enable},out_enable=#{out_enable},"
|
+ " modi_user=#{modi_user},modi_time=getdate() "
|
+ " where crn_no=#{crn_no}")
|
public int upCrn(CrnBean Crn);
|
|
//根据id删除工作信息
|
@Delete("delete from asr_bas_crnp where crn_no=#{id}")
|
public int delCrnById(int id);
|
|
}
|