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.StaDescBean; @Repository public interface StaDescDao { /** * * @param staDesc * @return */ @Insert("insert into asr_sta_desc(type_no,type_desc,stn_no,stn_desc,crn_no,crn_stn,memo,modi_user,modi_time) " + " values(#{type_no},#{type_desc},#{stn_no},#{stn_desc},#{crn_no},#{crn_stn},#{memo},#{modi_user},getdate())") public int insertStaDesc(StaDescBean staDesc); //更新 @Update("update asr_sta_desc set type_no=#{type_no},type_desc=#{type_desc},stn_desc=#{stn_desc},crn_stn=#{crn_stn}," + " stn_no=#{stn_no},crn_no=#{crn_no},memo=#{memo},modi_user=#{modi_user},modi_time=getdate() " + " where type_id=#{type_id}") public int upStaDesc(StaDescBean staDesc); //根据id删除工作信息 @Delete("delete from asr_sta_desc where type_id=#{type_id}") public int delStaDesc(int type_id); @Select("select top (#{epage}) * from asr_sta_desc where type_id not in " + "(select top (#{spage}) type_id from asr_sta_desc order by type_id asc) order by type_id asc") public List queryStaDescList(@Param("spage")int spage,@Param("epage")int epage); //统计所有数据总数量 @Select("select count(*) from asr_sta_desc") public int getStaDescCount(); /** * 查询所有 * @return */ @Select("select * from asr_sta_desc order by type_no asc") public List getStaDescList(); /** * 根据id查询信息 * @param id * @return */ @Select("select distinct stn_no,stn_desc from asr_sta_desc where type_no=#{type_no}") public List getStaDescByTypeNo(int type_no); @Select("select * from asr_sta_desc where type_id=#{id}") public StaDescBean getStaDescById(int id); @Select("select crn_stn from asr_sta_desc where type_no=#{type_no} and stn_no=#{stn_no} and crn_no=#{crn_no}") public int getStnByTypeStnCrn(StaDescBean staDesc); }