mvn archetype:generate -DgroupId=org.seckill -DartifactId=seckill -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeCatalog=local
2016-05-08
SeckillDao.xml有2个地方要改,当sql有多个参数变量绑定时的方式要写成#{0},#{1}而不能直接写接口的参数名称,否则报错(1):
<update id="reduceNumber">
update seckill
set number=number-1
where number > 0
and seckill_id=#{0}
and start_time <![CDATA[ <= ]]> #{1}
and end_time <![CDATA[ >= ]]> #{1}
</update>
<update id="reduceNumber">
update seckill
set number=number-1
where number > 0
and seckill_id=#{0}
and start_time <![CDATA[ <= ]]> #{1}
and end_time <![CDATA[ >= ]]> #{1}
</update>
2016-05-08