什么叫做供货商药品目录t添加查询功能?就是说我们前面的博客里面不是说供货商登录后看到了自己供应的药品了么如下:

033医疗项目-模块三:药品供应商目录模块——供货商药品目录t添加查询功能----------Dao层和Service层和Action层和调试

现在供货商想要往里面添加别的药品,那么这个药品的来源就是卫生局提供的那个Ypxx表(药品总表),我们要显示的就是ypxx表减去我之前添加到。就是我可以添加的药品数据。

如下:

033医疗项目-模块三:药品供应商目录模块——供货商药品目录t添加查询功能----------Dao层和Service层和Action层和调试

我单击“供应药品添加”来到下面的页面:

033医疗项目-模块三:药品供应商目录模块——供货商药品目录t添加查询功能----------Dao层和Service层和Action层和调试

这个页面的里面的药品就是我可以添加的。之前的已经存在的药品比如流水号“200211”的药品在这里是找不到的。

 

上面就是我们要实现的功能。

 

下面从Dao层开始给出具体的代码:
先给出SQL语句:

Sql:
主查询表:ypxx表

关联查询表:在where条件 中,过虑掉供货商药品目录 表的记录

select ypxx.id,
       ypxx.bm,
       ypxx.mc,
       ypxx.jx,
       ypxx.gg,
       ypxx.zhxs,
       ypxx.scqymc,
       ypxx.spmc,
       ypxx.zbjg,
       ypxx.jyzt,
       
      
 from ypxx
 --查询子查询不为空的值
 where not exists(select id from gysypml where usergysid='5197cdd2-08cf-11e3-8a4f-60a44cea4388' and ypxx.id = gysypml.ypxxid)

 

这个语句查出来的是5197cdd2-08cf-11e3-8a4f-60a44cea4388这个供应商还可以添加的药品。

 

我们的Mapper接口还是卸载上一篇文章里面的GysypmlMapperCustom.xml:

 

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="yycg.business.dao.mapper.GysypmlMapperCustom" >




<!-- 供货商药品目录查询条件 -->
<sql id="query_gysympl_where">
 <if test="gysypmlCustom!=null">
         
          <if test="gysypmlCustom.usergysid!=null and gysypmlCustom.usergysid!=''">
                and gysypml.usergysid = #{gysypmlCustom.usergysid}
            </if>
            <if test="gysypmlCustom.ypxxid!=null and gysypmlCustom.ypxxid!=''">
                and gysypml.ypxxid = #{gysypmlCustom.ypxxid}
            </if>   
           
</if>
 </sql>
 
 
 <!-- 供货商目录控制查询条件 -->
    <sql id="query_gysypmlcontrol_where">
        <if test="gysypmlCustom!=null">
            <if test="gysypmlCustom.control!=null and gysypmlCustom.control!=''">
                and gysypml_control.control = #{gysypmlCustom.control}
            </if>
            <if test="gysypmlCustom.usergysid!=null and gysypmlCustom.usergysid!=''">
                and gysypml_control.usergysid = #{gysypmlCustom.usergysid}
            </if>
            <if test="gysypmlCustom.ypxxid!=null and gysypmlCustom.ypxxid!=''">
                and gysypml_control.ypxxid = #{gysypmlCustom.ypxxid}
            </if>
        </if>

    </sql>
    

 
 
 
 
 
 
 
  <!-- 供应商药品目录添加查询 -->
 <select id="findAddGysypmlList" parameterType="yycg.business.pojo.vo.GysypmlQueryVo" resultType="yycg.business.pojo.vo.GysypmlCustom">
<if test="pageQuery!=null">
            select page_2.*
            from (select page_1.*, rownum page_num
            from
            (
        </if>
select ypxx.id,
       ypxx.bm,
       ypxx.mc,
       ypxx.jx,
       ypxx.gg,
       ypxx.zhxs,
       ypxx.scqymc,
       ypxx.spmc,
       ypxx.zbjg,
       ypxx.jyzt,
       
       (select info
          from dictinfo
         where ypxx.jyzt = dictcode
           and typecode = '003') jyztmc
 from ypxx
 where not exists(select id from gysypml where usergysid=#{gysypmlCustom.usergysid} and ypxx.id = gysypml.ypxxid)
   <!-- 药品查询条件 -->
            <include refid="yycg.business.dao.mapper.YpxxMapperCustom.query_ypxx_where" />
        <!-- 分页尾 -->
        <if test="pageQuery!=null">
            ) page_1
        <![CDATA[
         where rownum <= ${pageQuery.PageQuery_end}) page_2
 where page_2.page_num >= ${pageQuery.PageQuery_start}
 ]]>
        </if>  
 </select>
 
 
 
 
 <!-- 供应商药品目录添加总数查询 (用来分页的)-->
 <select id="findAddGysypmlCount" parameterType="yycg.business.pojo.vo.GysypmlQueryVo" resultType="int">

select count(*)
       
     
 from ypxx
 where not exists(select id from gysypml where usergysid=#{gysypmlCustom.usergysid} and ypxx.id = gysypml.ypxxid)
   <!-- 药品查询条件 -->
            <include refid="yycg.business.dao.mapper.YpxxMapperCustom.query_ypxx_where" />
        
 </select>
 
 
 
 
 
 

</mapper>

 

 

 

我们再来写Mapper接口文件:

 

package yycg.business.dao.mapper;

import java.util.List;

import yycg.business.pojo.vo.GysypmlCustom;
import yycg.business.pojo.vo.GysypmlQueryVo;

public interface GysypmlMapperCustom {
    /* public List<GysypmlCustom> findGysymplList(GysypmlQueryVo gysypmlQueryVo) throws Exception;
    
     public int findGysypmlCount(GysypmlQueryVo gysypmlQueryVo)throws Exception;*/这两个函数是上一篇文章的内容,这里不做解释了。直接忽略
     
      <!-- 供应商药品目录添加查询 -->
     public List<GysypmlCustom> findAddGysypmlList(GysypmlQueryVo gysypmlQueryVo)throws Exception;
     
<!-- 供应商药品目录添加总数查询 (用来分页的)--> public int findAddGysypmlCount(GysypmlQueryVo gysypmlQueryVo) throws Exception; }

 

 

 

然后我们写Serivice层接口:

package yycg.business.service;

import java.util.List;

import yycg.business.pojo.vo.GysypmlCustom;
import yycg.business.pojo.vo.GysypmlQueryVo;

public interface GysymplService {
    
/*
public List<GysypmlCustom> findGysymplList(String usergysId ,GysypmlQueryVo gysymplQueryVo) throws Exception; public int findGysypmlCount(String usergysId,GysypmlQueryVo gysymplQueryVo)throws Exception;*/这两个函数是上一篇文章的内容,这里不做解释了。直接忽略


//药品添加目录查询 public List<GysypmlCustom> findAddGysypmlList(String usergysId,GysypmlQueryVo gysypmlQueryVo)throws Exception; //药品添加数量查询 public int findAddGysypmlCount(String usergysId,GysypmlQueryVo gysypmlQueryVo) throws Exception; }

然后写接口实现类:

package yycg.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import yycg.business.dao.mapper.GysypmlMapperCustom;
import yycg.business.pojo.vo.GysypmlCustom;
import yycg.business.pojo.vo.GysypmlQueryVo;
import yycg.business.service.GysymplService;

public class GysemplServiceImpl implements GysymplService {

    @Autowired
    GysypmlMapperCustom gysymplMapperCustom;

    /*@Override
    public List<GysypmlCustom> findGysymplList(String usergysId,
            GysypmlQueryVo gysymplQueryVo) throws Exception {
        // 为了防止bug.这里做一个非空校验,如果传进来不是空,那么就直接把传进来那个赋值给他,如果传进来就是空的
        // 那么就新建一个
        gysymplQueryVo = gysymplQueryVo != null ? gysymplQueryVo
                : new GysypmlQueryVo();
        *//**
         * 为什么这里要再得到一个?因为可能在页面上已经传进来一个gysymplCustom. 所以要判断传进来那个是不是空的。
         * 
         * 
         *//*
        GysypmlCustom gysymplCustom = gysymplQueryVo.getGysymplCustom();
        if (gysymplCustom == null)// 如果是空的,那就new一个。反正我们的目的就是把usergysId的值设置进去。
        {
            gysymplCustom = new GysypmlCustom();

        }
        // 设置数据范围权限
        gysymplCustom.setId(usergysId);

        List<GysypmlCustom> listgyGysymplCustoms = gysymplMapperCustom
                .findGysymplList(gysymplQueryVo);
        return listgyGysymplCustoms;
    }

    @Override
    public int findGysypmlCount(String usergysId, GysypmlQueryVo gysymplQueryVo)
            throws Exception {

        // 为了防止bug.这里做一个非空校验,如果传进来不是空,那么就直接把传进来那个赋值给他,如果传进来就是空的
        // 那么就新建一个
        gysymplQueryVo = gysymplQueryVo != null ? gysymplQueryVo
                : new GysypmlQueryVo();
        *//**
         * 为什么这里要再得到一个?因为可能在页面上已经传进来一个gysymplCustom. 所以要判断传进来那个是不是空的。
         * 
         * 
         *//*
        GysypmlCustom gysymplCustom = gysymplQueryVo.getGysymplCustom();
        if (gysymplCustom == null)// 如果是空的,那就new一个。反正我们的目的就是把usergysId的值设置进去。
        {
            gysymplCustom = new GysypmlCustom();

        }

        // 设置数据范围权限
        gysymplCustom.setUsergysid(usergysId);
        gysymplQueryVo.setGysymplCustom(gysymplCustom);
        int count = gysymplMapperCustom.findGysypmlCount(gysymplQueryVo);
        return count;
    }
*/上面这两个函数都不是这次内容的重点,所以忽视。
    @Override
    public List<GysypmlCustom> findAddGysypmlList(String usergysId,
            GysypmlQueryVo gysypmlQueryVo) throws Exception {

        // 为了防止bug.这里做一个非空校验,如果传进来不是空,那么就直接把传进来那个赋值给他,如果传进来就是空的
        // 那么就新建一个
        gysypmlQueryVo = gysypmlQueryVo != null ? gysypmlQueryVo
                : new GysypmlQueryVo();
        /**
         * 为什么这里要再得到一个?因为可能在页面上已经传进来一个gysymplCustom. 所以要判断传进来那个是不是空的。
         * 
         * 
         */
        GysypmlCustom gysymplCustom = gysypmlQueryVo.getGysymplCustom();
        if (gysymplCustom == null)// 如果是空的,那就new一个。反正我们的目的就是把usergysId的值设置进去。
        {
            gysymplCustom = new GysypmlCustom();

        }

        gysymplCustom.setUsergysid(usergysId);
        gysypmlQueryVo.setGysymplCustom(gysymplCustom);

        List<GysypmlCustom> listsCustoms = gysymplMapperCustom
                .findAddGysypmlList(gysypmlQueryVo);
        return listsCustoms;
    }

    @Override
    public int findAddGysypmlCount(String usergysId,
            GysypmlQueryVo gysypmlQueryVo) throws Exception {

        // 为了防止bug.这里做一个非空校验,如果传进来不是空,那么就直接把传进来那个赋值给他,如果传进来就是空的
        // 那么就新建一个
        gysypmlQueryVo = gysypmlQueryVo != null ? gysypmlQueryVo
                : new GysypmlQueryVo();
        /**
         * 为什么这里要再得到一个?因为可能在页面上已经传进来一个gysymplCustom. 所以要判断传进来那个是不是空的。
         * 
         * 
         */
        GysypmlCustom gysymplCustom = gysypmlQueryVo.getGysymplCustom();
        if (gysymplCustom == null)// 如果是空的,那就new一个。反正我们的目的就是把usergysId的值设置进去。
        {
            gysymplCustom = new GysypmlCustom();
            
        }

        gysymplCustom.setUsergysid(usergysId);
        gysypmlQueryVo.setGysymplCustom(gysymplCustom);
        int listsCount = gysymplMapperCustom.findAddGysypmlCount(gysypmlQueryVo);

        return listsCount;
    }

}

 

我们最后看Action层:

package yycg.business.action;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import yycg.base.pojo.po.Dictinfo;
import yycg.base.pojo.vo.ActiveUser;
import yycg.base.pojo.vo.PageQuery;
import yycg.base.process.context.Config;
import yycg.base.process.result.DataGridResultInfo;
import yycg.base.service.SystemConfigService;
import yycg.business.pojo.vo.GysypmlCustom;
import yycg.business.pojo.vo.GysypmlQueryVo;
import yycg.business.service.GysymplService;
@Controller
@RequestMapping("/ypml")
public class GysymplAction {
    
    @Autowired
    SystemConfigService systemConfigService;
    @Autowired
  GysymplService gysymplService;
    //去往查询页面
/*    @RequestMapping("/querygysypml")
    public String querygysypml( Model model) throws Exception
    {
        //药品类别,查出来之后在页面传动到querygysypml.jsp页面进行显示
        List<Dictinfo> yplblist=systemConfigService.findDictinfoByType("001");
        model.addAttribute("yplblist", yplblist);
        
        List<Dictinfo> jyztlist=systemConfigService.findDictinfoByType("003");
        model.addAttribute("jyztlist", jyztlist);
        
        
        List<Dictinfo> zlcclist=systemConfigService.findDictinfoByType("004");
        model.addAttribute("zlcclist", zlcclist);
        
        List<Dictinfo> controllist=systemConfigService.findDictinfoByType("008");
        model.addAttribute("controllist", controllist);
        return "/business/ypml/querygysypml";
    }
    
    
    //查询结果集
    @RequestMapping("/querygysympl_request")
    public @ResponseBody DataGridResultInfo querygysympl_request(HttpSession session,GysypmlQueryVo gysypmlQueryVo,int page,int rows) throws Exception
    {
        //当前用户信息去  Session中去拿。
        ActiveUser activeUser=(ActiveUser)session.getAttribute(Config.ACTIVEUSER_KEY);
        
        *//**
         * 刚开始的时候想不通,为什么传的是用户所属的单位id,潜意识里想不是应该传的是用户的id吗,
         * 后来想想不是啊,怎么可能是用户的id,因为是供应商这么一个大的慨念在提供货物,是以供应商为单位的,
         * 所以应该是供应商啊,有很多个供应商在供应药品,所以是供应商的id.
         * 
         *//*
        //用户所属的单位
        String usergysid=activeUser.getSysid();//单位id
        //列的总数
        int total=gysymplService.findGysypmlCount(usergysid, gysypmlQueryVo);
        //列表
        PageQuery pageQuery=new PageQuery();
        pageQuery.setPageParams(total, rows, page);
        //设置分页参数
        gysypmlQueryVo.setPageQuery(pageQuery);
        //分页查询列表
        List<GysypmlCustom> list=gysymplService.findGysymplList(usergysid, gysypmlQueryVo);
        DataGridResultInfo dataGridResultInfo=new DataGridResultInfo();
        dataGridResultInfo.setTotal(total);
        dataGridResultInfo.setRows(list);
        
        return dataGridResultInfo;
        
        
    }
    */上面这两个函数都不是这次内容的重点,所以忽视。
    
    
    @RequestMapping("/querygysypmladd")//转达页面
    public String queryaddgysypml( Model model) throws Exception
    {
        
        //药品类别,查出来之后在页面传动到querygysypml.jsp页面进行显示
        List<Dictinfo> yplblist=systemConfigService.findDictinfoByType("001");
        model.addAttribute("yplblist", yplblist);
        
        List<Dictinfo> jyztlist=systemConfigService.findDictinfoByType("003");
        model.addAttribute("jyztlist", jyztlist);
        
        
        List<Dictinfo> zlcclist=systemConfigService.findDictinfoByType("004");
        model.addAttribute("zlcclist", zlcclist);
        
        List<Dictinfo> controllist=systemConfigService.findDictinfoByType("008");
        model.addAttribute("controllist", controllist);
        return "/business/ypml/querygysypmladd";
        
        
        
    }
    
    
    
    @RequestMapping("/querygysypmladd_result")//查询
    public @ResponseBody DataGridResultInfo queryaddgysympl_request(HttpSession session,GysypmlQueryVo gysypmlQueryVo,int page,int rows) throws Exception
    {
        //当前用户信息去  Session中去拿。
                ActiveUser activeUser=(ActiveUser)session.getAttribute(Config.ACTIVEUSER_KEY);
                
                /**
                 * 刚开始的时候想不通,为什么传的是用户所属的单位id,潜意识里想不是应该传的是用户的id吗,
                 * 后来想想不是啊,怎么可能是用户的id,因为是供应商这么一个大的慨念在提供货物,是以供应商为单位的,
                 * 所以应该是供应商啊,有很多个供应商在供应药品,所以是供应商的id.
                 * 
                 */
                //用户所属的单位
                String usergysid=activeUser.getSysid();//单位id
                //列的总数
                int total=gysymplService.findAddGysypmlCount(usergysid, gysypmlQueryVo);
                //列表
                PageQuery pageQuery=new PageQuery();
                pageQuery.setPageParams(total, rows, page);
                //设置分页参数
                gysypmlQueryVo.setPageQuery(pageQuery);
                //分页查询列表
                List<GysypmlCustom> list=gysymplService.findAddGysypmlList(usergysid, gysypmlQueryVo);
                DataGridResultInfo dataGridResultInfo=new DataGridResultInfo();
                dataGridResultInfo.setTotal(total);
                dataGridResultInfo.setRows(list);
                
                return dataGridResultInfo;
    }
}

 

最后给出页面:querygyspmladd.jsp:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/base/tag.jsp"%>
<html> 
<head>
<title>供货商药品目录添加查询</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<%@ include file="/WEB-INF/jsp/base/common_css.jsp"%>
<%@ include file="/WEB-INF/jsp/base/common_js.jsp"%>

<script type="text/javascript">

 var gysypmladd = function(){
    //_confirm询问是否继续操作?
    _confirm('您确定要將选择药品添加至药品目录吗?',null,
    //执行添加函数
      function(){
        //定义一个数组,准备存放选中行的序号
        var indexs=[];
        //获取数据列表中所有选中的行(数组)
        var rows = dataGrid_obj.datagrid('getSelections');
        //便利所有选中的行
        for(var i=0;i<rows.length;i++){
            
            //alert(dataGrid_obj.datagrid('getRowIndex',rows[i]));
            //将返回的选中行的序号加到indexs数组中
            var index = dataGrid_obj.datagrid('getRowIndex',rows[i]);//选中行的下标
            //将选中行的序号设置到数组indexs中
            indexs.push(index);
            //alert(dataGrid_obj.datagrid('getRowIndex',rows[i]));
        }
        //判断如果存在选中的行,indexs数组里边有选中行的序号
        if(rows.length>0){//如果存在选中的行则将indexs数组中的序号格式化为逗号分隔的并赋给indexs控件
            
            $("#indexs").val(indexs.join(","));//将indexs数组的元素在中间加逗号拼接成一个字符串
            //提交form,提交数据包括药品信息id(每条记录都 有),indexs(hidden)
            jquerySubByFId('gysypmladdqueryForm',gysypmladd_callback, null);
        }else{
            //如果没有选中行则提示
            alert_warn("请选择要添加的药品");
        }
        
      } 
      
    )
    
    
    
}; 



function gysypmladd_callback(data) {
    //message_alert(data);
    //改为可以提示错误信息明细
    var result = getCallbackData(data);
    _alert(result);//输出信息
    
    /*
    //刷新页面重新查询
    gysypmladdquery();
    
    //添加刷新父窗口代码
    parent.gysypmlquery(); */
}


//工具栏

var toolbar = [ {
    id : 'gysypmladd',
    text : '确认添加',
    iconCls : 'icon-add',
    handler : gysypmladd
    }];

var frozenColumns;

var columns = [ [{
    field : 'check',
    title : '选择',
    checkbox : true//显示成checkbox
},{
    field : 'id',
    hidden:true,
    formatter:function(value, row, index){//index是每行的序号,gysypmlControls是action中接收的list集合对象名称,ypxxid是list中对象的属性名
        return '<input type="hidden" name="gysypmlControls['+index+'].ypxxid" value="'+value+'" />';
    }
},{
    field : 'bm',
    title : '流水号',
    width : 80
},{
    field : 'mc',
    title : '通用名',
    width : 130
},{
    field : 'jx',
    title : '剂型',
    width : 80
},{
    field : 'gg',
    title : '规格',
    width : 100
},{
    field : 'zhxs',
    title : '转换系数',
    width : 50
},{
    field : 'scqymc',
    title : '生产企业',
    width : 180
},{
    field : 'spmc',
    title : '商品名称',
    width : 150
},{
    field : 'zbjg',
    title : '中标价',
    width : 50
},{
    field : 'jyztmc',
    title : '交易状态',
    width : 60
}
]];

var dataGrid_obj;//datagrid的对象


    $(function() {
        dataGrid_obj = $('#gysypmladdlist');
        
        dataGrid_obj.datagrid({
            title : '供应药品列表',
            //nowrap : false,
            striped : true,
            //collapsible : true,
            url : '${baseurl}ypml/querygysypmladd_result.action',
            //sortName : 'code',
            //sortOrder : 'desc',
            //remoteSort : false,
            idField : 'id',//结果集主键,设置错误影响获取选中行的操作,比如getSelections执行
            //frozenColumns : frozenColumns,
            columns : columns,
            pagination : true,
            rownumbers : true,
            toolbar : toolbar,
            loadMsg:"",
            pageList:[15,30,50,100],
            //点击行时取消选中行,因为jqueryeasyui在点击行的时候默认选中行
             onClickRow : function(index, field, value) {
                dataGrid_obj.datagrid('unselectRow', index);
            }, 
            //当加载成功时:清除所有选中的行,解决分页数据传到action为-1问题
            onLoadSuccess:function(){
                dataGrid_obj.datagrid('clearSelections');
            } 
            });
        
    });

    function gysypmladdquery() {
 
        var formdata = $("#gysypmladdqueryForm").serializeJson();
        //alert(formdata);
        //取消所有选中的 行
        dataGrid_obj.datagrid('unselectAll'); 
        dataGrid_obj.datagrid('load', formdata);
    }
</script>
</HEAD>
<BODY>
<div id="ypxxquery_div">
    <form id="gysypmladdqueryForm" name="gysypmladdqueryForm" action="${baseurl}ypml/addgysypmlsubmit.action" method="post">
            <!-- indexs中存储就是选中的行的序号中间以逗号分隔 -->
            <input type="hidden" name="indexs" id="indexs" />
            <TABLE  class="table_search">
                <TBODY>
                    <TR>
                        
                        <TD class="left">通用名:</td>
                        <td><INPUT type="text"  name="ypxxCustom.mc" /></TD>
                        <TD class="left">剂型:</TD>
                        <td ><INPUT type="text" name="ypxxCustom.jx" /></td>
                        <TD class="left">规格:</TD>
                        <td ><INPUT type="text" name="ypxxCustom.gg" /></td>
                        <TD class="left">转换系数:</TD>
                        <td ><INPUT type="text" name="ypxxCustom.zhxs" /></td>
                    </TR>
                    <TR>
                        <TD class="left">流水号:</TD>
                        <td ><INPUT type="text" name="ypxxCustom.bm" /></td>
                        <TD class="left">生产企业:</TD>
                        <td ><INPUT type="text" name="ypxxCustom.scqymc" /></td>
                        <TD class="left">商品名称:</TD>
                        <td ><INPUT type="text" name="ypxxCustom.spmc" /></td>
                         <td class="left">价格范围:</td>
                          <td>
                              <INPUT id="ypxxCustom.zbjglower" name="ypxxCustom.zbjglower" style="width:70px"/><INPUT id="ypxxCustom.zbjgupper" name="ypxxCustom.zbjgupper" style="width:70px"/>
                            
                          </td>
                    </tr>
                    <tr>
                      
                        <TD class="left">药品类别:</TD>
                        <td >
                            <select id="ypxxCustom.lb" name="ypxxCustom.lb" style="width:150px">
                                <option value="">全部</option>
                                <c:forEach items="${yplblist}" var="value">
                                    <option value="${value.id}">${value.info}</option>
                                </c:forEach>
                            </select>
                        </td>
                        <TD class="left">交易状态:</TD>
                        <td >
                            <select id="ypxxCustom.jyzt" name="ypxxCustom.jyzt" style="width:150px">
                                <option value="">全部</option>
                                <c:forEach items="${jyztlist}" var="value">
                                    <option value="${value.dictcode}">${value.info}</option>
                                </c:forEach>
                            </select>
                            
                        </td>
                        
                          <td class="left" height="25">质量层次:</td>
                          <td>
                          <select id="ypxxCustom.zlcc" name="ypxxCustom.zlcc" style="width:150px">
                                <option value="">全部</option>
                                <c:forEach items="${zlcclist}" var="value">
                                    <option value="${value.id}">${value.info}</option>
                                </c:forEach>
                        </select>
                    
                          </td>
                          <td colspan=2>
                        <a id="btn" href="#" onclick="gysypmladdquery()" class="easyui-linkbutton" iconCls='icon-search'>查询</a>
                          </td>
                        
                    </TR>
                    
                </TBODY>
            </TABLE>
        
        <TABLE border=0 cellSpacing=0 cellPadding=0 width="99%" align=center>
            <TBODY>
                <TR>
                    <TD>
                        <table id="gysypmladdlist"></table>
                    </TD>
                </TR>
            </TBODY>
        </TABLE>
        </form>
    </div>

</BODY>
</HTML>

 

到这里就好了。

对了最后说一下:

033医疗项目-模块三:药品供应商目录模块——供货商药品目录t添加查询功能----------Dao层和Service层和Action层和调试

 

 这个下拉列表怎么来的?

我们看Action 层中的

 

    public String queryaddgysypml( Model model) throws Exception
    {
        
        //药品类别,查出来之后在页面传动到querygysypml.jsp页面进行显示
        List<Dictinfo> yplblist=systemConfigService.findDictinfoByType("001");
        model.addAttribute("yplblist", yplblist);
        
        List<Dictinfo> jyztlist=systemConfigService.findDictinfoByType("003");
        model.addAttribute("jyztlist", jyztlist);
        
        
        List<Dictinfo> zlcclist=systemConfigService.findDictinfoByType("004");
        model.addAttribute("zlcclist", zlcclist);
        
        List<Dictinfo> controllist=systemConfigService.findDictinfoByType("008");
        model.addAttribute("controllist", controllist);
        return "/business/ypml/querygysypmladd";
        
        
        
    }
 List<Dictinfo> zlcclist=systemConfigService.findDictinfoByType("004");就是从数据字典里面把数据取出来,然后通过Mode传送到页面,然后页面再遍历。就可以了。

 

 

相关文章: