码迷,mamicode.com
首页 > 数据库 > 详细

jdbc查询

时间:2017-10-25 21:39:02      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:new   base   map   class   security   spring   acl   framework   nts   

import java.util.ArrayList;
import java.util.List;

import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository;

import com.yundaex.common.dao.DataGrid;
import com.yundaex.common.dao.QueryCriteria;
import com.yundaex.common.dao.impl.BaseDaoImpl;
import com.yundaex.common.security.annotation.EnableDataSecurity;
import com.yundaex.wms.basicdata.dao.RivWorkingPositionDao;
import com.yundaex.wms.basicdata.po.RivWorkingPosition;


@Repository("workingPositionDao")
public class RivWorkingPositionDaoImpl extends BaseDaoImpl<RivWorkingPosition>
        implements RivWorkingPositionDao {

    //查询简单类型
    @Override
    public int querySomeTypeQtyEnabled(String type) {
        List<Object> params = new ArrayList<Object>();
        params.add(type);
        String sql = "select count(1) from riv_working_position wkp where wkp.WKP_WORKING_P_TYPE = ? and wkp.WKP_IS_ENABLED =1";
        Integer result = this.jdbcTemplate.getJdbcOperations().queryForObject(sql, params.toArray(),Integer.class);
        return result;
    }
//查询复杂类型

      //this.jdbcTemplate.getJdbcOperations().queryForObject(sql, params.toArray(),new BeanPropertyRowMapper<AClass>(AClass.class));


}

 

jdbc查询

标签:new   base   map   class   security   spring   acl   framework   nts   

原文地址:http://www.cnblogs.com/tonggc1668/p/7731725.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!