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公共库===== ...
随机推荐
- find 文件查找
目录 find文件查找 1.为什么要使用文件查找 2.根据文件名称查找-name 3.根据文件大小查找-size 4.根据文件类型查找-type f 5.根据文件时间查找-mtime 6.根据文件用户 ...
- mac系统下安装和启动nginx
1.在线安装 localhost:nginx-1.17.1 mhx$ sudo brew install nginx 2.查看是否安装成功 localhost:nginx-1.17.1 mhx$ ng ...
- OTP Server
OTP Server是一个基于动态口令的身份认证系统,它可以为应用系统提供高安全性的身份认证服务,帮助应用系统提高身份认证的安全性,防止攻击者利用应用系统自身的身份认证安...
- 一、Redis的安装
1.下载.解压.编译.安装 # 下载地址 wget http://download.redis.io/redis-stable.tar.gz # 解压 tar xzf redis-stable.tar ...
- wireshark简单的过滤条件
http://blog.csdn.net/blue_jjw/article/details/8467885 一.IP过滤:包括来源IP或者目标IP等于某个IP比如:ip.src addr==192.1 ...
- Tmux 中开启鼠标选择与复制
在 tmux.conf 中加入下列设置(tmux 2.1 之前的版本): set -g mode-mouse on set -g mouse-resize-pane on set -g mouse-s ...
- 18.synchronized
同步的前提: 必须要有两个或者两个以上的线程 必须是多个线程使用同一个锁 必须保证同步中只能有一个线程在运行 好处:解决了多线程的安全问题 弊端:多个线程需要判断锁,较为消耗资源.抢锁的资源 ...
- string.format()详解
java中: 从 Java 5.0 开始,String 类新增了一个强大的字符串格式化方法 format().这个方法到现在用的人还是不多,实在是一种浪费.本文带你快速过一遍这个方法的功能,将来你要用 ...
- MySQL事务调优
原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/11429239.html 数据库事务 数据库事务是数据库系统执行过程中的一个逻辑处理单元,保证一个数据库 ...
- leetcode-165周赛-1276-不浪费原料的汉堡制作方案
题目描述: 自己的提交: class Solution: def numOfBurgers(self, tomatoSlices: int, cheeseSlices: int) -> List ...