<?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="com.brilliance.isc.common.bopset.counter.mapper.CounterBopdecMapper">
<insert id="insertCounter" >
insert into BOPCOU(COUNAM,COUVAL,COUSTP,COUDAT) values(#{counam},'1','1',#{dat})
</insert>
<select id="getCountValWithUpdate" resultType="java.lang.Integer">
select COUVAL from BOPCOU where COUNAM = #{counam} and COUDAT = #{dat} for update
</select>
<!-- select COUVAL from COU where trim(COUNAM) = #{0} for update-->
<update id="updateCounter" >
update BOPCOU set COUVAL = COUVAL + COUSTP where trim(COUNAM) = #{counam} and COUDAT = #{dat}
</update>
<select id="seqNextval" resultType="java.lang.Integer" >
select ${value}.nextval from dual
</select>
<select id="dbCounter" resultType="java.lang.Integer">
select f_dbcounter(#{seqName}) from dual;
</select>
</mapper>