| | |
| | | private Integer type; |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | return type == null?0:type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | |
| | | public List<SysReagent> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) { |
| | | List<SysReagent> list = null; |
| | | try { |
| | | int count = sysReagentService.getSysReagentTotalCount(name, cas, supplierId,type); |
| | | int count = sysReagentService.getSysReagentTotalCountNew(name, cas, supplierId,getType()); |
| | | this.setRowCount(count); |
| | | if (count > 0) { |
| | | list = sysReagentService.getSysReagentList(name, cas, supplierId,type, first, pageSize); |
| | | list = sysReagentService.getSysReagentListNew(name, cas, supplierId,getType(), first, pageSize); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error(e); |
| | |
| | | public SysReagent getSysReagentByCas(SysReagent sysReagent) throws DataAccessException; |
| | | public SysReagent getSysReagentByCas2(SysReagent sysReagent) throws DataAccessException; |
| | | public List<SysReagent> getSysReagentList(Map params) throws DataAccessException; |
| | | public List<SysReagent> getSysReagentListNew(Map params) throws DataAccessException; |
| | | public int getSysReagentTotalCount(Map params) throws DataAccessException; |
| | | public int getSysReagentTotalCountNew(Map params) throws DataAccessException; |
| | | |
| | | public void insertSysReagent(SysReagent sysReagent) throws DataAccessException; |
| | | public int updateSysReagent(SysReagent sysReagent) throws DataAccessException; |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="getSysReagentListNew" parameterType="java.util.Map" resultMap="SysReagent"> |
| | | select sr.*, ss.meta_value as product_home_name, ifnull(w.reserve,0) as reserve, bm.meta_value as control_products_name,supplier.name as supplierName |
| | | from sys_reagent as sr |
| | | |
| | | left join base_meta as ss on sr.product_home = ss.id |
| | | left join base_meta bm on bm.id = sr.control_products |
| | | left join (select reagent_id, sum(reserve) reserve from ope_warehouse_reserve where valid_flag = 1 group by reagent_id) w on w.reagent_id = sr.id |
| | | |
| | | left join sys_supplier supplier on supplier.id = sr.supplier_id |
| | | where sr.valid_flag = 1 |
| | | <if test="cas != null and cas != ''"> |
| | | and sr.cas = #{cas} |
| | | </if> |
| | | <if test="supplierId != null and supplierId != ''"> |
| | | and sr.supplier_id = #{supplierId} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and sr.name like concat("%", #{name} ,"%") |
| | | </if> |
| | | <if test="type != null and type != ''"> |
| | | and sr.type = #{type} |
| | | </if> |
| | | ORDER BY sr.create_time desc |
| | | <if test="first != null and pageSize != null"> |
| | | limit #{first}, #{pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getSysReagentTotalCount" parameterType="java.util.Map" resultType="int"> |
| | | select count(1) |
| | | from sys_reagent as sr |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getSysReagentTotalCountNew" parameterType="java.util.Map" resultType="int"> |
| | | select count(1) |
| | | from sys_reagent as sr |
| | | where sr.valid_flag = 1 |
| | | <if test="cas != null and cas != ''"> |
| | | and sr.cas = #{cas} |
| | | </if> |
| | | <if test="supplierId != null and supplierId != ''"> |
| | | and sr.supplier_id = #{supplierId} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and sr.name like concat("%", #{name} ,"%") |
| | | </if> |
| | | <if test="type != null and type != ''"> |
| | | and sr.type = #{type} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="getSysReagentByCas2" parameterType="com.nanometer.smartlab.entity.SysReagent" resultMap="SysReagent"> |
| | | select * From sys_reagent where type=0 and valid_flag = 1 |
| | | <if test="cas!=null and cas!=''"> |
| | |
| | | public List<SysReagent> getSysReagentList2(SysUser user,Integer favorFlag, String name, String cas, String productSn, String supplierId, Integer first, Integer pageSize); |
| | | public int getSysReagentTotalCount2(SysUser user,Integer favorFlag,String name, String cas,String productSn, String supplierId); |
| | | |
| | | int getSysReagentTotalCountNew(String name, String cas, String supplierId, Integer type); |
| | | public List<SysReagent> query(); |
| | | |
| | | Map getReagentDetail(String id); |
| | | |
| | | public List<SysReagent> getSysReagentListNew(String name, String cas, String supplierId, Integer type, Integer first, Integer pageSize); |
| | | } |
| | |
| | | throw new BusinessException(ExceptionEnumCode.DB_ERR, MessageUtil.getMessageByCode(ExceptionEnumCode.DB_ERR.getCode()), e); |
| | | } |
| | | } |
| | | |
| | | public List<SysReagent> getSysReagentListNew(String name, String cas, String supplierId,Integer type, Integer first, Integer pageSize) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("name", name); |
| | | params.put("cas", cas); |
| | | params.put("supplierId", supplierId); |
| | | params.put("type", type); |
| | | params.put("first", first); |
| | | params.put("pageSize", pageSize); |
| | | return this.sysReagentDao.getSysReagentListNew(params); |
| | | } catch (DataAccessException e) { |
| | | logger.error(e.getMessage(), e); |
| | | throw new BusinessException(ExceptionEnumCode.DB_ERR, MessageUtil.getMessageByCode(ExceptionEnumCode.DB_ERR.getCode()), e); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public int getSysReagentTotalCount(String name, String cas, String supplierId,Integer type) { |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public int getSysReagentTotalCountNew(String name, String cas, String supplierId,Integer type) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("name", name); |
| | | params.put("cas", cas); |
| | | params.put("type", type); |
| | | params.put("supplierId", supplierId); |
| | | return this.sysReagentDao.getSysReagentTotalCountNew(params); |
| | | } catch (DataAccessException e) { |
| | | logger.error(e.getMessage(), e); |
| | | throw new BusinessException(ExceptionEnumCode.DB_ERR, MessageUtil.getMessageByCode(ExceptionEnumCode.DB_ERR.getCode()), e); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public List<SysReagent> getSysReagentList2(SysUser user,Integer favorFlag, String name, String cas, String productSn, String supplierId, Integer first, Integer pageSize) { |
| | | try { |
| | |
| | | </p:selectOneMenu> |
| | | <p:outputLabel value="种类:"></p:outputLabel> |
| | | <p:selectOneMenu value="#{reagentMngController.type}"> |
| | | <f:selectItem itemLabel="全部" itemValue="#{null}" noSelectionOption="true"></f:selectItem> |
| | | <f:selectItems value="#{reagentMngController.typeList}" var="item" |
| | | itemLabel="#{item.text}" itemValue="#{item.key}"></f:selectItems> |
| | | </p:selectOneMenu> |