mybatis的sql的xml的配置文件中的用法。

具体见如下代码:







keyProperty="id">
INSERT INTO VOUCHER (

) VALUES (

)




UPDATE VOUCHER

WHERE id = #{id}




UPDATE VOUCHER




UPDATE VOUCHER

where promotion_id=#{promotionId}


DELETE FROM VOUCHER
WHERE id = #{id}




DELETE FROM VOUCHER


















id
,BAR_CODE
,VOUCHER_NAME
,promotion_id
,status
,customer_id
,deleted
,add_time
,update_time
,start_time
,end_time
,factor_id
,use_id




#{id}
,#{barCode}
,#{voucherName}
,#{promotionId}
,#{status}
,#{customerId}
,#{deleted}
,#{addTime}
,#{updateTime}
,#{startTime}
,#{endTime}
,#{factorId}
,#{useId}







,BAR_CODE=#{barCode}
,VOUCHER_NAME=#{voucherName}
,promotion_id=#{promotionId}
,status=#{status}
,customer_id=#{customerId}
,deleted=#{deleted}
,add_time=#{addTime}
,update_time=#{updateTime}
,start_time=#{startTime}
,end_time=#{endTime}
,factor_id=#{factorId}
,use_id=#{useId}





DELETED = '0'
AND BAR_CODE=#{barCode}
AND VOUCHER_NAME=#{voucherName}
AND id=#{id}
AND promotion_id=#{promotionId}
AND status=#{status}
AND customer_id=#{customerId}
AND add_time=#{addTime}
AND update_time=#{updateTime}

= #{endTime}]]>
AND factor_id=#{factorId}
AND use_id=#{useId}






注意:在的空白处添加需要处理的内容;

to_char(p.START_TIME,'yyyy-MM-dd hh24:mi:ss')

此处为oracle的to_char()函数,TO_CHAR 是把日期或数字转换为字符串。

你可能感兴趣的:(Mybatis,Oracle)