jdbc查询
时间:2021-07-01 10:21:17
帮助过:22人阅读
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