哪位大神帮我看看 下面代码那有错误

来源:4-4 基于myBatis实现DAO编程(上)

鹏鹏python

2016-11-14 18:25

<?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="org.seckill.dao.SeckillDao">

<!-- 目的:为dao接口方法提供sql语句配置 -->

<update id="reduceNumber">

<!-- 具体sql -->

update

seckillId

set

number = number - 1

where seckill_id = #{seckillId}

and start_time <![CDATA[ <= ]] #{killTime},

and end_time >= #{killTime}

and number > 0;

</update>

<select id="queryById" resultType="Seckill" parameterType="long">

select seckill_id,name,number,start_time,end_time,create_time

from seckill

where seckill_id =#{seckillId}

</select>

<select id ="querAll" resultType="Seckill">

select seckill_id,name,number,start_time,end_time,create_time

from seckill

oder by create_time desc

limit #{offset},#{limit}

</select>

</mapper>


写回答 关注

2回答

  • End13147
    2017-04-21 11:37:48

    and start_time <![CDATA[ <= ]] #{killTime},

    这个应该是and start_time <![CDATA[ <= ]]> #{killTime}

  • 不应有的淡定
    2016-11-14 20:48:45

    and start_time <![CDATA[ <= ]] #{killTime},  后面不要加逗号,有 and连接符的

Java高并发秒杀API之业务分析与DAO层

Java实现高并发秒杀API的第一门课,还等什么,赶快来加入吧

87424 学习 · 496 问题

查看课程

相似问题