亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? functiondaoimp.java

?? 權限系統以為業務邏輯提供服務為目標。這個系統的設計目的
?? JAVA
字號:
package com.tairun.component.popedom.dao.daoimp;

import com.tairun.component.popedom.dao.FunctionDAO;
import com.tairun.component.popedom.model.Function;
import com.tairun.component.popedom.util.Primary;
import com.tairun.component.popedom.util.DAORuntimeException;


import javax.sql.DataSource;
import java.util.List;
import java.util.Vector;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.ResultSet;
import java.io.UnsupportedEncodingException;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementSetter;
import org.springframework.jdbc.core.RowCallbackHandler;


/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2005-12-6
 * Time: 9:05:11
 * To change this template use File | Settings | File Templates.
 */
public class FunctionDAOImp implements FunctionDAO {

        DataSource ds;

   public void setDataSource(DataSource ds){
         this.ds=ds;
     }

    public void create(Function function)throws DAORuntimeException{
        final Function fun=function;
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        jt.update("insert into function values(?,?,?,?,?,?,?,?,?)",new PreparedStatementSetter() {
            public void setValues(PreparedStatement ps) throws SQLException {
                ps.setLong(1,fun.getFunction());
                ps.setString(2,fun.getFunctionID());
                ps.setString(3,fun.getFunctionname());
                ps.setString(4,fun.getDiscription());
                ps.setShort(5,Primary.ENABLE);
                ps.setTimestamp(6,new Timestamp(System.currentTimeMillis()));
                ps.setTimestamp(7,new Timestamp(System.currentTimeMillis()));
                ps.setString(8,fun.getWill1());
                ps.setString(9,fun.getWill2());
            }
        });

    }

    public void update(Function function)throws DAORuntimeException{
        final Function fun=function;
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        jt.update("update function set function_name=?,discription=?,updatetime=?,will1=?,will2=? where status="+Primary.ENABLE+" and PK_function="+function.getFunction(),new PreparedStatementSetter() {
            public void setValues(PreparedStatement ps) throws SQLException {

                ps.setString(1,fun.getFunctionname());
                ps.setString(2,fun.getDiscription());
                ps.setTimestamp(3,new Timestamp(System.currentTimeMillis()));
                ps.setString(4,fun.getWill1());
                ps.setString(5,fun.getWill2());

            }
        });

    }

    public void delete(Function function)throws DAORuntimeException{
        final Function fun=function;
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        jt.query("select functionID from function where PK_function="+function.getFunction()+" and status="+Primary.ENABLE,new RowCallbackHandler() {
            public void processRow(ResultSet rs) throws SQLException {
                fun.setFunctionID(rs.getString(1));
            }
        });

        jt.update("update function set status="+Primary.DISABLE+" where functionID like '"+fun.getFunctionID()+"%' and status="+Primary.ENABLE);
        jt.update("update popedom set status="+Primary.DISABLE+" where FK_function like '"+fun.getFunctionID()+"%' and status="+Primary.ENABLE);

    }

    public Function getdetail(long function)throws DAORuntimeException{
        final Function fun=new Function();
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        jt.query("select * from function where status="+Primary.ENABLE+" and PK_function="+function,new RowCallbackHandler() {
            public void processRow(ResultSet rs) throws SQLException {
                   fun.setFunction(rs.getLong("PK_function"));
                   fun.setFunctionID(rs.getString("functionID"));
                   fun.setFunction(rs.getLong("PK_function"));
                    try {
                     fun.setFunctionname(getString(rs,"function_name"));
                     fun.setDiscription(getString(rs,"discription"));
                     } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                 }
                   fun.setCreatetime(rs.getString("createtime"));
                   fun.setUpdatetime(rs.getString("updatetime"));
                   fun.setWill1(rs.getString("will1"));
                   fun.setWill2(rs.getString("will2"));
            }
        });
        
        return fun;
    }

    public List getlist()throws DAORuntimeException{
        final List list=new Vector();
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        jt.query("select * from function where status="+Primary.ENABLE+" order by 0+RPAD(functionID,6,'0') asc",new RowCallbackHandler() {
            public void processRow(ResultSet rs) throws SQLException {
                   Function fun=new Function();
                   fun.setFunction(rs.getLong("PK_function"));
                   fun.setFunctionID(rs.getString("functionID"));
                   fun.setFunction(rs.getLong("PK_function"));
                    try {
                     fun.setFunctionname(getString(rs,"function_name"));
                     fun.setDiscription(getString(rs,"discription"));
                     } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                 }
                   fun.setStatus(rs.getShort("status"));
                   fun.setCreatetime(rs.getString("createtime"));
                   fun.setUpdatetime(rs.getString("updatetime"));
                   fun.setWill1(rs.getString("will1"));
                   fun.setWill2(rs.getString("will2"));
                   list.add(fun);
            }
        });
        return list;
    }

    public List getfunID_list()throws DAORuntimeException{
        final List list=new Vector();
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        jt.query("select PK_function,functionID from function where status="+Primary.ENABLE+" order by 0+RPAD(functionID,6,'0') asc",new RowCallbackHandler() {
            public void processRow(ResultSet rs) throws SQLException {
                Function fun=new Function();
                fun.setFunction(rs.getLong("PK_function"));
                fun.setFunctionID(rs.getString("functionID"));
                list.add(fun);
            }
        });
        return list;

    }

    public List getfirstall_list()throws DAORuntimeException{
        final List list=new Vector();
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        jt.query("select PK_function,functionID,function_name,discription  from function where status="+Primary.ENABLE+" and functionID like '__'",new RowCallbackHandler() {
            public void processRow(ResultSet rs) throws SQLException {
                Function fun=new Function();
                fun.setFunction(rs.getLong("PK_function"));
                fun.setFunctionID(rs.getString("functionID"));
                 try {
                     fun.setFunctionname(getString(rs,"function_name"));
                     fun.setDiscription(getString(rs,"discription"));
                     } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                 }
                list.add(fun);
            }
        });
        return list;
    }

    public List getsecond_list(String functionID)throws DAORuntimeException{
        final List list=new Vector();
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        jt.query("select PK_function,functionID,function_name,discription from function where status="+Primary.ENABLE+" and functionID like '"+functionID+"__'",new RowCallbackHandler() {
                public void processRow(ResultSet rs) throws SQLException {
                Function fun=new Function();
                fun.setFunction(rs.getLong("PK_function"));
                fun.setFunctionID(rs.getString("functionID"));
                 try {
                     fun.setFunctionname(getString(rs,"function_name"));
                     fun.setDiscription(getString(rs,"discription"));
                     } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                 }
                list.add(fun);
                }
            });

        return list;
    }

    public boolean isexist(String functionID,String func_name)throws DAORuntimeException{
        if(functionID!=""){
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        int result=jt.queryForInt("select count(PK_function) from function where function_name='"+func_name+"' and status="+Primary.ENABLE+" and functionID!='"+functionID+"' and functionID like '"+functionID+"__'");
        return result>0;
        }
        else{
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        int result=jt.queryForInt("select count(PK_function) from function where function_name='"+func_name+"' and status="+Primary.ENABLE+" and functionID like '"+functionID+"__'");
        return result>0;
        }
    }


    public String getmaxID(String functionID){
         JdbcTemplate jt=new JdbcTemplate(ds,true);
         final Function fun=new Function();
         jt.query("select  max(functionID) from function where status="+Primary.ENABLE+" and functionID like '"+functionID+"__' or functionID like '"+functionID+"'",new RowCallbackHandler() {
             public void processRow(ResultSet rs) throws SQLException {
                 fun.setFunctionID(rs.getString(1));
             }
         });
        String sb=fun.getFunctionID() ;
         if(sb.length()==functionID.length()+2){
          if(sb.startsWith("0"))
            return "0"+String.valueOf(Integer.parseInt(sb)+1);
          else
            return String.valueOf(Integer.parseInt(sb)+1);
         }
         else
             return functionID+"01";
     }

    public String getmaxID(){
        if(isFunctionEmpty()) {
          JdbcTemplate jt=new JdbcTemplate(ds,true);
          final Function fun=new Function();
          jt.query("select  max(functionID) from function where status='"+Primary.ENABLE+"' and functionID like '__' ",new RowCallbackHandler() {
            public void processRow(ResultSet rs) throws SQLException {
                fun.setFunctionID(rs.getString(1));
            }
        });

         String sb=fun.getFunctionID() ;
       if(sb.startsWith("0"))
          return "0"+String.valueOf(Integer.parseInt(sb)+1);
        else
          return String.valueOf(Integer.parseInt(sb)+1);
        }
        else
          return "01";
      }

    private boolean isFunctionEmpty(){
        JdbcTemplate jt=new JdbcTemplate(ds,true);
         int a= jt.queryForInt("select  count(functionID) from function where status='"+Primary.ENABLE+"' ");
          return a>=1;
    }

    public Function getdetailby_funID(String functionID){
        final Function fun=new Function();
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        jt.query("select * from function where status="+Primary.ENABLE+" and functionID='"+functionID+"'",new RowCallbackHandler() {
            public void processRow(ResultSet rs) throws SQLException {
                   fun.setFunction(rs.getLong("PK_function"));
                   fun.setFunction(rs.getLong("PK_function"));
                   fun.setFunctionID(rs.getString("functionID"));
                try {
                     fun.setFunctionname(getString(rs,"function_name"));
                     fun.setDiscription(getString(rs,"discription"));
                     } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                 }
                   fun.setCreatetime(rs.getString("createtime"));
                   fun.setUpdatetime(rs.getString("updatetime"));
                   fun.setWill1(rs.getString("will1"));
                   fun.setWill2(rs.getString("will2"));

            }
        });

        return fun;

    }
    public boolean isexist_update(String functionID,String func_name)throws DAORuntimeException{
       if(functionID.length()==2){
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        int result=jt.queryForInt("select count(PK_function) from function where function_name='"+func_name+"' and status="+Primary.ENABLE+" and functionID!='"+functionID+"' and functionID like '__'");
        return result>0;
        }
        else{
           String str=functionID.substring(0,functionID.length()-2);
        JdbcTemplate jt=new JdbcTemplate(ds,true);
        int result=jt.queryForInt("select count(PK_function) from function where function_name='"+func_name+"' and status="+Primary.ENABLE+" and functionID!='"+functionID+"' and functionID like '"+str+"__'");
        return result>0;
       }
    }
    private String getString(ResultSet rs,String colName) throws SQLException, UnsupportedEncodingException {
       return  new String((""+ rs.getString(colName)).getBytes(),"8859_1");
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情伊人五月天久久综合| 六月丁香综合在线视频| 青青草97国产精品免费观看| 丰满白嫩尤物一区二区| 欧美午夜理伦三级在线观看| 中文字幕乱码久久午夜不卡| 奇米888四色在线精品| 99久久国产免费看| 国产午夜三级一区二区三| 视频一区二区三区入口| 欧洲精品在线观看| 中文字幕巨乱亚洲| 国产成人欧美日韩在线电影| 日韩亚洲国产中文字幕欧美| 亚洲地区一二三色| 99精品视频在线免费观看| 国产欧美日韩另类一区| 国产一区二三区| 日韩三级中文字幕| 婷婷开心激情综合| 欧美日韩视频一区二区| 亚洲国产另类精品专区| 91国产丝袜在线播放| 亚洲精品中文字幕乱码三区| 99久久99久久久精品齐齐| 欧美激情一区在线| 国产成人精品免费网站| 国产亚洲午夜高清国产拍精品| 久久激情五月激情| 精品久久人人做人人爰| 国产在线一区二区综合免费视频| 日韩欧美视频一区| 久久成人免费网| 精品国产一区二区三区忘忧草| 日韩精品成人一区二区三区| 欧美绝品在线观看成人午夜影视| 亚洲福利视频一区二区| 欧美片在线播放| 日本午夜一本久久久综合| 欧美一区二区三区的| 精品无人区卡一卡二卡三乱码免费卡| 日韩视频在线永久播放| 国产综合色视频| 中文字幕av一区二区三区高| 99r精品视频| 亚洲制服丝袜一区| 91精品国产欧美一区二区| 精品亚洲免费视频| 中文字幕在线不卡一区二区三区 | 国产香蕉久久精品综合网| 国产91色综合久久免费分享| 中文字幕免费不卡| 色婷婷综合久久久久中文 | 日本一区二区高清| 不卡视频一二三| 亚洲综合无码一区二区| 欧美精品久久一区| 国产一区二区日韩精品| 中文字幕一区二区视频| 欧美精品日日鲁夜夜添| 国产麻豆成人传媒免费观看| 亚洲人成网站色在线观看| 欧美日韩久久久一区| 久久er99热精品一区二区| 国产精品国产三级国产aⅴ中文| 欧美日韩一区二区三区高清 | 色婷婷一区二区三区四区| 亚洲超丰满肉感bbw| 久久网站最新地址| 欧美在线视频日韩| 黄一区二区三区| 一区二区国产视频| 久久综合成人精品亚洲另类欧美| 91一区二区在线| 久久电影网电视剧免费观看| 亚洲美女视频在线观看| 欧美α欧美αv大片| 一本色道久久综合亚洲91| 国产一区在线观看麻豆| 天堂久久一区二区三区| 国产精品麻豆视频| 精品少妇一区二区三区视频免付费 | 亚洲一二三四在线观看| 久久久精品日韩欧美| 欧美日韩精品二区第二页| 成人av在线资源| 经典一区二区三区| 一区二区三区视频在线看| 久久久精品人体av艺术| 91精品国产综合久久久久久漫画| 波多野结衣一区二区三区| 狠狠色综合播放一区二区| 性感美女久久精品| 一区二区三区在线视频免费 | 成人h动漫精品一区二区| 麻豆专区一区二区三区四区五区| 亚洲人成亚洲人成在线观看图片 | 久久婷婷综合激情| 欧美一卡2卡三卡4卡5免费| 欧美亚洲尤物久久| 一本大道av伊人久久综合| 成人av在线一区二区三区| 国产黄色精品网站| 精品一区二区久久| 久久精品国产亚洲一区二区三区| 日韩电影免费在线看| 亚洲大型综合色站| 亚洲永久精品大片| 亚洲一区二区三区美女| 伊人性伊人情综合网| 亚洲激情中文1区| 亚洲免费观看高清| 亚洲欧美日韩久久精品| 亚洲裸体xxx| 亚洲精品成人精品456| 亚洲男同1069视频| 亚洲欧美另类图片小说| 一二三区精品福利视频| 亚洲1区2区3区4区| 天天色图综合网| 首页国产丝袜综合| 蜜桃传媒麻豆第一区在线观看| 久久国产精品72免费观看| 国产在线看一区| 国产福利一区二区三区在线视频| 成人污视频在线观看| 99国产欧美另类久久久精品| 色天天综合久久久久综合片| 欧美午夜影院一区| 日韩一区二区免费在线电影| 精品国产91洋老外米糕| 久久精品欧美日韩精品| 国产精品久久一级| 亚洲美女偷拍久久| 丝袜亚洲精品中文字幕一区| 国产一区欧美一区| 91一区一区三区| 欧美一区二区视频网站| 国产色产综合色产在线视频| 亚洲精品伦理在线| 美国精品在线观看| 成人国产精品免费观看视频| 欧美丝袜第三区| 日韩一卡二卡三卡| 一区在线观看视频| 日本一不卡视频| 成人av午夜影院| 欧美日韩一区二区三区不卡 | 一区二区视频在线看| 日韩极品在线观看| 成人综合婷婷国产精品久久免费| 91久久久免费一区二区| 精品国产一区二区三区四区四| 中文字幕一区二区三中文字幕| 舔着乳尖日韩一区| 国产精品原创巨作av| 欧美日韩在线综合| 国产欧美一区二区在线| 日韩专区一卡二卡| 91在线无精精品入口| 欧美大白屁股肥臀xxxxxx| 亚洲日本在线天堂| 精品一区二区三区不卡| 欧美视频在线观看一区二区| 久久久国际精品| 日本视频免费一区| 在线亚洲高清视频| 国产视频一区在线播放| 日本欧美一区二区三区乱码| 91小视频在线观看| 久久久久久久久99精品| 青青草国产精品97视觉盛宴| 色94色欧美sute亚洲13| 国产精品亲子伦对白| 狠狠色综合色综合网络| 欧美一区二区三区白人| 亚洲一区二区综合| 99国内精品久久| 中文成人av在线| 国产九九视频一区二区三区| 日韩精品在线一区| 亚洲专区一二三| 91浏览器入口在线观看| 国产精品久久久一本精品 | 欧美日韩一区二区不卡| 亚洲欧洲日韩一区二区三区| 国产福利不卡视频| 久久久亚洲综合| 国内成人免费视频| 日韩精品一区二区三区视频| 日韩av一区二区三区四区| 欧美另类变人与禽xxxxx| 亚洲午夜一区二区三区| 欧美亚洲国产怡红院影院| 亚洲免费观看高清完整版在线观看熊| 成人免费高清在线观看| 国产日韩精品久久久| 成人妖精视频yjsp地址| 亚洲国产精品精华液2区45| 成人爽a毛片一区二区免费|