加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

关于layui分页

发布时间:2020-12-16 23:25:08 所属栏目:百科 来源:网络整理
导读:? 1.封装通用layUI分页table绑定 2.Mapper里的方法 3.Mapper.xml 里的处理 !-- 查询所有信息 -- resultMap type="cn.itcast.ssm.po.CompanyCustom" id="selectA" autoMapping="true" id column="cids" property="cids" / !-- 多对一 -- association property

?

1.封装通用layUI分页table绑定

2.Mapper里的方法

3.Mapper.xml 里的处理

<!-- 查询所有信息 -->
<resultMap type="cn.itcast.ssm.po.CompanyCustom" id="selectA"
autoMapping="true">
<id column="cids" property="cids" />

<!-- 多对一 -->
<association property="positiontypeCustom"
javaType="cn.itcast.ssm.po.PositiontypeCustom" autoMapping="true">
<id column="tid" property="tid" />
</association>
</resultMap>
<!-- 查询所有信息 -->
<select id="select" resultMap="selectA">
select
c.cids,c.coid,c.compayname,c.ctel,c.caddress,c.cregisttime,c.isregister,c.cemail,p.tid,p.tname
from company c INNER JOIN positiontype p on c.coid=p.tid where 1=1
<if test="compayname!=null and compayname!=‘‘">
and compayname like ‘%${compayname}%‘
</if>
<if test="caddress != null and caddress != ‘‘">
and caddress like ‘%${caddress}%‘
</if>
limit #{page},#{limit}
</select>
<!-- 查询总条数 -->
<select id="count" resultType="int">
select count(*) from company where 1=1
<if test="compayname!=null and compayname!=‘‘">
and compayname like ‘%${compayname}%‘
</if>
<if test="caddress != null and caddress != ‘‘">
and caddress like ‘%${caddress}%‘
</if>
</select>

?

Service 层

Impl层

Controller 层的处理

?

?最后页面+加上模糊查询

?

?

?完结。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读