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框架常用插件的更多相关文章

  1. 【转载】Grunt常用插件介绍

    项目名称 grunt-contrib v0.8.0 项目地址 https://github.com/gruntjs/grunt-contrib 项目介绍 此项目是对grunt常用插件的集合,刚接触gr ...

  2. maven常用插件总结

    maven本质上是一个插件框架,几乎所有的功能都是通过各种各样的插件来实现的.maven默认会依据项目类型自动把构建时的各阶段(Lifecycle和phase)自动绑定(Lifecycle Mappi ...

  3. maven常用插件配置详解

    常用插件配置详解Java代码    <!-- 全局属性配置 --> <properties> <project.build.name>tools</proje ...

  4. logstash常用插件解析

    官方地址:https://www.elastic.co/guide/en/logstash-versioned-plugins/current/index.html 配置文件写法: # 日志导入inp ...

  5. Bootstrap 框架、插件

    Bootstrap,前端工程师比较常用的框架.插件,根据它的定义,我们不妨这样理解,Bootstrap就是用于前端开发的一个模板,就是别人做好了我们直接可以搬过来直接使用或者根据自己需要略加修改设计自 ...

  6. .Net 常用插件及第三方库

    .Net 常用插件及第三方库 一:第三方插件 1:基于响应式编程思想的oc 地址:https://github.com/ReactiveCocoa/ReactiveCocoa 2:hud提示框 地址: ...

  7. Xcode 常用插件

    1.Xcode 插件 从 Xcode 8 起 Apple 禁用 Xcode 插件. 1)Xcode 插件安装目录 ~/library/Application Support/Developer/Sha ...

  8. unity assetStore 常用插件

    常用插件 20180723============= 教程类 =============<Mecanim Example Scenes > 官方示例场景<Surivial Shoot ...

  9. CDN公共库、前端开发常用插件一览表(VendorPluginLib)

    =======================================================================================前端CDN公共库===== ...

随机推荐

  1. Codeforces 353E 贪心

    题意:给你一张有向图,第i条边连接i号点和(i + 1) % n号点,问最多可以选择多少个点,使得这些点互相不可达. 思路:容易发现,如果某个边的集合点的数目大于等于2,那么就可以选出一个点,当然也可 ...

  2. 本地MongoDB服务开启与连接本地以及远程服务器MongoDB服务

    转载:https://blog.csdn.net/sunshinegyan/article/details/80017012 前提:本地已经安装好了MongoDB服务 1启动MongoDB: 方法1: ...

  3. proxy汇总-1

    1.apt-get的proxy 新建/etc/apt/apt.conf.d目录下新建10proxy文件,添加: Acquire::http::proxy"http://xx.xx.xx.xx ...

  4. 51单片机PC程序计数器

    PC是一个16位的计数器.用于存放和指示下一条要执行的指令的地址.寻址范围达64KB.PC有自动加1功能,以实现程序的顺序执行.PC没有地址,是不可寻址的,无法用指令对它进行读写.但在执行转移.调用. ...

  5. mitmproxy 代理介绍及入门

    转载请注明出处 https://www.cnblogs.com/majianming/p/11823669.html mitmproxy 是一个python 写成的代理工具,可以代理https.htt ...

  6. 记一次pycharm和vscode因网络问题插件下载失败的问题

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connec ...

  7. boost regex expression

    Boost.Regex provides three different functions to search for regular expressions 1. regex_match #inc ...

  8. POJ 2251 Dungeon Master(dfs)

    Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is co ...

  9. python爬虫https://www.imdb.com/chart/top的电影

    目标:爬取https://www.imdb.com/chart/top网页上面的电影top20 直接上main.py代码: #!/usr/bin/python35 # -*- coding:utf-8 ...

  10. Golang 开发技能图谱

    # Golang 开发技能图谱 ## Go 语言环境搭建- Go 安装- GOPATH 与工作空间- Go 命令- Go开发工具 ## GO 语言编程基础- 关键词和语法(Language Synta ...