您好,登錄后才能下訂單哦!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<properties resource="META-INF/properties/dbms.properties"></properties>
<settings>
<setting name="cacheEnabled" value="true" /> <!-- mybatis cache ???? -->
<setting name="lazyLoadingEnabled" value="true" /> <!-- ???? ???? -->
<setting name="multipleResultSetsEnabled" value="true" /> <!-- ? ?? ???? ?? ?? ResultSet? ???? ?? -->
<setting name="useColumnLabel" value="true" /> <!-- ??? ?? ?? ??? ?? -->
<setting name="useGeneratedKeys" value="false" /> <!-- ???? ?? JDBC ?? ?? ?? -->
<setting name="autoMappingBehavior" value="PARTIAL" /> <!-- mybatis? ??? ??/????? ???? ????? ??? ?? ??(PARTIAL? ???? ?? ??? ?? -->
<setting name="defaultExecutorType" value="SIMPLE" /> <!-- ??? Executor ??(SIMPLE? ??? ???? ?? ??) -->
<setting name="defaultStatementTimeout" value="10" /> <!-- DB ?? ???? ?? -->
<setting name="safeRowBoundsEnabled" value="false" /> <!-- ????? RowBound ?? ???? -->
<setting name="mapUnderscoreToCamelCase" value="false" /> <!-- ??? DB ???? JAVA? Camel????? ?? ?? ?? -->
<setting name="localCacheScope" value="SESSION" /> <!-- ???? ????(SESSION: ??? ???? ????? ??) -->
<setting name="jdbcTypeForNull" value="NULL" /> <!-- mybatis? ???? parameter? null? ??, jdbcType? Setting -->
<setting name="lazyLoadTriggerMethods" value="equals,clone,hashCode,toString" /> <!-- ????? ???? ??? ???? ?? -->
<setting name="callSettersOnNulls" value="true" /> <!-- ??? ?? null?? setter? ?? put ???? ????? ?? (false???, null? field? ???? ??? : default? false -->
</settings>
<mappers>
<!-- <property name="mapperLocations" value="classpath:META-INF/persistence/mybatis/${dbms.kind}/*Mapper.xml"></property> -->
<mapper resource="META-INF/persistence/mybatis/${dbms.kind}/GoodsMapper.xml" />
<mapper resource="META-INF/persistence/mybatis/${dbms.kind}/Paging.xml" />
<mapper resource="META-INF/persistence/mybatis/${dbms.kind}/SurveyMapper.xml" />
</mappers>
</configuration>
<?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="paging">
<!-- ???? ?? ?? QUERY ???..??? ?? ????? ?? ????.. -->
<sql id="pagingPreSQL">
SELECT * FROM (
SELECT ROWNUM AS "ROWNUMBER" , AA.* FROM (
</sql>
<sql id="pagingPostSQL">
) AA ) AAA
<![CDATA[
WHERE AAA.ROWNUMBER >= #{firstRowIndex} AND AAA.ROWNUMBER <= #{lastRowIndex}
]]>
</sql>
<sql id="pagingPreSqlOverCount">
SELECT FLOOR((AA.totalCount-1)/#{rowPerPage})+1 totalPage , AA.* FROM (
SELECT COUNT(*) OVER() totalCount, ROWNUM ROWNUMBER,MAINSQL.* FROM
(
</sql>
<sql id="pagingPostSqlOverCount">
) MAINSQL
<![CDATA[ ) AA WHERE ROWNUMBER>=((#{pageNo}-1)*#{rowPerPage})+1 AND ROWNUMBER <= (((#{pageNo}-1)*#{rowPerPage})+1) + #{rowPerPage}-1 ]]>
</sql>
</mapper>
<?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="FileUploadDataMapper">
<select id="getFileUploadData" parameterType="java.util.Map"
resultType="java.util.Map">
SELECT [Number]
,[FileGuid]
,[FileId]
,[FilePath]
,[FileName]
,[FileType]
,[FileSize]
,[CreateTime]
FROM [dbo].[AA_FileUploadData]
WHERE 1=1
<if test="FileGuid !=null and FileGuid !='' ">
AND FileGuid= #{FileGuid}
</if>
<if test="FileId !=null and FileId !='' ">
AND FileId= #{FileId}
</if>
</select>
<select id="getFileUploadDataList" parameterType="java.util.Map"
resultType="java.util.Map">
<include refid="paging.pagingPreSQL" />
select ROW_NUMBER() over(order by Number desc )
rownum,[Number]
,[FileGuid]
,[FileId]
,[FilePath]
,[FileName]
,[FileType]
,[FileSize]
,[CreateTime]
from AA_FileUploadData
where 1=1
<if test="FileGuid !=null and FileGuid !='' ">
AND FileGuid= #{FileGuid}
</if>
<if test="FileId !=null and FileId !='' ">
AND FileId= #{FileId}
</if>
<include refid="paging.pagingPostSQL" />
</select>
<select id="getFileUploadDataListCnt" parameterType="java.util.Map"
resultType="java.lang.Integer">
select count(1) as "totalCnt"
from AA_FileUploadData
where 1=1
<if test="FileGuid !=null and FileGuid !='' ">
AND FileGuid= #{FileGuid}
</if>
<if test="FileId !=null and FileId !='' ">
AND FileId= #{FileId}
</if>
</select>
<!-- useGeneratedKeys="true" keyProperty="GoodsID" -->
<insert id="insertFileUploadData" parameterType="java.util.Map">
<selectKey resultType="int" keyProperty="Number" order="AFTER">
select
@@IDENTITY as id
</selectKey>
INSERT INTO [dbo].[AA_FileUploadData]
([FileGuid]
,[FileId]
,[FilePath]
,[FileName]
,[FileType]
,[FileSize]
,[CreateTime])
VALUES
(
#{FileGuid},
#{FileId},
#{FilePath},
#{FileName},
#{FileType},
#{FileSize},
GetDate()
)
</insert>
<delete id="deleteFileUploadData" parameterType="java.util.Map">
DELETE FROM AA_FileUploadData
WHERE FileGuid = #{FileGuid}
<if test="FileId !=null and FileId !='' ">
AND FileId = #{FileId}
</if>
</delete>
</mapper>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。