admin管理员组

文章数量:1536088

    ps:昨天将管理员登录的功能完成了,并完美的解决跳过登录从而进入管理界面的bug,今天我们将实现"查询用户"功能。

    ①在po包中创建Customer类,并编写相关变量和添加set/get方法。(相关变量:客户编号,客户名称,负责人id,创建人id,客户信息来源,客户所属行业,客户级别,联系人,固定电话,移动电话,邮政编码,联系地址,创建时间,起始行,所取行数) 然后创建BaseDict类(字典类)

    ②在dao包中创建CustomerDao接口,接口中包含 通过id查询客户的方法,客户列表方法(List集合)和显示客户数的方法

    ③在dao包中创建CustomerDao.xml文件,在文件开头我们先编写映射地址,然后编写查询用户的sql语句,其id为 "selectCustomerListWhere"  然后编写查询客户列表的sql语句(查询客户列表的语句要和字典表结合来查)。之后编写查询客户总数的sql语句。

<mapper namespace="com.yehaijing.core.dao.CustomerDao" >
    <!-- 查询客户 -->
   <sql >
        <where>
	       <if test="cust_name != null" >
	           cust_name like "%"#{cust_name}"%"
	       </if>
	       <if test="cust_source != null" >
	        and cust_source = #{cust_source}
	       </if>
	       <if test="cust_industry != null" >
	        and cust_industry = #{cust_industry}
	       </if>
	       <if test="cust_level != null" >
	        and cust_level = #{cust_level}
	       </if>
        </where>
    </sql>
	<!-- 查询客户列表  -->
	

本文标签: 管理系统教程bootCRM