jeesite框架常用插件
1.分页: <div class="pagination">${page }</div>
2.日历:onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"
3.确认删除提示框:<a href="${ctx}/sys/onDuty2/delete?id=${onduty.id}" onclick="return confirm('确认要删除吗?')" class="btn btn-sm btn-primary">删除</a>
4.保存提示框:
function tijiao(){
document.getElementById("updateForm").submit();
/* layer.confirm("确认保存吗?", function(r) {
if(r){
document.getElementById("updateForm").submit();
}
layer.close(r);
}); */
/* var msg=comfirm("确认保存?");
if(msg==true){
document.getElementById("updateForm").submit();
}else{
return false;
} */
}
5.类A包含类B:在建表时,全部使用string类型,表A中只记录B的id。在建实体类时,在类A中使用String BId,String BName,通过查询将表B的信息记录在实体类中。而数据库中之保存id。
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="com.thinkgem.jeesite.modules.business.monitor.dao.DeviceDao"> <sql id="Base_Column_List">
d.id, d.num, d.name, d.model, d.type, d.is_bind, d.binder_id,
u.name as BinderName, d.state, d.del_flag
</sql> <sql id="Joins">
LEFT JOIN sys_users u ON u.id = d.binder_id
</sql> <!-- 查询单个 -->
<select id="selectById" parameterType="java.lang.String" resultType="Device">
select
<include refid="Base_Column_List" />
from mon_device
where id = #{id}
</select> <!-- 查询全部/条件查询列表 -->
<select id="selectList" parameterType="Device" resultType="Device">
select
<include refid="Base_Column_List" />
FROM mon_Device d
<include refid="Joins"/>
<where>
<if test="num != null">
d.num = #{num}
</if>
<if test="name != null">
d.name = #{name}
</if>
<if test="model != null">
d.model = #{model}
</if>
<if test="type != null">
d.type = #{type}
</if>
<if test="isBind != null">
d.is_bind = #{isBind}
</if>
<if test="binderId != null">
d.binder_id = #{binderId},
</if>
<if test="state != null">
d.state = #{state}
</if>
<if test="1 != 0">
AND d.del_flag = '0'
</if>
</where>
</select> <!-- 添加 -->
<insert id="insert" parameterType="Device">
insert into mon_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="num != null">
num,
</if>
<if test="name != null">
name,
</if>
<if test="model != null">
model,
</if>
<if test="type != null">
type,
</if>
<if test="isBind != null">
is_bind,
</if>
<if test="binderId != null">
binder_id,
</if>
<if test="state != null">
state,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createDate != null">
create_date,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateDate != null">
update_date,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="num != null">
#{num},
</if>
<if test="name != null">
#{name},
</if>
<if test="model != null">
#{model},
</if>
<if test="type != null">
#{type},
</if>
<if test="isBind != null">
#{isBind},
</if>
<if test="binderId != null">
#{binderId},
</if>
<if test="state != null">
#{state},
</if>
<if test="createBy != null">
#{createBy.id},
</if>
<if test="createDate != null">
#{createDate},
</if>
<if test="updateBy != null">
#{updateBy.id},
</if>
<if test="updateDate != null">
#{updateDate},
</if>
<if test="delFlag != null">
#{delFlag},
</if>
</trim>
</insert> <!-- 修改 -->
<update id="update" parameterType="Device">
update mon_device
<set>
<if test="num != null">
num = #{num},
</if>
<if test="name != null">
name = #{name},
</if>
<if test="model != null">
model = #{model},
</if>
<if test="type != null">
type = #{type},
</if>
<if test="isBind != null">
is_bind = #{isBind},
</if>
<if test="binderId != null">
binder_id = #{binderId},
</if>
<if test="state != null">
state = #{state},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createDate != null">
create_date = #{createDate},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateDate != null">
update_date = #{updateDate},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</set>
where id = #{id}
</update> <!-- 删除 -->
<update id="deleteById" >
update mon_device set del_flag = '1'
where id = #{id }
</update> </mapper>
类A包含类B
jeesite框架常用插件的更多相关文章
- 【转载】Grunt常用插件介绍
项目名称 grunt-contrib v0.8.0 项目地址 https://github.com/gruntjs/grunt-contrib 项目介绍 此项目是对grunt常用插件的集合,刚接触gr ...
- maven常用插件总结
maven本质上是一个插件框架,几乎所有的功能都是通过各种各样的插件来实现的.maven默认会依据项目类型自动把构建时的各阶段(Lifecycle和phase)自动绑定(Lifecycle Mappi ...
- maven常用插件配置详解
常用插件配置详解Java代码 <!-- 全局属性配置 --> <properties> <project.build.name>tools</proje ...
- logstash常用插件解析
官方地址:https://www.elastic.co/guide/en/logstash-versioned-plugins/current/index.html 配置文件写法: # 日志导入inp ...
- Bootstrap 框架、插件
Bootstrap,前端工程师比较常用的框架.插件,根据它的定义,我们不妨这样理解,Bootstrap就是用于前端开发的一个模板,就是别人做好了我们直接可以搬过来直接使用或者根据自己需要略加修改设计自 ...
- .Net 常用插件及第三方库
.Net 常用插件及第三方库 一:第三方插件 1:基于响应式编程思想的oc 地址:https://github.com/ReactiveCocoa/ReactiveCocoa 2:hud提示框 地址: ...
- Xcode 常用插件
1.Xcode 插件 从 Xcode 8 起 Apple 禁用 Xcode 插件. 1)Xcode 插件安装目录 ~/library/Application Support/Developer/Sha ...
- unity assetStore 常用插件
常用插件 20180723============= 教程类 =============<Mecanim Example Scenes > 官方示例场景<Surivial Shoot ...
- CDN公共库、前端开发常用插件一览表(VendorPluginLib)
=======================================================================================前端CDN公共库===== ...
随机推荐
- tcpdump 与 抓包分析
在Windows下一般使用WireShark 抓包软件,tcpdump 是 Linux 系统的抓包软件.它可以抓取 TCP/IP 协议族的数据包,支持针对网络层.协议.主机.端口的过滤,并提供 and ...
- plsql exception
EXCEPTION aligns with BEGIN ... END blocks. There is no BEGIN inside your loop, so there should be n ...
- Hibernate中Session的save()、update()、merge()、lock()、saveOrUpdate()和persist()方法有什么区别?
Hibernate的对象有三种状态:瞬态.持久态和游离态.游离状态的实例可以通过调用save().persist()或者saveOrUpdate()方法进行持久化:脱管状态的实例可以通过调用 upda ...
- jquery 下拉框左右选择
html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <ti ...
- 【串线篇】SpringMvc数据传出
/** * SpringMVC除过在方法上传入原生的request和session外还能怎么样把数据带给页面 * * 四大域: * pageContext:${pageScope.msg }< ...
- array_shift — 将数组开头的单元移出数组
<?php $stack = array("orange", "banana", "apple", "raspberry&q ...
- iSkysoft iMedia Converter Deluxe for Mac的使用方法
我们电脑上的播放器大多数的播放格式都比较少,所以在播放其它格式的时候容易出错,不能兼容其它的视频格式.今天小编要给大家推荐一种软件,iSkysoft iMedia Converter Deluxe就是 ...
- 【leetcode】944. Delete Columns to Make Sorted
题目如下: We are given an array A of N lowercase letter strings, all of the same length. Now, we may cho ...
- c++11 委派构造函数
委派构造函数可以减少构造函数的书写量: class Info { public: Info() : type(), name('a') { InitRest(); } Info(int i) : ty ...
- 在树莓派3B上搭建LAMP
一.安装apache2 sudo apt-get install apache2 在电脑上输入树莓派的网址会有如下显示 二.安装Mysql sudo apt-get install mysql-ser ...