王佳豪
2021-06-26 718f604deb342b0bee6c588bb44e22ced3371fb8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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.LocStatusBean;
 
@Repository
public interface LocStatusDao {
 
//    /**
//     *根据名称或id验证是否唯一 
//     * @param map
//     * @return
//     */
//    public List<LocStatusBean> getLocStatusByCon(Map<String,Object>map);
    
    /**
     * 添加工作状态
     * @param locStatus
     * @return
     */
    @Insert("insert into asr_bas_loc_type(loc_sts,loc_desc,modi_user,modi_time) values(#{loc_sts},#{loc_desc},#{modi_user},getdate())")
    public int insertLocStatus(LocStatusBean locStatus);
    
    
    //分页查询所有工作状态信息
//    @Select("select * from tb_dept ORDER BY dept_id desc LIMIT #{spage},#{epage}")
    @Select("select top (#{epage}) * from asr_bas_loc_type where loc_sts not in "
            + "(select top (#{spage}) loc_sts from asr_bas_loc_type order by loc_sts asc) order by loc_sts asc")
    public List<LocStatusBean> queryLocStatusList(@Param("spage")int spage,@Param("epage")int epage);
    
    //统计所有数据总数量
    @Select("select count(*) from asr_bas_loc_type")
    public int getLocStatusCount();
    
    /**
     * 查询所有
     * @return
     */
    @Select("select * from asr_bas_loc_type order by loc_sts asc")
    public List<LocStatusBean> getLocStatusList();
    
    /**
     * 根据id查询信息
     * @param id
     * @return
     */
    @Select("select * from asr_bas_loc_type where loc_sts=#{locSts}")
    public LocStatusBean getLocStatusById(String locSts);
    
    //更新
    @Update("update asr_bas_loc_type set loc_desc=#{loc_desc},modi_user=#{modi_user},modi_time=getdate() where loc_sts=#{loc_sts}")
    public int upLocStatus(LocStatusBean locStatus);
    
    //根据id删除工作信息
    @Delete("delete from asr_bas_loc_type where loc_sts=#{locSts}")
    public int delLocStatusById(String locSts);
    
}