IBATIS2.0映射文件 oraclemysql 版实现示例,功能全面且丰富

IBATIS2.0映射文件 oraclemysql 版实现示例,功能全面且丰富,第1张

概述IBATIS2.0映射文件 oracle/mysql 版实现示例功能全面且丰富

下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。

内存溢出小编现在分享给大家,也给大家做个参考。

<?xml version="1.0" enCoding="UTF-8" standalone="no"?><!DOCTYPE sqlMap PUBliC "-//iBATIS.com//DTD sql Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"><sqlMap namespace="HuGoods">	<!-- hu_goods -->	<sql ID="Goods_Base_Column_List" >    <!--      WARNING - @mbggenerated      This element is automatically generated by MyBatis Generator,do not modify.      This element was generated on Fri Dec 12 11:53:06 CST 2014.    -->    HUGS_ID,HUGS_name,HUGS_BRAND,HUGS_VERSION,HUGS_PRODUCT_DATE,HUGS_ASSET_CODE,HUGS_PRICE,HUGS_DEPT_ID,HUGS_DEPT_name,HUGS_USER_ID,HUGS_USER_name,HUGS_USE_RESON,HUGS_USE_STATUS,HUGS_DESCR,HUGS_STATUS,HUGS_CREATOR,HUGS_CREATE_TIME,HUGS_UPDATE,HUGS_UPDATE_TIME,HUGS_COMPANY  	</sql>  	<!-- where条件 -->	<sql ID="Goods_Where_Clause" >		<dynamic prepend="WHERE HUGS_STATUS = 1">			<isNotEmpty property="HUGS_ASSET_CODE">				AND HUGS_ASSET_CODE liKE '%$HUGS_ASSET_CODE$%'			</isNotEmpty>			<isNotEmpty property="HUGS_name">				AND HUGS_name liKE '%$HUGS_name$%'			</isNotEmpty>			<isNotEmpty property="HUGS_DEPT_name">				AND HUGS_DEPT_name liKE '%$HUGS_DEPT_name$%'			</isNotEmpty>			<isNotEmpty property="HUGS_USER_name">				AND HUGS_USER_name liKE '%$HUGS_USER_name$%'			</isNotEmpty>			<isNotEmpty property="HUGS_USE_RESON">				AND HUGS_USE_RESON liKE '%$HUGS_USE_RESON$%'			</isNotEmpty>			<isNotEmpty property="HUGS_COMPANY">				AND HUGS_COMPANY = #HUGS_COMPANY#			</isNotEmpty>		</dynamic>  	</sql>	<!-- 物资总数 -->	<select ID="getGoodsListCnt" resultClass="java.lang.Integer"		parameterClass="java.util.HashMap">		SELECT COUNT(*) FROM HU_GOODS		<isParameterPresent >	      <include refID="HuGoods.Goods_Where_Clause" />    	</isParameterPresent>	</select>	<!-- 物资分页集合查询 -->	<select ID="getGoodsPagelist" resultClass="java.util.HashMap"		parameterClass="java.util.HashMap">		<!-- oracle version  -->		SELECT * FROM		(				SELECT					A .*,ROWNUM r				FROM					(							SELECT <include refID="HuGoods.Goods_Base_Column_List" />					FROM HU_GOODS						<isParameterPresent >						<include refID="HuGoods.Goods_Where_Clause" />							<isNotEmpty property="sortFIEld">						ORDER BY $sortFIEld$ $sortOrder$							</isNotEmpty>						</isParameterPresent>					) A				WHERE					ROWNUM <![cdaTA[ <= ]]> #end#		) B		WHERE r <![cdaTA[>]]> #start#		<!-- MysqL version  -->		<!-- 		SELECT <include refID="HuGoods.Goods_Base_Column_List" />		FROM HU_GOODS	    <isParameterPresent >		  <include refID="HuGoods.Goods_Where_Clause" />	      <isNotEmpty property="sortFIEld">			ORDER BY $sortFIEld$ $sortOrder$	      </isNotEmpty>    	</isParameterPresent>		liMIT #start#,#end#		 -->	</select>	<!-- 物资EXLS导出数据 -->	<select ID="getGoodsEXLSList" resultClass="java.util.HashMap"		parameterClass="java.util.HashMap">		<!-- oracle version  -->			SELECT		    (		      SELECT 		          WM_CONCAT (		          EM.HUGI_DESCR || ' ' ||'变更时间:'||TO_CHAR(EM.HUGI_CHANGE_DATE,'YYYY-MM-DD')		          )		      FROM		        HU_GOODS_ITEM EM		      WHERE		        EM.HUGI_GOODS_ID = GOODS.HUGS_ID		    ) AS ITEMS,GOODS.HUGS_name,GOODS.HUGS_BRAND,GOODS.HUGS_VERSION,GOODS.HUGS_PRODUCT_DATE,GOODS.HUGS_ASSET_CODE,GOODS.HUGS_PRICE,GOODS.HUGS_DEPT_name,GOODS.HUGS_USER_name,GOODS.HUGS_USE_RESON,GOODS.HUGS_DESCR,GOODS.HUGS_COMPANY,CASE GOODS.HUGS_USE_STATUS		  WHEN 1 THEN		    '使用中'		  WHEN 2 THEN		    '在库'		  ELSE		    '作废'		  END HUGS_USE_STATUS,CASE GOODS.HUGS_CHECK_STATUS		  WHEN 0 THEN		    '尚未盘点'		  WHEN -1 THEN		    '问题物资'		  ELSE		    '盘点无误'		  END HUGS_CHECK_STATUS		  FROM		    HU_GOODS GOODS			<isParameterPresent >		      <include refID="HuGoods.Goods_Where_Clause" />	    	</isParameterPresent>		  ORDER BY		    GOODS.HUGS_ID ASC		<!-- MysqL version  -->		<!-- 		SELECT			GROUP_CONCAT(				CONCAT(					"变更:",CONVERT (						IFNulL(EM.HUGI_USER_ID,""),CHAR					),"_",IFNulL(EM.HUGI_USER_name,IFNulL(EM.HUGI_DEPT_name,IFNulL(EM.HUGI_DESCR,"")				)			) AS ITEMS,CASE GOODS.HUGS_USE_STATUS		WHEN '1' THEN			'使用中'		WHEN '2' THEN			'在库'		ELSE			'作废'		END HUGS_USE_STATUS		FROM			HU_GOODS GOODS		left JOIN HU_GOODS_ITEM EM ON EM.HUGI_GOODS_ID = GOODS.HUGS_ID		GROUP BY			GOODS.HUGS_ID		ORDER BY			GOODS.HUGS_ID ASC			 -->	</select>	<!-- 查询物资公司种类 -->	<select ID="getGoodsCompany" resultClass="java.util.HashMap"		parameterClass="java.util.HashMap">		SELECT OG.HUGS_COMPANY FROM HU_GOODS OG		WHERE OG.HUGS_ID IN(		SELECT MAX(GOOD.HUGS_ID) FROM HU_GOODS GOOD		GROUP BY GOOD.HUGS_COMPANY		)		ORDER BY OG.HUGS_ID ASC	</select>	<!-- 添加物资 -->	<insert ID="addGoods" parameterClass="java.util.HashMap">		<!-- MysqL version -->		<!-- 		INSERT INTO HU_GOODS (		`HUGS_ID`,`HUGS_name`,`HUGS_BRAND`,`HUGS_VERSION`,`HUGS_PRODUCT_DATE`,`HUGS_ASSET_CODE`,`HUGS_PRICE`,`HUGS_DEPT_ID`,`HUGS_DEPT_name`,`HUGS_USER_ID`,`HUGS_USER_name`,`HUGS_USE_RESON`,`HUGS_USE_STATUS`,`HUGS_DESCR`,`HUGS_STATUS`,`HUGS_CREATOR`,`HUGS_CREATE_TIME`,`HUGS_UPDATE`,`HUGS_UPDATE_TIME`		)		VALUES		(		NulL,#HUGS_name#,#HUGS_BRAND#,#HUGS_VERSION#,#HUGS_PRODUCT_DATE#,#HUGS_ASSET_CODE#,#HUGS_PRICE#,#HUGS_DEPT_ID#,#HUGS_DEPT_name#,#HUGS_USER_ID#,#HUGS_USER_name#,#HUGS_USE_RESON#,#HUGS_USE_STATUS#,#HUGS_DESCR#,#HUGS_STATUS#,#HUGS_CREATOR#,SYSDATE(),#HUGS_UPDATE#,SYSDATE()		);		<selectKey resultClass="java.lang.Integer" keyProperty="HUGS_ID">			SELECT LAST_INSERT_ID()		</selectKey>		 -->		<!-- oracle version -->		<selectKey resultClass="java.lang.Integer" keyProperty="HUGS_ID" type="pre">           SELECT HU_GOODS_SQ.NEXTVAL AS VALUE FROM DUAL      	</selectKey> 		 INSERT INTO HU_GOODS (		HUGS_ID,HUGS_COMPANY		)		VALUES		(		#HUGS_ID#,SYSDATE,#HUGS_COMPANY#		)	</insert>		<!-- 更新物资 -->	<update ID="updateGoods" parameterClass="java.util.HashMap">		<!-- oracle version -->		UPDATE HU_GOODS SET		HUGS_name=#HUGS_name#,HUGS_BRAND=#HUGS_BRAND#,HUGS_VERSION=#HUGS_VERSION#,HUGS_PRODUCT_DATE=#HUGS_PRODUCT_DATE#,HUGS_PRICE=#HUGS_PRICE#,HUGS_DEPT_ID=#HUGS_DEPT_ID#,HUGS_DEPT_name=#HUGS_DEPT_name#,HUGS_USER_ID=#HUGS_USER_ID#,HUGS_USER_name=#HUGS_USER_name#,HUGS_USE_RESON=#HUGS_USE_RESON#,HUGS_USE_STATUS=#HUGS_USE_STATUS#,HUGS_DESCR=#HUGS_DESCR#,HUGS_STATUS=#HUGS_STATUS#,HUGS_CREATOR=#HUGS_CREATOR#,HUGS_UPDATE_TIME=SYSDATE		where HUGS_ASSET_CODE=#HUGS_ASSET_CODE#		<!-- MysqL version -->		<!-- 		UPDATE HU_GOODS SET		HUGS_name=#HUGS_name#,HUGS_UPDATE_TIME=SYSDATE()		where HUGS_ASSET_CODE=#HUGS_ASSET_CODE#		 -->	</update>		<!-- 查询固定资产编码数量 -->	<select ID="selectHugsAssetCodeCount" parameterClass="java.util.HashMap"		resultClass="int">		SELECT COUNT(HG.HUGS_ID) AS COUNT FROM HU_GOODS HG WHERE		HG.HUGS_ASSET_CODE=#HUGS_ASSET_CODE#	</select>	<!-- 由固定资产编码查询对应的记录ID集合 -->	<select ID="selectGoodsIDListByHugsAssetCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">		SELECT HG.HUGS_ID FROM HU_GOODS HG WHERE		HG.HUGS_ASSET_CODE=#HUGS_ASSET_CODE#	</select>		<!-- ################################################################################# -->	<!-- HU_GOODS_ITEM -->		<!-- 变更项列集合 -->	<sql ID="Goods_Item_Base_Column_List" >    <!--      WARNING - @mbggenerated      This element is automatically generated by MyBatis Generator,do not modify.      This element was generated on Fri Dec 12 11:53:06 CST 2014.    -->    HUGI_ID,HUGI_GOODS_ID,HUGI_DEPT_ID,HUGI_DEPT_name,HUGI_USER_ID,HUGI_USER_name,HUGI_USE_RESON,HUGI_USE_STATUS,HUGI_DESCR,HUGI_STATUS,HUGI_CREATOR,HUGI_CREATE_TIME,HUGI_UPDATE,HUGI_UPDATE_TIME  	</sql>  	<!-- where条件 -->	<sql ID="Goods_Item_Where_Clause" >		<dynamic prepend="WHERE 1=1">			<isNotEmpty property="HUGI_GOODS_ID">					AND HUGI_GOODS_ID = #HUGI_GOODS_ID#				</isNotEmpty>				<isNotEmpty property="HUGI_DEPT_name">					AND HUGI_DEPT_name liKE '%$HUGI_DEPT_name$%'				</isNotEmpty>				<isNotEmpty property="HUGI_USER_name">					AND HUGI_USER_name liKE '%$HUGI_USER_name$%'				</isNotEmpty>				<isNotEmpty property="HUGI_USE_RESON">					AND HUGI_USE_RESON liKE '%$HUGI_USE_RESON$%'				</isNotEmpty>			</dynamic>  	</sql>	<!-- 物资变更项总数 -->	<select ID="getGoodsItemListCnt" resultClass="java.lang.Integer"		parameterClass="java.util.HashMap">		SELECT COUNT(*) FROM HU_GOODS_ITEM		<isParameterPresent >	      <include refID="HuGoods.Goods_Item_Where_Clause" />    	</isParameterPresent>	</select>	<!-- 物资变更项分页集合查询 -->	<select ID="getGoodsItemPagelist" resultClass="java.util.HashMap"		parameterClass="java.util.HashMap">		<!-- oracle version -->		SELECT * FROM		(				SELECT					A .*,ROWNUM r				FROM					(							SELECT <include refID="HuGoods.Goods_Item_Base_Column_List" />				FROM HU_GOODS_ITEM				<isParameterPresent >				<include refID="HuGoods.Goods_Item_Where_Clause" />					<isNotEmpty property="sortFIEld">				ORDER BY $sortFIEld$ $sortOrder$					</isNotEmpty>				</isParameterPresent>					) A				WHERE					ROWNUM <![cdaTA[ <= ]]> #end#		) B		WHERE r <![cdaTA[>]]> #start#		<!-- MysqL version -->		<!-- 		SELECT <include refID="HuGoods.Goods_Item_Base_Column_List" />		FROM HU_GOODS_ITEM	    <isParameterPresent >		  <include refID="HuGoods.Goods_Item_Where_Clause" />	      <isNotEmpty property="sortFIEld">			ORDER BY $sortFIEld$ $sortOrder$	      </isNotEmpty>    	</isParameterPresent>		liMIT #start#,#end#		 -->	</select>		<!-- 添加记录明细 -->	<insert ID="addGoodsItem" parameterClass="java.util.HashMap">		<!-- oracle version -->		<selectKey resultClass="java.lang.Integer" keyProperty="HUGI_ID" type="pre">           SELECT HU_GOODS_ITEM_SQ.NEXTVAL AS VALUE FROM DUAL      	</selectKey>     	INSERT INTO HU_GOODS_ITEM (HUGI_ID,HUGI_UPDATE_TIME)      VALUES (#HUGI_ID#,#HUGI_GOODS_ID#,#HUGI_DEPT_ID#,#HUGI_DEPT_name#,#HUGI_USER_ID#,#HUGI_USER_name#,#HUGI_USE_RESON#,#HUGI_USE_STATUS#,#HUGI_DESCR#,#HUGI_STATUS#,#HUGI_CREATOR#,#HUGI_UPDATE#,SYSDATE)    	<!-- MysqL version -->    	<!-- 		INSERT INTO HU_GOODS_ITEM (HUGI_GOODS_ID,HUGI_UPDATE_TIME)      VALUES (#HUGI_GOODS_ID:INTEGER#,#HUGI_DEPT_ID:VARCHAR#,#HUGI_DEPT_name:VARCHAR#,#HUGI_USER_ID:INTEGER#,#HUGI_USER_name:VARCHAR#,#HUGI_USE_RESON:VARCHAR#,#HUGI_USE_STATUS:INTEGER#,#HUGI_DESCR:VARCHAR#,#HUGI_STATUS:INTEGER#,#HUGI_CREATOR:VARCHAR#,#HUGI_UPDATE:VARCHAR#,SYSDATE())		<selectKey resultClass="java.lang.Integer" keyProperty="HUGI_ID">			SELECT LAST_INSERT_ID() AS HUGI_ID		</selectKey>		 -->	</insert>	<!-- 删除物资变更明细 -->	<delete ID="deleteGoodsItem" parameterClass="java.util.HashMap">		DELETE FROM HU_GOODS_ITEM WHERE HUGI_ID =#HUGI_ID#	</delete></sqlMap>

以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

总结

以上是内存溢出为你收集整理的IBATIS2.0映射文件 oracle/mysql 版实现示例,功能全面且丰富全部内容,希望文章能够帮你解决IBATIS2.0映射文件 oracle/mysql 版实现示例,功能全面且丰富所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1164307.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存