BME学习总结02

//查询数据库的SQL.XML
<?xml version="1.0" encoding="UTF-8"?>
<sqlmap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.huawei.com/bme/schema/namingsql">
<resultMapping id="ParamMaps"
type="com.huawei.bme.entity.EsbLogUserOperEntity">
<result property="oper_id" column="OPER_ID" />
<result property="user_name" column="USER_NAME" />
<result property="role_id" column="ROLE_ID" />
<result property="user_host" column="USER_HOST" />
<result property="oper_type" column="OPER_TYPE" />
<result property="oper_object_type" column="OPER_OBJECT_TYPE" />
<result property="oper_object_name" column="OPER_OBJECT_NAME" />
<result property="oper_context" column="OPERCCONTEXT" />
<result property="oper_time" column="OPER_TIME" />
<result property="oper_result" column="OPER_RESULT" />
</resultMapping>
<sql id="QueryEsbLogByParams" datasource="bmeDataSource"
resultMapping="ParamMaps" parameterType="com.huawei.bme.entity.EsbLogUserOperEntity">
<content>
<![CDATA[
select * from ESB_LOG_USER_OPER t where <{tune1}> <{tune2}> <{tune3}> <{tune4}> <{tune5}> order by OPER_ID desc
]]>
</content>
<tune-table>
<tune id="tune1">
<tune-value content="t.USER_NAME like :user_name"
condition=":user_name isNotNull" prepend="and" />
</tune>

<tune id="tune2">
<tune-value content="and t.OPER_TYPE = :oper_type"
condition=":oper_type isNotNull" prepend="and" />
</tune>

<tune id="tune3">
<tune-value content="and t.OPER_RESULT = :oper_result"
condition=":oper_result isNotNull" prepend="and" />
</tune>

<tune id="tune4">
<tune-value content="and t.OPER_OBJECT_TYPE =:oper_object_type"
condition=":oper_object_type isNotNull" prepend="and" />
</tune>

<tune id="tune5">
<tune-value
content="and t.OPER_TIME between to_date(:begin_time,'YYYY/MM/DD HH24:mi:ss')
and to_date(:end_time,'YYYY/MM/DD HH24:mi:ss')"
condition=":begin_time isNotNull and :end_time isNotNull" prepend="and" />
</tune>

</tune-table>
</sql>
</sqlmap>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值