ibatis中的xml配置文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd" >
<sqlMap namespace="EOC_MUSIC">
<typeAlias alias="EOC_MUSICTYPE_JSON"
type="com.ecar.eoc.content.music.domain.music.json.MusicTypeJson" />
<typeAlias alias="EOC_MUSICTYPE"
type="com.ecar.eoc.content.music.domain.music.MusicType" />
<resultMap id="EOC_MUSICTYPE_JSON_MAP" class="EOC_MUSICTYPE_JSON">
<result column="TYPE_CODE" property="typeCode" jdbcType="VARCHAR" />
<result column="NAME" property="name" jdbcType="VARCHAR" />
<result column="LOGO" property="logo" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="EOC_MUSICTYPE_MAP" class="EOC_MUSICTYPE">
<result column="TYPE_CODE" property="typeCode" jdbcType="VARCHAR" />
<result column="NAME" property="name" jdbcType="VARCHAR" />
<result column="CATEGORY_CODE" property="categoryCode" jdbcType="VARCHAR" />
<result column="CP_CODE" property="cpCode" jdbcType="VARCHAR" />
<result column="SUPPLIER_TYPE_CODE" property="supplierTypeCode" jdbcType="VARCHAR" />
<result column="SUPPLIER_CATEGORY_CODE" property="supplierCategoryCode" jdbcType="VARCHAR" />
<result column="MD5" property="md5" jdbcType="VARCHAR" />
<result column="LOGO" property="logo" jdbcType="VARCHAR" />
<result column="NUM" property="num" jdbcType="INTEGER" />
<result column="ORDERBY" property="orderBy" jdbcType="INTEGER" />
<result column="RANKING" property="ranking" jdbcType="INTEGER" />
</resultMap>
<sql id="musicTypeWhere">
<dynamic prepend="WHERE">
<isNotNull prepend="and" property="typeId">
TYPE_ID = #typeId:INTEGER#
</isNotNull>
<isNotNull prepend="and" property="typeCode">
TYPE_CODE = #typeCode:VARCHAR#
</isNotNull>
<isNotNull prepend="and" property="name">
NAME = #name:VARCHAR#
</isNotNull>
<isNotNull prepend="and" property="categoryCode">
CATEGORY_CODE = #categoryCode:VARCHAR#
</isNotNull>
<isNotNull prepend="and" property="logo">
LOGO = #logo:VARCHAR#
</isNotNull>
<isNotNull prepend="and" property="cpCode">
CP_CODE = #cpCode:VARCHAR#
</isNotNull>
<isNotNull prepend="and" property="supplierTypeCode">
SUPPLIER_TYPE_CODE = #supplierTypeCode:VARCHAR#
</isNotNull>
<isNotNull prepend="and" property="supplierCategoryCode">
SUPPLIER_CATEGORY_CODE = #supplierCategoryCode:VARCHAR#
</isNotNull>
<isNotNull prepend="and" property="isValid">
IS_VALID = #isValid:VARCHAR#
</isNotNull>
<isNotNull prepend="and" property="md5">
MD5 = #md5:VARCHAR#
</isNotNull>
<isNotNull prepend="and" property="createTime">
CREATE_TIME = #createTime:DATE#
</isNotNull>
<isNull prepend="and" property="ranking">
RANKING IS NULL
</isNull>
<isNotNull prepend="and" property="ranking">
RANKING = #ranking:INTEGER#
</isNotNull>
ORDER BY ORDERBY
</dynamic>
</sql>
<select id="findAllMusicType" resultMap="EOC_MUSICTYPE_JSON_MAP" parameterClass="java.util.HashMap">
select m.TYPE_CODE,m.NAME,m.LOGO
from EOC_CONTENT_MUSIC_TYPE m
where m.CP_CODE=#coCode:VARCHAR# and m.IS_VALID = #isValid:VARCHAR#
</select>
<select id="findMusicTypeByTypeCode" resultMap="EOC_MUSICTYPE_MAP" parameterClass="java.util.HashMap">
select m.TYPE_CODE,m.NAME,m.CATEGORY_CODE,m.CP_CODE,m.SUPPLIER_TYPE_CODE,m.SUPPLIER_CATEGORY_CODE,m.MD5,m.NUM
from EOC_CONTENT_MUSIC_TYPE m
where m.TYPE_CODE=#typeCode:VARCHAR# and m.IS_VALID = #isValid:VARCHAR#
</select>
<select id="findMusicTypeByCpCode" resultMap="EOC_MUSICTYPE_MAP" parameterClass="java.util.HashMap">
select m.TYPE_CODE,m.NAME,m.CATEGORY_CODE,m.CP_CODE,m.SUPPLIER_TYPE_CODE,m.SUPPLIER_CATEGORY_CODE,m.MD5,m.NUM
from EOC_CONTENT_MUSIC_TYPE m
where m.CP_CODE=#cpCode:VARCHAR# and m.IS_VALID = #isValid:VARCHAR#
</select>
<update id="updateMusicTypeMd5" parameterClass="java.util.HashMap">
UPDATE EOC_CONTENT_MUSIC_TYPE
SET MD5=#md5:VARCHAR#
WHERE TYPE_CODE =#typeCode:VARCHAR#
</update>
<select id="musictype_selectByObject" parameterClass="EOC_MUSICTYPE" resultMap="EOC_MUSICTYPE_MAP">
select TYPE_ID, TYPE_CODE, NAME, CATEGORY_CODE, LOGO, CP_CODE, SUPPLIER_TYPE_CODE,SUPPLIER_CATEGORY_CODE, IS_VALID, MD5, CREATE_TIME,NUM,RANKING,ORDERBY
from EOC_CONTENT_MUSIC_TYPE
<include refid="musicTypeWhere"/>
LIMIT 20
</select>
<select id="MusicType_count_max" resultClass="java.lang.Integer" >
SELECT (MAX(TYPE_CODE)+1) COUNT FROM EOC_CONTENT_MUSIC_TYPE
</select>
<delete id="deleteMusic_type" parameterClass="com.ecar.eoc.content.music.domain.music.MusicType">
DELETE FROM `EOC_CONTENT_MUSIC_TYPE`
<include refid="musicTypeWhere"/>
</delete>
<insert id="insert_music_type" parameterClass="EOC_MUSICTYPE">
INSERT INTO EOC_CONTENT_MUSIC_TYPE
<dynamic prepend="(">
<isNotNull prepend="," property="typeId">
TYPE_ID
</isNotNull>
<isNotNull prepend="," property="typeCode">
TYPE_CODE
</isNotNull>
<isNotEmpty prepend="," property="name">
NAME
</isNotEmpty>
<isNotEmpty prepend="," property="categoryCode">
CATEGORY_CODE
</isNotEmpty>
<isNotEmpty prepend="," property="logo">
LOGO
</isNotEmpty>
<isNotEmpty prepend="," property="cpCode">
CP_CODE
</isNotEmpty>
<isNotEmpty prepend="," property="supplierTypeCode">
SUPPLIER_TYPE_CODE
</isNotEmpty>
<isNotEmpty prepend="," property="supplierCategoryCode">
SUPPLIER_CATEGORY_CODE
</isNotEmpty>
<isNotEmpty prepend="," property="isValid">
IS_VALID
</isNotEmpty>
<isNotEmpty prepend="," property="md5">
MD5
</isNotEmpty>
<isNotEmpty prepend="," property="orderBy">
ORDERBY
</isNotEmpty>
<isNotEmpty prepend="," property="num">
NUM
</isNotEmpty>
<isNotEmpty prepend="," property="ranking">
RANKING
</isNotEmpty>
<isNotEmpty prepend="," property="createTime">
CREATE_TIME
</isNotEmpty>
)
</dynamic>
values
<dynamic prepend="(">
<isNotNull prepend="," property="typeId">
#typeId:INTEGER#
</isNotNull>
<isNotEmpty prepend="," property="typeCode">
#typeCode:VARCHAR#
</isNotEmpty>
<isNotEmpty prepend="," property="name">
#name:VARCHAR#
</isNotEmpty>
<isNotNull prepend="," property="categoryCode">
#categoryCode:VARCHAR#
</isNotNull>
<isNotEmpty prepend="," property="logo">
#logo:VARCHAR#
</isNotEmpty>
<isNotEmpty prepend="," property="cpCode">
#cpCode:VARCHAR#
</isNotEmpty>
<isNotNull prepend="," property="supplierTypeCode">
#supplierTypeCode:VARCHAR#
</isNotNull>
<isNotEmpty prepend="," property="supplierCategoryCode">
#supplierCategoryCode:VARCHAR#
</isNotEmpty>
<isNotEmpty prepend="," property="isValid">
#isValid:VARCHAR#
</isNotEmpty>
<isNotNull prepend="," property="md5">
#md5:VARCHAR#
</isNotNull>
<isNotEmpty prepend="," property="orderBy">
#orderBy:INTEGER#
</isNotEmpty>
<isNotEmpty prepend="," property="num">
#num:INTEGER#
</isNotEmpty>
<isNotEmpty prepend="," property="ranking">
#ranking:INTEGER#
</isNotEmpty>
<isNotEmpty prepend="," property="createTime">
#createTime:DATE#
</isNotEmpty>
)
</dynamic>
<selectKey resultClass="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
</insert>
</sqlMap>
ibatis中的xml配置文件的更多相关文章
- SPRING IN ACTION 第4版笔记-第二章WIRING BEANS-008-在Java配置文件中引入xml配置文件@Import、@ImportResource
1. package soundsystem; import org.springframework.beans.factory.annotation.Autowired; public class ...
- mybatis 中的 xml 配置文件中 ‘<’、 ‘>’ 处理
mybatis 中的 xml 配置文件中 '<'. '>' 处理 1.使用转义字符将 '<'. '>' 替换掉. 描述 字符 转义字符 小于号 < < 大于号 &g ...
- ssh整合思想初步 struts2与Spring的整合 struts2-spring-plugin-2.3.4.1.jar下载地址 自动加载Spring中的XML配置文件 Struts2下载地址
首先需要JAR包 Spring整合Structs2的JAR包 struts2-spring-plugin-2.3.4.1.jar 下载地址 链接: https://pan.baidu.com/s/1o ...
- Winform中自定义xml配置文件后对节点进行读取与写入
场景 Winform中自定义xml配置文件,并配置获取文件路径: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/100522648 ...
- Java中的Xml配置文件(新手)
Java中的Xml配置文件,本文是转发转发转发!重要的事情说三遍 一:概念 1.XML Extensible markup Language 可拓展标记语言 2.功能:存储数据(配置文件,在网络中传 ...
- struts2中struts.xml配置文件详解【未整理】
1. 深入Struts2的配置文件 本部分主要介绍struts.xml的常用配置. 1.1. 包配置: Struts2框架中核心组件就是Action.拦截器等,Struts2框架使用包来管 ...
- struts2.0中struts.xml配置文件详解
先来展示一个配置文件 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration ...
- struts2中struts.xml配置文件详解
struts.xml的常用配置 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts ...
- SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释(转)
原文:https://blog.csdn.net/yijiemamin/article/details/51156189# 这几天一直在整合SSM框架,虽然网上有很多已经整合好的,但是对于里面的配置文 ...
随机推荐
- 在js中怎样获得checkbox里选中的多个值?(jQuery)
思路:利用name属性值获取checkbox对象,然后循环判断checked属性(true表示被选中,false表示未选中).下面进行实例演示: 1.HTML结构 <input type=&qu ...
- Java 11 正式发布,支持期限至2026年9月
美国当地时间9月25日,Oracle 官方宣布 Java 11 (18.9 LTS) 正式发布,可在生产环境中使用!这是自 Java 8 后的首个长期支持版本,非常值得大家的关注,可以通过下面的地址进 ...
- IOS文件下载
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, ...
- Android系统级技巧合集
Android系统级技巧合集(随时更新) #转载请注明来源# 1.高通骁龙系列查看CPU体质等级 CPU体质,即为CPU在工作频率下的电压.同一批次的CPU体质各有不同,体质越高,代表该颗CPU可在更 ...
- ubuntu 安装 pcap
最近在做负载均衡配置,希望将多个dhcp服务配置成一个虚拟dhcp地址,实现dhcp服务高可用.然而配置完成后却发现一个问题,该如何测试呢. 因此就要用上python了,然后ubuntu下面用pip ...
- mysql登录(linux)
一.修改配置文件 查询路径 find / -name my.cnf 修改文件 vi my.cnf [mysqld]下面加上skip-grant-tables 二.登录数据库 重启mysql servi ...
- QT +菜单栏和工具栏
#include "mainwindow.h" #include <QMenuBar>//菜单栏需要的头文件 #include <QMenu>//菜单 #i ...
- luogu P2734 游戏 A Game
https://www.luogu.org/problemnew/show/P2734 数据范围比较小,二位DP可做,而luogu 3004,虽然几乎一模一样(只是数据范围大点),则需要压维. 定义f ...
- 28. TRIGGERS ,29. USER_PRIVILEGES,30. VIEWS
28. TRIGGERS TRIGGERS表提供有关触发器的信息.要查看有关表的触发器的信息,您必须具有该表的TRIGGER权限. TRIGGERS表有以下列: TRIGGER_CATALOG :触发 ...
- transformer模型解读
最近在关注谷歌发布关于BERT模型,它是以Transformer的双向编码器表示.顺便回顾了<Attention is all you need>这篇文章主要讲解Transformer编码 ...