- 浏览: 796860 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (480)
- Spring (12)
- Hibernate (8)
- Struts2 (4)
- Java 基础-JDK-类-接口-URI-专题研究 (27)
- 线程、线程池、多线程高并发高可用、Socket通信 (15)
- Oracle数据库 (20)
- 一般-前端js-html-其它 (25)
- JYSK-互联网金融、金融科技、支付、公司、新闻等等 (8)
- Ajax-jQuery开源框架 (7)
- Json-轻量级的数据交换格式 (14)
- JavaScript (15)
- Jsp、Servlet、Servlet+JSP+JavaBean开发模式(MVC) (18)
- Html-JavaScript-前端-调用接口 (12)
- Sql Server 2005 (6)
- 正则表达式 (2)
- Java tools (18)
- 加签与验签、加密与解密 (3)
- Ajax技术核心-xmlHttpRequest(简称XHR) (6)
- xml-数据交换格式 (3)
- 信息采集 (1)
- Http - Https - HttpClient - httpCore-SSL-TLS (10)
- HtmlParser (2)
- 标签库 (1)
- SMS (2)
- jxl-导入导出 (4)
- poi-导入导出 (2)
- 定时器Timer+Quartz (6)
- 工作流引擎JBPM3.2.3 (4)
- 工作流引擎JBPM4 (0)
- 数据源-JNDI (0)
- tomcat、weblogic等应用服务器 (6)
- 工作流引擎jbpm5 (1)
- 搜索引擎Lucene (1)
- ant (1)
- 大数据-HBase (2)
- bigtable (0)
- 数据库设计 (4)
- jquery tab (0)
- mybatis (5)
- jquery ui 1.10.3 (5)
- Jboss7 (1)
- 规则引擎drools (0)
- 工作流引擎Activiti5 (0)
- 数据库-用户自定义函数 (0)
- 数据库-存储过程 (2)
- 数据库-视图 (0)
- 数据库-触发器 (0)
- 数据库-sql (2)
- highcharts-图表工具 (1)
- sql server 2008 (6)
- 诗词-工作室 (2)
- 数据割接 (1)
- GIS-地理信息系统 (2)
- RS-遥感技术 (1)
- GPS-全球定位系统 (1)
- java整合flex_RIA开发 (3)
- C#编程语言 (5)
- webservice_axis2_cxf_soap_wsdl (2)
- sql语句 (3)
- Flex_WebService_GIS (25)
- PHP编程语言 (0)
- ExtJS4.2 (1)
- Spring mvc (5)
- EasyUI1.4.2 (16)
- 日期时间工具类 (4)
- 随机数 (1)
- Arcgis api for js (0)
- Mysql数据库 (9)
- 移动互联网 java html5/flash socket netty (0)
- API接口 (1)
- AndroidStudio (0)
- Git (2)
- Maven (5)
- IDEA (0)
- 大数据-Hadoop (2)
- JPA (0)
- Spring boot (4)
- JSF (0)
- nginx_lua_module_redis (2)
- Activiti (1)
- bootstrap (1)
- AngularJS (10)
- 数据库-索引 (1)
- Linux及其连接工具SSH (4)
- java日志管理 (2)
- islider滑动控件 (1)
- jquery (1)
- 异常处理Exception (1)
- 秒杀与类秒杀系统 (1)
- 连接数据库、数据库连接池 (4)
- 数据库-临时表 (1)
- 软件设计模式-单例、多例、代理、工厂、观察者 (3)
- 集合框架 (5)
- 人工智能--Artificial intelligence、神经网络算法、机器学习 (1)
- 分布式应用 (1)
- SOA服务-Dubbo框架-Thrift框架 (2)
- Zookeeper分布式服务框架 (2)
- intellij idea (1)
- python编程语言 (0)
- 消息队列_MQ (0)
- 消息队列_RabbitMQ (2)
- 消息队列_ActiveMQ (1)
- 消息队列_Kafka (2)
- 缓存_Redis (4)
- 缓存_Memcache (0)
- 缓存_Ehcache (0)
- ivy-ivyde (1)
- google-protocol buffers (1)
- 正向代理-正向代理服务器 (1)
- 反向代理-反向代理服务器 (1)
- JVM内存模型 (0)
- Thunder框架 (1)
- NIO-非阻塞式IO (0)
- 软件测试、性能测试 (1)
- 序列化、Serializable接口、Externalizable接口 (3)
- 线程池-ExecutorService-ThreadPoolExecutor (1)
- web.xml (1)
- java开发-java工具-实用工具网站 (6)
- 医疗 (1)
- Filter-过滤器 (2)
- Unicode码-双字节字符编码 (1)
- OpenResty (1)
- 计算机网络 (1)
- eclipse_myeclipse_intellij idea (3)
- Enum (1)
- 大数据--Big Data (1)
- 云计算--Cloud computing (1)
- Elastic-Job (1)
- Redis (2)
- 文件流-IO操作 (6)
- 计算机基础知识 (1)
- Hessian-二进制RPC协议 (1)
- String类 (3)
- BigDecimal类 (1)
- java重要接口 (1)
- ReactJS (1)
- 跨域问题 (0)
- Map (1)
- 注解 (1)
- ASCII码-单字节字符编码 (1)
- 微服务、微服务架构 (2)
- RPC协议、RPC服务、RPC框架 (0)
- java反射 (1)
- java项目之classpath (1)
- 经典算法-树 (1)
- listener-监听器 (1)
- Interceptor-拦截器 (1)
- pojo javabean (2)
- 计算机科学与技术-进阶 (1)
- 代码规范与文档编写 (1)
- UML-统一建模语言 (1)
- 对接微信、支付宝 (3)
- 压力测试 (1)
- 办公软件-Excel (1)
- 办公软件-PPT (0)
- UTF8、GBK编码 (1)
- 微服务架构:Spring Cloud架构-Dubbo架构 (6)
- Nginx (1)
- 点滴业务 (1)
- form表单-json数据-转换与接口调用 (1)
- Junit单元测试 (1)
- 大数据-Spark (1)
- 大数据-Storm (1)
- 数据库事务-Spring事务 (0)
- elasticsearch (1)
- windows (1)
最新评论
引用参考:
--MyBatis中jdbcType和javaType的映射关系
https://www.cnblogs.com/yucongblog/p/7388648.html
https://www.cnblogs.com/hapday/p/5734210.html
--Mybatis中的trim标签 介绍
https://blog.csdn.net/u011118321/article/details/68946027
--设置mybatis打印sql日志
https://blog.csdn.net/gao36951/article/details/53641432
--mapper.xml里面choose when otherwis一直执行otherwise解决
https://www.cnblogs.com/xu-xiang/p/5883580.html
--mybatis insert之后返回主键id
https://www.cnblogs.com/zhuzhen/p/6894995.html
--choose when otherwise
http://www.cnblogs.com/caoyc/p/5574948.html
xml:
Mapper:
创建、释放、查找、提交、撤销登记、关闭 sqlsession
--MyBatis中jdbcType和javaType的映射关系
https://www.cnblogs.com/yucongblog/p/7388648.html
https://www.cnblogs.com/hapday/p/5734210.html
--Mybatis中的trim标签 介绍
https://blog.csdn.net/u011118321/article/details/68946027
--设置mybatis打印sql日志
https://blog.csdn.net/gao36951/article/details/53641432
--mapper.xml里面choose when otherwis一直执行otherwise解决
https://www.cnblogs.com/xu-xiang/p/5883580.html
--mybatis insert之后返回主键id
https://www.cnblogs.com/zhuzhen/p/6894995.html
<insert id="addStudent" parameterType="com.test.StudentEntity" useGeneratedKeys="true" keyProperty="id"> ... </insert> 代码中: studentMapper.addStudent(entity); long stuId=entity.getId();
--choose when otherwise
http://www.cnblogs.com/caoyc/p/5574948.html
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.sunny.dao.duty.DutyMapper" > <resultMap id="BaseResultMap" type="com.sunny.model.duty.Duty" > <id column="DUTY_ID" property="dutyId" jdbcType="INTEGER" /> <result column="DSCD" property="dscd" jdbcType="CHAR" /> <result column="UNIT_ID" property="unitId" jdbcType="INTEGER" /> <result column="YEAR" property="year" jdbcType="CHAR" /> <result column="MONTH" property="month" jdbcType="CHAR" /> <result column="DAY" property="day" jdbcType="CHAR" /> <result column="DAY0" property="day0" jdbcType="CHAR" /> <result column="WEEK_DAY" property="weekDay" jdbcType="CHAR" /> <result column="MORNING_PEOPLE_IDS" property="morningPeopleIds" jdbcType="VARCHAR" /> <result column="MORNING_PEOPLE_NAMES" property="morningPeopleNames" jdbcType="VARCHAR" /> <result column="AFTERNOON_PEOPLE_IDS" property="afternoonPeopleIds" jdbcType="VARCHAR" /> <result column="AFTERNOON_PEOPLE_NAMES" property="afternoonPeopleNames" jdbcType="VARCHAR" /> <result column="EVENING_PEOPLE_IDS" property="eveningPeopleIds" jdbcType="VARCHAR" /> <result column="EVENING_PEOPLE_NAMES" property="eveningPeopleNames" jdbcType="VARCHAR" /> <result column="LEADER_IDS" property="leaderIds" jdbcType="VARCHAR" /> <result column="LEADER_NAMES" property="leaderNames" jdbcType="VARCHAR" /> <result column="FLAG" property="flag" jdbcType="INTEGER" /> <result column="REMARK" property="remark" jdbcType="VARCHAR" /> </resultMap> <resultMap id="onHashMap_1" type="java.util.HashMap"> <result column="DSCD" property="dscd" jdbcType="CHAR" /> <result column="UNIT_ID" property="unitId" jdbcType="INTEGER" /> <result column="YEAR" property="year" jdbcType="CHAR" /> <result column="MONTH" property="month" jdbcType="CHAR" /> <result column="FLAG" property="flag" jdbcType="INTEGER" /> <result column="FLAGNAME" property="flagName" jdbcType="VARCHAR" /> <result column="DSNM" property="dsnm" jdbcType="CHAR" /> <result column="UNIT_NAME" property="unitName" jdbcType="VARCHAR" /> </resultMap> <resultMap id="onHashMap_2" type="java.util.HashMap"> <result column="mName" property="mName" jdbcType="VARCHAR" /> <result column="mContact" property="mContact" jdbcType="VARCHAR" /> <result column="mEmail" property="mEmail" jdbcType="VARCHAR" /> <result column="m2Name" property="m2Name" jdbcType="VARCHAR" /> <result column="m2Contact" property="m2Contact" jdbcType="VARCHAR" /> <result column="m2Email" property="m2Email" jdbcType="VARCHAR" /> <result column="aName" property="aName" jdbcType="VARCHAR" /> <result column="aContact" property="aContact" jdbcType="VARCHAR" /> <result column="aEmail" property="aEmail" jdbcType="VARCHAR" /> <result column="a2Name" property="a2Name" jdbcType="VARCHAR" /> <result column="a2Contact" property="a2Contact" jdbcType="VARCHAR" /> <result column="a2Email" property="a2Email" jdbcType="VARCHAR" /> <result column="eName" property="eName" jdbcType="VARCHAR" /> <result column="eContact" property="eContact" jdbcType="VARCHAR" /> <result column="eEmail" property="eEmail" jdbcType="VARCHAR" /> <result column="e2Name" property="e2Name" jdbcType="VARCHAR" /> <result column="e2Contact" property="e2Contact" jdbcType="VARCHAR" /> <result column="e2Email" property="e2Email" jdbcType="VARCHAR" /> <result column="lName" property="lName" jdbcType="VARCHAR" /> <result column="lContact" property="lContact" jdbcType="VARCHAR" /> <result column="lEmail" property="lEmail" jdbcType="VARCHAR" /> <result column="l2Name" property="l2Name" jdbcType="VARCHAR" /> <result column="l2Contact" property="l2Contact" jdbcType="VARCHAR" /> <result column="l2Email" property="l2Email" jdbcType="VARCHAR" /> <result column="WEEK_DAY" property="weekDay" jdbcType="CHAR" /> <result column="FLAG" property="flag" jdbcType="INTEGER" /> <result column="DAY0" property="day0" jdbcType="CHAR" /> <result column="DAY" property="day" jdbcType="CHAR" /> <result column="MORNING_PEOPLE_NAMES" property="morningPeopleNames" jdbcType="VARCHAR" /> <result column="AFTERNOON_PEOPLE_NAMES" property="afternoonPeopleNames" jdbcType="VARCHAR" /> <result column="EVENING_PEOPLE_NAMES" property="eveningPeopleNames" jdbcType="VARCHAR" /> <result column="LEADER_NAMES" property="leaderNames" jdbcType="VARCHAR" /> </resultMap> <resultMap id="onHashMap_3" type="java.util.HashMap"> <result column="RN" property="rn" jdbcType="INTEGER" /> <result column="WEEK_DAY" property="weekDay" jdbcType="CHAR" /> <result column="FLAG" property="flag" jdbcType="INTEGER" /> <result column="FLAG" property="flagName" jdbcType="VARCHAR" /> <result column="DAY0" property="day0" jdbcType="CHAR" /> <result column="DAY" property="day" jdbcType="CHAR" /> <result column="MORNING_PEOPLE_NAMES" property="morningPeopleNames" jdbcType="VARCHAR" /> <result column="AFTERNOON_PEOPLE_NAMES" property="afternoonPeopleNames" jdbcType="VARCHAR" /> <result column="EVENING_PEOPLE_NAMES" property="eveningPeopleNames" jdbcType="VARCHAR" /> <result column="LEADER_NAMES" property="leaderNames" jdbcType="VARCHAR" /> </resultMap> <resultMap id="onHashMap_4" type="java.util.HashMap"> <result column="PERSON_NAME" property="personName" jdbcType="VARCHAR" /> <result column="DAY0" property="day0" jdbcType="CHAR" /> <result column="WEEK_DAY" property="weekDay" jdbcType="CHAR" /> <result column="MORNING_PEOPLE_IDS" property="morningPeopleIds" jdbcType="VARCHAR" /> <result column="MORNING_PEOPLE_NAMES" property="morningPeopleNames" jdbcType="VARCHAR" /> <result column="AFTERNOON_PEOPLE_IDS" property="afternoonPeopleIds" jdbcType="VARCHAR" /> <result column="AFTERNOON_PEOPLE_NAMES" property="afternoonPeopleNames" jdbcType="VARCHAR" /> <result column="EVENING_PEOPLE_IDS" property="eveningPeopleIds" jdbcType="VARCHAR" /> <result column="EVENING_PEOPLE_NAMES" property="eveningPeopleNames" jdbcType="VARCHAR" /> <result column="LEADER_IDS" property="leaderIds" jdbcType="VARCHAR" /> <result column="LEADER_NAMES" property="leaderNames" jdbcType="VARCHAR" /> <result column="flagName" property="flagName" jdbcType="VARCHAR" /> </resultMap> <resultMap id="onHashMap_5" type="java.util.HashMap"> <result column="mName" property="mName" jdbcType="VARCHAR" /> <result column="mContact" property="mContact" jdbcType="VARCHAR" /> <result column="mEmail" property="mEmail" jdbcType="VARCHAR" /> <result column="m2Name" property="m2Name" jdbcType="VARCHAR" /> <result column="m2Contact" property="m2Contact" jdbcType="VARCHAR" /> <result column="m2Email" property="m2Email" jdbcType="VARCHAR" /> <result column="aName" property="aName" jdbcType="VARCHAR" /> <result column="aContact" property="aContact" jdbcType="VARCHAR" /> <result column="aEmail" property="aEmail" jdbcType="VARCHAR" /> <result column="a2Name" property="a2Name" jdbcType="VARCHAR" /> <result column="a2Contact" property="a2Contact" jdbcType="VARCHAR" /> <result column="a2Email" property="a2Email" jdbcType="VARCHAR" /> <result column="eName" property="eName" jdbcType="VARCHAR" /> <result column="eContact" property="eContact" jdbcType="VARCHAR" /> <result column="eEmail" property="eEmail" jdbcType="VARCHAR" /> <result column="e2Name" property="e2Name" jdbcType="VARCHAR" /> <result column="e2Contact" property="e2Contact" jdbcType="VARCHAR" /> <result column="e2Email" property="e2Email" jdbcType="VARCHAR" /> <result column="lName" property="lName" jdbcType="VARCHAR" /> <result column="lContact" property="lContact" jdbcType="VARCHAR" /> <result column="lEmail" property="lEmail" jdbcType="VARCHAR" /> <result column="l2Name" property="l2Name" jdbcType="VARCHAR" /> <result column="l2Contact" property="l2Contact" jdbcType="VARCHAR" /> <result column="l2Email" property="l2Email" jdbcType="VARCHAR" /> <result column="MORNING_PEOPLE_IDS" property="morningPeopleIds" jdbcType="VARCHAR" /> <result column="AFTERNOON_PEOPLE_IDS" property="afternoonPeopleIds" jdbcType="VARCHAR" /> <result column="EVENING_PEOPLE_IDS" property="eveningPeopleIds" jdbcType="VARCHAR" /> <result column="LEADER_IDS" property="leaderIds" jdbcType="VARCHAR" /> <result column="WEEK_DAY" property="weekDay" jdbcType="CHAR" /> <result column="FLAG" property="flag" jdbcType="INTEGER" /> <result column="DAY0" property="day0" jdbcType="CHAR" /> <result column="DAY" property="day" jdbcType="CHAR" /> <result column="MORNING_PEOPLE_NAMES" property="morningPeopleNames" jdbcType="VARCHAR" /> <result column="AFTERNOON_PEOPLE_NAMES" property="afternoonPeopleNames" jdbcType="VARCHAR" /> <result column="EVENING_PEOPLE_NAMES" property="eveningPeopleNames" jdbcType="VARCHAR" /> <result column="LEADER_NAMES" property="leaderNames" jdbcType="VARCHAR" /> </resultMap> <sql id="Base_Column_List" > DUTY_ID, DSCD, UNIT_ID, YEAR, MONTH, DAY,DAY0, WEEK_DAY, MORNING_PEOPLE_IDS, MORNING_PEOPLE_NAMES, AFTERNOON_PEOPLE_IDS, AFTERNOON_PEOPLE_NAMES, EVENING_PEOPLE_IDS, EVENING_PEOPLE_NAMES, LEADER_IDS, LEADER_NAMES, FLAG, REMARK </sql> <!-- 按条件查找某天的值班信息 --> <select id="getTodayDutyInfo" resultMap="onHashMap_5"> select m1.person_name as mName, m1.contact as mContact,m1.email as mEmail, m2.person_name as m2Name, m2.contact as m2Contact,m2.email as m2Email, a1.person_name as aName, a1.contact as aContact,a1.email as aEmail, a2.person_name as a2Name, a2.contact as a2Contact,a2.email as a2Email, e1.person_name as eName, e1.contact as eContact,e1.email as eEmail, e2.person_name as e2Name, e2.contact as e2Contact,e2.email as e2Email, l1.person_name as lName, l1.contact as lContact,l1.email as lEmail, l2.person_name as l2Name, l2.contact as l2Contact,l2.email as l2Email, t.morning_people_ids,t.afternoon_people_ids,t.evening_people_ids,t.leader_ids, t.week_day, t.flag, case when t.flag=1 then '普通班' when t.flag=2 then '加强班' else '' end flagName, t.day0,t.day,t.morning_people_names,t.afternoon_people_names,t.evening_people_names,t.leader_names from( select substr(a.morning_people_ids,0,instr(a.morning_people_ids,',',1,1)-1) as mId, substr(a.morning_people_ids,instr(a.morning_people_ids,',',1,1)+1) as m2Id, substr(a.afternoon_people_ids,0,instr(a.afternoon_people_ids,',',1,1)-1) as aId, substr(a.afternoon_people_ids,instr(a.afternoon_people_ids,',',1,1)+1) as a2Id, substr(a.evening_people_ids,0,instr(a.evening_people_ids,',',1,1)-1) as eId, substr(a.evening_people_ids,instr(a.evening_people_ids,',',1,1)+1) as e2Id, substr(a.leader_ids,0,instr(a.leader_ids,',',1,1)-1) as lId, substr(a.leader_ids,instr(a.leader_ids,',',1,1)+1) as l2Id, a.* from tb_duty a ) t, tb_duty_person_info m1, tb_duty_person_info m2, tb_duty_person_info a1, tb_duty_person_info a2, tb_duty_person_info e1, tb_duty_person_info e2, tb_duty_person_info l1, tb_duty_person_info l2 where 1=1 and nvl2(t.mId,t.mId,t.m2Id)=m1.person_id and t.m2Id=m2.person_id and nvl2(t.aId,t.aId,t.a2Id)=a1.person_id and t.a2Id=a2.person_id and nvl2(t.eId,t.eId,t.e2Id)=e1.person_id and t.e2Id=e2.person_id and nvl2(t.lId,t.lId,t.l2Id)=l1.person_id and t.l2Id=l2.person_id <if test="dscdStr!='' and dscdStr!=null" > and t.DSCD=#{dscdStr,jdbcType=CHAR} </if> <if test="unitIdInt!=null" > and t.UNIT_ID=#{unitIdInt,jdbcType=INTEGER} </if> <if test="day0Str!='' and day0Str!=null" > and t.DAY0=#{day0Str,jdbcType=CHAR} </if> <if test="flagInt != null " > and t.FLAG=#{flagInt,jdbcType=INTEGER} </if> order by t.day0 </select> <!-- 值班个人查询 --> <select id="selectPersonalDutyList" resultMap="onHashMap_4"> select b.person_name,a.day0,a.week_day,a.morning_people_ids,a.morning_people_names, a.afternoon_people_ids,a.afternoon_people_names,a.evening_people_ids,a.evening_people_names,a.leader_ids,a.leader_names, case when a.flag=1 then '普通班' when a.flag=2 then '加强班' else '' end flagName from tb_duty a,tb_duty_person_info b where 1=1 <if test="dscd !='' and dscd != null " > and a.dscd=#{dscd,jdbcType=CHAR} </if> <if test="unitId != null " > and a.unit_id=#{unitId,jdbcType=INTEGER} </if> <if test="year !='' and year != null " > and a.year=#{year,jdbcType=CHAR} </if> <if test="month !='' and month != null " > and a.month=#{month,jdbcType=CHAR} </if> and ( substr(a.morning_people_ids,0,instr(a.morning_people_ids,',',1,1)-1)=#{personId,jdbcType=CHAR} or substr(a.morning_people_ids,instr(a.morning_people_ids,',',1,1)+1)=#{personId,jdbcType=CHAR} or substr(a.afternoon_people_ids,0,instr(a.afternoon_people_ids,',',1,1)-1)=#{personId,jdbcType=CHAR} or substr(a.afternoon_people_ids,instr(a.afternoon_people_ids,',',1,1)+1)=#{personId,jdbcType=CHAR} or substr(a.evening_people_ids,0,instr(a.evening_people_ids,',',1,1)-1)=#{personId,jdbcType=CHAR} or substr(a.evening_people_ids,instr(a.evening_people_ids,',',1,1)+1)=#{personId,jdbcType=CHAR} or substr(a.leader_ids,0,instr(a.leader_ids,',',1,1)-1)=#{personId,jdbcType=CHAR} or substr(a.leader_ids,instr(a.leader_ids,',',1,1)+1)=#{personId,jdbcType=CHAR} ) and b.person_id=#{personId,jdbcType=CHAR} order by day0 asc </select> <!-- 前一个月的后10条值班记录 --> <select id="selectPreDutyList" resultMap="onHashMap_3"> select s.* from( select rownum rn, t.week_day, t.flag, case when t.flag=1 then '普通班' when t.flag=2 then '加强班' else '' end flagName, t.day0,t.day, t.morning_people_names,t.afternoon_people_names,t.evening_people_names,t.leader_names from tb_duty t where 1=1 <if test="dscd !='' and dscd != null " > and t.dscd=#{dscd,jdbcType=CHAR} </if> <if test="unitId != null " > and t.unit_id=#{unitId,jdbcType=INTEGER} </if> <if test="day0 !='' and day0 != null " > and to_char(to_date(t.day0,'yyyy-mm-dd'),'yyyy-mm')=#{day0,jdbcType=CHAR} </if> <if test="flag != null " > and t.flag=#{flag,jdbcType=INTEGER} </if> order by t.duty_id ) s <![CDATA[ where s.rn>(( ]]> select count(*) from tb_duty p where 1=1 <if test="dscd !='' and dscd != null " > and p.dscd=#{dscd,jdbcType=CHAR} </if> <if test="unitId != null " > and p.unit_id=#{unitId,jdbcType=INTEGER} </if> <if test="day0 !='' and day0 != null " > and to_char(to_date(p.day0,'yyyy-mm-dd'),'yyyy-mm')=#{day0,jdbcType=CHAR} </if> <if test="flag != null " > and p.flag=#{flag,jdbcType=INTEGER} </if> )-10) </select> <!-- 后一个月的前10条值班记录 --> <select id="selectNextDutyList" resultMap="onHashMap_3"> select s.* from( select rownum rn, t.week_day, t.flag, case when t.flag=1 then '普通班' when t.flag=2 then '加强班' else '' end flagName, t.day0,t.day, t.morning_people_names,t.afternoon_people_names,t.evening_people_names,t.leader_names from tb_duty t where 1=1 <if test="dscd !='' and dscd != null " > and t.dscd=#{dscd,jdbcType=CHAR} </if> <if test="unitId != null " > and t.unit_id=#{unitId,jdbcType=INTEGER} </if> <if test="day0 !='' and day0 != null " > and to_char(to_date(t.day0,'yyyy-mm-dd'),'yyyy-mm')=#{day0,jdbcType=CHAR} </if> <if test="flag != null " > and t.flag=#{flag,jdbcType=INTEGER} </if> <![CDATA[ and rownum<11 order by t.duty_id ) s where s.rn>0 ]]> </select> <!-- 按条件查找今日值班 --> <select id="selectTodayDutyList" resultMap="onHashMap_2"> select m1.person_name as mName, m1.contact as mContact,m1.email as mEmail, m2.person_name as m2Name, m2.contact as m2Contact,m2.email as m2Email, a1.person_name as aName, a1.contact as aContact,a1.email as aEmail, a2.person_name as a2Name, a2.contact as a2Contact,a2.email as a2Email, e1.person_name as eName, e1.contact as eContact,e1.email as eEmail, e2.person_name as e2Name, e2.contact as e2Contact,e2.email as e2Email, l1.person_name as lName, l1.contact as lContact,l1.email as lEmail, l2.person_name as l2Name, l2.contact as l2Contact,l2.email as l2Email, t.week_day, t.flag, case when t.flag=1 then '普通班' when t.flag=2 then '加强班' else '' end flagName, t.day0,t.day,t.morning_people_names,t.afternoon_people_names,t.evening_people_names,t.leader_names from( select substr(a.morning_people_ids,0,instr(a.morning_people_ids,',',1,1)-1) as mId, substr(a.morning_people_ids,instr(a.morning_people_ids,',',1,1)+1) as m2Id, substr(a.afternoon_people_ids,0,instr(a.afternoon_people_ids,',',1,1)-1) as aId, substr(a.afternoon_people_ids,instr(a.afternoon_people_ids,',',1,1)+1) as a2Id, substr(a.evening_people_ids,0,instr(a.evening_people_ids,',',1,1)-1) as eId, substr(a.evening_people_ids,instr(a.evening_people_ids,',',1,1)+1) as e2Id, substr(a.leader_ids,0,instr(a.leader_ids,',',1,1)-1) as lId, substr(a.leader_ids,instr(a.leader_ids,',',1,1)+1) as l2Id, a.* from tb_duty a ) t, tb_duty_person_info m1, tb_duty_person_info m2, tb_duty_person_info a1, tb_duty_person_info a2, tb_duty_person_info e1, tb_duty_person_info e2, tb_duty_person_info l1, tb_duty_person_info l2 where 1=1 and nvl2(t.mId,t.mId,t.m2Id)=m1.person_id and t.m2Id=m2.person_id and nvl2(t.aId,t.aId,t.a2Id)=a1.person_id and t.a2Id=a2.person_id and nvl2(t.eId,t.eId,t.e2Id)=e1.person_id and t.e2Id=e2.person_id and nvl2(t.lId,t.lId,t.l2Id)=l1.person_id and t.l2Id=l2.person_id <if test="dscd !='' and dscd != null " > and t.dscd=#{dscd,jdbcType=CHAR} </if> <if test="unitId != null " > and t.unit_id=#{unitId,jdbcType=INTEGER} </if> <if test="day0 !='' and day0 != null " > and to_char(to_date(t.day0,'yyyy-mm-dd'),'yyyy-mm')=#{day0,jdbcType=CHAR} </if> <if test="flag != null " > and t.flag=#{flag,jdbcType=INTEGER} </if> order by t.day0 </select> <select id="selectByUnitIdAndYear" resultMap="BaseResultMap" parameterType="java.lang.Integer" > select <include refid="Base_Column_List" /> from TB_DUTY where 1=1 <if test="unitId != null " > and unit_id=#{unitId,jdbcType=INTEGER} </if> <if test="year != null " > and year=#{year,jdbcType=INTEGER} </if> </select> <!-- 根据unitId和year查找记录集 --> <select id="selectListByConditions" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from TB_DUTY where 1=1 <if test="dscd!='' and dscd!=null" > and dscd=${dscd} </if> <if test="unitId!=null" > and unit_id=${unitId} </if> <if test="year!='' and year!=null" > and year=${year} </if> <if test="month!='' and month!=null" > and month=${month} </if> <if test="flag!=null" > and flag=${flag} </if> </select> <!-- 批量新增 --> <insert id="addMonthDutyIntoDB" parameterType="java.util.List"> insert into TB_DUTY select SEQ_TB_DUTY.nextval,A.* from( <foreach collection="list" item="item" index="index" separator="union"> SELECT #{item.dscd}, #{item.unitId},#{item.year},#{item.month},#{item.day},trim(#{item.weekDay}), #{item.morningPeopleIds}, #{item.morningPeopleNames},#{item.afternoonPeopleIds},#{item.afternoonPeopleNames},#{item.eveningPeopleIds}, #{item.eveningPeopleNames},#{item.leaderIds},#{item.leaderNames},#{item.flag},#{item.remark},#{item.day0} FROM DUAL </foreach> ) A </insert> <!-- 按条件统计月度排班 --> <select id="getDutyByCondition" resultMap="onHashMap_1"> select a.dscd,a.unit_id, a.year,a.month,a.flag, case when a.flag=1 then '普通班' when a.flag=2 then '加强班' else '' end flagName, ltrim(rtrim(b.dsnm)) as dsnm, c.unit_name from tb_duty a left join tb_code_area_info b on a.dscd=b.dscd left join tb_unit_info c on a.unit_id=c.unit_id where 1=1 <if test="dscd !='' and dscd != null " > and a.dscd=#{dscd,jdbcType=CHAR} </if> <if test="unitId != null " > and a.unit_id=#{unitId,jdbcType=INTEGER} </if> <if test="year != null " > and a.year=#{year,jdbcType=INTEGER} </if> <if test="month != null " > and a.month=#{month,jdbcType=INTEGER} </if> <if test="flag != null " > and a.flag=#{flag,jdbcType=INTEGER} </if> group by a.dscd,b.dsnm,a.unit_id,c.unit_name,a.year,a.month,a.flag order by a.year desc,to_number(a.month) desc </select> <!-- 重复保存月度排班检查 --> <select id="selectRecordExists" resultType="java.lang.Integer" > select count(*) from tb_duty where 1=1 <if test="dscd!='' and dscd!=null" > and dscd=${dscd} </if> <if test="unitId!=null" > and unit_id=${unitId} </if> <if test="year!='' and year!=null" > and year=${year} </if> <if test="month!='' and month!=null" > and month=${month} </if> <if test="flag!=null" > and flag=${flag} </if> </select> <!-- 单个删除值班表 --> <delete id="delById"> delete from tb_duty where 1=1 <if test="dscd !='' and dscd != null " > and dscd=#{dscd,jdbcType=CHAR} </if> <if test="unitId != null " > and unit_id=#{unitId,jdbcType=INTEGER} </if> <if test="year != null " > and year=#{year,jdbcType=INTEGER} </if> <if test="month != null " > and month=#{month,jdbcType=INTEGER} </if> <if test="flag != null " > and flag=#{flag,jdbcType=INTEGER} </if> </delete> <!-- 批量删除值班表(多条件) --> <delete id="delMultiByIds2" parameterType="java.util.List"> delete from tb_duty A where exists ( select 1 from( <foreach collection="list" item="item" index="index" separator="union all"> select B.* from tb_duty B where 1=1 and B.dscd=${item.dscd} and B.unit_id=${item.unitId} and B.year=${item.year} and B.month=${item.month} and B.flag=${item.flag} </foreach> )S where A.duty_id=S.duty_id ) </delete> <!--批量修改值班表(多条件) --> <update id="updateByMultiConditions" parameterType="java.util.List"> <foreach collection="list" item="item" index="index" open="begin" close="; end;" separator=";"> update TB_DUTY <set> <if test="item.morningPeopleIds != null and item.morningPeopleIds != '' " > MORNING_PEOPLE_IDS=#{item.morningPeopleIds,jdbcType=VARCHAR}, </if> <if test="item.morningPeopleNames != null and item.morningPeopleNames != '' " > MORNING_PEOPLE_NAMES=#{item.morningPeopleNames,jdbcType=VARCHAR}, </if> <if test="item.afternoonPeopleIds != null and item.afternoonPeopleIds != '' " > AFTERNOON_PEOPLE_IDS=#{item.afternoonPeopleIds,jdbcType=VARCHAR}, </if> <if test="item.afternoonPeopleNames != null and item.afternoonPeopleNames != '' " > AFTERNOON_PEOPLE_NAMES=#{item.afternoonPeopleNames,jdbcType=VARCHAR}, </if> <if test="item.eveningPeopleIds != null and item.eveningPeopleIds != '' " > EVENING_PEOPLE_IDS=#{item.eveningPeopleIds,jdbcType=VARCHAR}, </if> <if test="item.eveningPeopleNames != null and item.eveningPeopleNames != '' " > EVENING_PEOPLE_NAMES=#{item.eveningPeopleNames,jdbcType=VARCHAR}, </if> <if test="item.leaderIds != null and item.leaderIds != '' " > LEADER_IDS=#{item.leaderIds,jdbcType=VARCHAR}, </if> <if test="item.leaderNames != null and item.leaderNames != '' " > LEADER_NAMES=#{item.leaderNames,jdbcType=VARCHAR}, </if> </set> where DUTY_ID=#{item.dutyId,jdbcType=INTEGER} </foreach> </update> <!-- 以下是自动生成的sql --> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > select <include refid="Base_Column_List" /> from TB_DUTY where DUTY_ID = #{dutyId,jdbcType=INTEGER} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > delete from TB_DUTY where DUTY_ID = #{dutyId,jdbcType=INTEGER} </delete> <insert id="insert" parameterType="com.sunny.model.duty.Duty" > insert into TB_DUTY (DUTY_ID, DSCD, UNIT_ID, YEAR, MONTH, DAY,DAY0, WEEK_DAY, MORNING_PEOPLE_IDS, MORNING_PEOPLE_NAMES, AFTERNOON_PEOPLE_IDS, AFTERNOON_PEOPLE_NAMES, EVENING_PEOPLE_IDS, EVENING_PEOPLE_NAMES, LEADER_IDS, LEADER_NAMES, FLAG, REMARK) values (SEQ_TB_DUTY.nextval, #{dscd,jdbcType=CHAR}, #{unitId,jdbcType=INTEGER}, #{year,jdbcType=CHAR}, #{month,jdbcType=CHAR}, #{day,jdbcType=CHAR}, #{day0,jdbcType=CHAR},#{weekDay,jdbcType=CHAR}, #{morningPeopleIds,jdbcType=VARCHAR}, #{morningPeopleNames,jdbcType=VARCHAR}, #{afternoonPeopleIds,jdbcType=VARCHAR}, #{afternoonPeopleNames,jdbcType=VARCHAR}, #{eveningPeopleIds,jdbcType=VARCHAR}, #{eveningPeopleNames,jdbcType=VARCHAR}, #{leaderIds,jdbcType=VARCHAR}, #{leaderNames,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="com.sunny.model.duty.Duty" > insert into TB_DUTY <trim prefix="(" suffix=")" suffixOverrides="," > <if test="dutyId != null" > DUTY_ID, </if> <if test="dscd != null" > DSCD, </if> <if test="unitId != null" > UNIT_ID, </if> <if test="year != null" > YEAR, </if> <if test="month != null" > MONTH, </if> <if test="day != null" > DAY, </if> <if test="day0 != null" > DAY0, </if> <if test="weekDay != null" > WEEK_DAY, </if> <if test="morningPeopleIds != null" > MORNING_PEOPLE_IDS, </if> <if test="morningPeopleNames != null" > MORNING_PEOPLE_NAMES, </if> <if test="afternoonPeopleIds != null" > AFTERNOON_PEOPLE_IDS, </if> <if test="afternoonPeopleNames != null" > AFTERNOON_PEOPLE_NAMES, </if> <if test="eveningPeopleIds != null" > EVENING_PEOPLE_IDS, </if> <if test="eveningPeopleNames != null" > EVENING_PEOPLE_NAMES, </if> <if test="leaderIds != null" > LEADER_IDS, </if> <if test="leaderNames != null" > LEADER_NAMES, </if> <if test="flag != null" > FLAG, </if> <if test="remark != null" > REMARK, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides="," > <if test="dutyId != null" > SEQ_TB_DUTY.nextval, </if> <if test="dscd != null" > #{dscd,jdbcType=CHAR}, </if> <if test="unitId != null" > #{unitId,jdbcType=INTEGER}, </if> <if test="year != null" > #{year,jdbcType=CHAR}, </if> <if test="month != null" > #{month,jdbcType=CHAR}, </if> <if test="day != null" > #{day,jdbcType=CHAR}, </if> <if test="day0 != null" > #{day0,jdbcType=CHAR}, </if> <if test="weekDay != null" > #{weekDay,jdbcType=CHAR}, </if> <if test="morningPeopleIds != null" > #{morningPeopleIds,jdbcType=VARCHAR}, </if> <if test="morningPeopleNames != null" > #{morningPeopleNames,jdbcType=VARCHAR}, </if> <if test="afternoonPeopleIds != null" > #{afternoonPeopleIds,jdbcType=VARCHAR}, </if> <if test="afternoonPeopleNames != null" > #{afternoonPeopleNames,jdbcType=VARCHAR}, </if> <if test="eveningPeopleIds != null" > #{eveningPeopleIds,jdbcType=VARCHAR}, </if> <if test="eveningPeopleNames != null" > #{eveningPeopleNames,jdbcType=VARCHAR}, </if> <if test="leaderIds != null" > #{leaderIds,jdbcType=VARCHAR}, </if> <if test="leaderNames != null" > #{leaderNames,jdbcType=VARCHAR}, </if> <if test="flag != null" > #{flag,jdbcType=INTEGER}, </if> <if test="remark != null" > #{remark,jdbcType=VARCHAR}, </if> </trim> </insert> <update id="updateByPrimaryKeySelective" parameterType="com.sunny.model.duty.Duty" > update TB_DUTY <set > <if test="dscd != null" > DSCD = #{dscd,jdbcType=CHAR}, </if> <if test="unitId != null" > UNIT_ID = #{unitId,jdbcType=INTEGER}, </if> <if test="year != null" > YEAR = #{year,jdbcType=CHAR}, </if> <if test="month != null" > MONTH = #{month,jdbcType=CHAR}, </if> <if test="day != null" > DAY = #{day,jdbcType=CHAR}, </if> <if test="day0 != null" > DAY0 = #{day0,jdbcType=CHAR}, </if> <if test="weekDay != null" > WEEK_DAY = #{weekDay,jdbcType=CHAR}, </if> <if test="morningPeopleIds != null" > MORNING_PEOPLE_IDS = #{morningPeopleIds,jdbcType=VARCHAR}, </if> <if test="morningPeopleNames != null" > MORNING_PEOPLE_NAMES = #{morningPeopleNames,jdbcType=VARCHAR}, </if> <if test="afternoonPeopleIds != null" > AFTERNOON_PEOPLE_IDS = #{afternoonPeopleIds,jdbcType=VARCHAR}, </if> <if test="afternoonPeopleNames != null" > AFTERNOON_PEOPLE_NAMES = #{afternoonPeopleNames,jdbcType=VARCHAR}, </if> <if test="eveningPeopleIds != null" > EVENING_PEOPLE_IDS = #{eveningPeopleIds,jdbcType=VARCHAR}, </if> <if test="eveningPeopleNames != null" > EVENING_PEOPLE_NAMES = #{eveningPeopleNames,jdbcType=VARCHAR}, </if> <if test="leaderIds != null" > LEADER_IDS = #{leaderIds,jdbcType=VARCHAR}, </if> <if test="leaderNames != null" > LEADER_NAMES = #{leaderNames,jdbcType=VARCHAR}, </if> <if test="flag != null" > FLAG = #{flag,jdbcType=INTEGER}, </if> <if test="remark != null" > REMARK = #{remark,jdbcType=VARCHAR}, </if> </set> where DUTY_ID = #{dutyId,jdbcType=INTEGER} </update> <update id="updateByPrimaryKey" parameterType="com.sunny.model.duty.Duty" > update TB_DUTY set DSCD = #{dscd,jdbcType=CHAR}, UNIT_ID = #{unitId,jdbcType=INTEGER}, YEAR = #{year,jdbcType=CHAR}, MONTH = #{month,jdbcType=CHAR}, DAY = #{day,jdbcType=CHAR}, DAY0 = #{day0,jdbcType=CHAR}, WEEK_DAY = #{weekDay,jdbcType=CHAR}, MORNING_PEOPLE_IDS = #{morningPeopleIds,jdbcType=VARCHAR}, MORNING_PEOPLE_NAMES = #{morningPeopleNames,jdbcType=VARCHAR}, AFTERNOON_PEOPLE_IDS = #{afternoonPeopleIds,jdbcType=VARCHAR}, AFTERNOON_PEOPLE_NAMES = #{afternoonPeopleNames,jdbcType=VARCHAR}, EVENING_PEOPLE_IDS = #{eveningPeopleIds,jdbcType=VARCHAR}, EVENING_PEOPLE_NAMES = #{eveningPeopleNames,jdbcType=VARCHAR}, LEADER_IDS = #{leaderIds,jdbcType=VARCHAR}, LEADER_NAMES = #{leaderNames,jdbcType=VARCHAR}, FLAG = #{flag,jdbcType=INTEGER}, REMARK = #{remark,jdbcType=VARCHAR} where DUTY_ID = #{dutyId,jdbcType=INTEGER} </update> </mapper>
Mapper:
package com.sunny.dao.duty; import java.util.List; import java.util.Map; import org.apache.ibatis.annotations.Param; import com.sunny.model.duty.Duty; public interface DutyMapper { int deleteByPrimaryKey(@Param(value="dutyId")Integer dutyId); int insert(Duty record); int insertSelective(Duty record); Duty selectByPrimaryKey(@Param(value="dutyId")Integer dutyId); int updateByPrimaryKeySelective(Duty record); int updateByPrimaryKey(Duty record); //以下是自定义的 // List<Duty> selectByUnitIdAndYear(@Param(value="unitId")Integer unitId,@Param(value="year")Integer year); // List<Duty> selectListByConditions(@Param(value="dscd")String dscd,@Param(value="unitId")Integer unitId, @Param(value="year")String year,@Param(value="month")String month,@Param(value="flag")Integer flag); // int addMonthDutyIntoDB(@Param(value="list")List<Duty> list); // List<Map<String, Object>> getDutyByCondition(@Param(value="dscd")String dscd,@Param(value="unitId")Integer unitId, @Param(value="year")Integer year,@Param(value="month")Integer month,@Param(value="flag")Integer flag); // int delById(@Param(value="dscd")String dscd,@Param(value="unitId")Integer unitId, @Param(value="year")String year,@Param(value="month")String month,@Param(value="flag")Integer flag); // int delMultiByIds2(List<Duty> list); // int selectRecordExists(@Param(value="dscd")String dscd,@Param(value="unitId")Integer unitId, @Param(value="year")String year,@Param(value="month")String month,@Param(value="flag")Integer flag); // int updateByMultiConditions(@Param(value="list")List<Duty> list); // List<Map<String, Object>> selectTodayDutyList(@Param(value="dscd")String dscd,@Param(value="unitId")Integer unitId, @Param(value="day0")String day0,@Param(value="flag")Integer flag); // List<Map<String, Object>> getTodayDutyInfo(@Param(value="dscdStr")String dscd,@Param(value="unitIdInt")Integer unitId, @Param(value="day0Str")String day0,@Param(value="flagInt")Integer flag); // List<Map<String, Object>> selectPreDutyList(@Param(value="dscd")String dscd,@Param(value="unitId")Integer unitId, @Param(value="day0")String day0,@Param(value="flag")Integer flag); // List<Map<String, Object>> selectNextDutyList(@Param(value="dscd")String dscd,@Param(value="unitId")Integer unitId, @Param(value="day0")String day0,@Param(value="flag")Integer flag); // List<Map<String, Object>> selectPersonalDutyList(@Param(value="dscd")String dscd,@Param(value="unitId")Integer unitId, @Param(value="year")String year,@Param(value="month")String month,@Param(value="personId")String personId); }
创建、释放、查找、提交、撤销登记、关闭 sqlsession
发表评论
-
数据库sql、mybatis、堆栈
2016-04-01 16:00 6591、数据库方面 SQL SERVER: select r.id ... -
mybatis直接执行前台传递的sql语句(mapper参数即为sql字符串)
2016-03-23 13:24 34301、dao.java public List<Map& ... -
mybatis针对Oracle数据库进行(单个或多个条件)批量操作(新增、修改、删除)的sql写法--mysql
2015-08-19 13:12 54771、批量新增: 方式一: <insert id ... -
ibatis3
2013-04-25 13:43 843MyBatis是支持普通SQL查询,存储过程和高级映射的优秀持 ...
相关推荐
在Spring Boot集成MyBatis的过程中,`mapper.xml`配置文件起着至关重要的作用。它用于定义SQL语句,实现数据库的CRUD操作。本示例将深入探讨如何配置`mapper.xml`,并提供新增、修改、删除、查询及分页查询的实践...
3. **配置Mybatis**:在项目的Mybatis配置文件(mybatis-config.xml)中,需要引入刚刚生成的mapper.xml文件,使得Mybatis能够找到并解析它们。 4. **编写mapper接口**:虽然逆向工具会生成基础的mapper接口和实现...
本项目利用Spring Boot的自动配置特性,配合MyBatis作为持久层框架,以及Mapper.xml文件进行SQL映射,实现了数据访问的便捷性。下面将详细阐述这个项目中的关键知识点。 1. **Spring Boot**: Spring Boot是Spring...
MyBatis会根据Mapper.xml中的SQL语句动态生成SQL并执行。 总的来说,SpringBoot整合MyBatis并自动生成Mapper.xml文件,大大提高了开发效率,降低了手动编写SQL和映射代码的工作量。同时,通过MBG的定制化功能,可以...
总结来说,"mybatis联表查询mapper.xml"涉及到的主要知识点有:MyBatis的Mapper接口和XML配置,一对多关联查询的实现,以及实体类和DAO层的设计。理解并熟练掌握这些内容,对于进行复杂的数据库操作和优化数据访问...
`mapper.xml`文件是MyBatis中定义SQL语句的地方,它可以包含增删查改的各种SQL语句,以及结果映射。在每个`mapper.xml`文件中,你可以声明`select`、`insert`、`update`、`delete`元素,每个元素对应一个SQL操作。...
MyBatis的XML映射文件是配置Mapper接口方法与SQL语句关联的关键部分。每个XML映射文件通常对应一个Mapper接口,其中包含`select`, `insert`, `update`, `delete`等元素,这些元素定义了对应的SQL操作。例如: ```...
总结来说,Mybatis Generator是提高开发效率的重要工具,通过合理配置`generatorConfig.xml`文件,可以自动化地生成Mybatis所需的Model、Mapper接口和mapper.xml文件。在SSM项目中,这种自动化代码生成极大地降低了...
接下来是`Mapper.xml`,这是MyBatis的核心组件之一,用于存放SQL语句和结果映射。MBG可以自动生成这些映射文件,包括插入、更新、删除和查询等各种操作,开发者只需根据需求进行适当修改。每个Mapper.xml文件通常与...
Mapper.xml文件是Mybatis的核心组件,它包含了数据库操作的SQL语句和映射规则。 在处理字符串形式的多选参数时,我们通常会先在服务层将这些参数转换为Java集合,如List或Set。例如,如果用户选择的标签以逗号分隔...
在 Mybatis 中,`mybatis-3-mapper.dtd` 文件扮演着至关重要的角色,它是 Mybatis 映射器接口的定义文件,用于验证 XML 映射文件的语法正确性。 `mybatis-3-mapper.dtd` 文件是基于 DTD(Document Type Definition...
Mapper接口是MyBatis的核心组成部分,它定义了数据库操作的方法,而Mapper XML文件则包含了这些方法对应的SQL语句和结果映射。在传统的开发流程中,当需要查看或修改SQL时,开发者需要手动在众多的XML文件中寻找对应...
你可以将这个压缩包中的`mybatis-3-mapper.dtd`文件复制到本地,并在MyBatis的配置文件中指定本地DTD文件的位置,这样即使没有网络,MyBatis也能正确解析XML映射文件。 为了做到这一点,你需要在MyBatis的配置文件...
mybatis修改了mapper xml不用重启tomcat,热发布热更新.zip