异常信息: Element type "choose" must be declared.
mybatis xml 语句如下,求帮助
SELECT * FROM DATAFALL
WHERE 1=1
<choose>
<when test="FULL_DATE==1">
AND U.R0P1 IS NULL
AND U.R0P2 IS NULL
AND U.R0P3 IS NULL
AND U.R0P4 IS NULL
AND U.R1P1 IS NULL
AND U.R1P2 IS NULL
AND U.R1P3 IS NULL
AND U.R1P4 IS NULL
AND U.R2P1 IS NULL
AND U.R2P2 IS NULL
AND U.R2P3 IS NULL
AND U.R2P4 IS NULL
AND U.R3P1 IS NULL
AND U.R3P2 IS NULL
AND U.R3P3 IS NULL
AND U.R3P4 IS NULL
AND U.R4P1 IS NULL
AND U.R4P2 IS NULL
AND U.R4P3 IS NULL
AND U.R4P4 IS NULL
</when>
<when test="FULL_DATE==2">
AND U.R0P1 IS NOT NULL
AND U.R0P2 IS NOT NULL
AND U.R0P3 IS NOT NULL
AND U.R0P4 IS NOT NULL
AND U.R1P1 IS NOT NULL
AND U.R1P2 IS NOT NULL
AND U.R1P3 IS NOT NULL
AND U.R1P4 IS NOT NULL
AND U.R2P1 IS NOT NULL
AND U.R2P2 IS NOT NULL
AND U.R2P3 IS NOT NULL
AND U.R2P4 IS NOT NULL
AND U.R3P1 IS NOT NULL
AND U.R3P2 IS NOT NULL
AND U.R3P3 IS NOT NULL
AND U.R3P4 IS NOT NULL
AND U.R4P1 IS NOT NULL
AND U.R4P2 IS NOT NULL
AND U.R4P3 IS NOT NULL
AND U.R4P4 IS NOT NULL
</when>
</choose>
------解决方案--------------------
楼主这个sql有没有用select标签包起来
------解决方案--------------------
<!-- 6 choose(判断参数) - 按顺序将实体类第一个不为空的属性作为where条件 -->
<select id="getStudentList_choose" resultMap="resultMap_studentEntity" parameterType="liming.student.manager.data.model.StudentEntity">
SELECT ST.STUDENT_ID,
ST.STUDENT_NAME,
ST.STUDENT_SEX,
ST.STUDENT_BIRTHDAY,
ST.STUDENT_PHOTO,
ST.CLASS_ID,
ST.PLACE_ID
FROM STUDENT_TBL ST
<where>
<choose>
<when test="studentName !=null ">
ST.STUDENT_NAME LIKE CONCAT(CONCAT('%', #{studentName, jdbcType=VARCHAR}),'%')
</when >
<when test="studentSex != null and studentSex != '' ">
AND ST.STUDENT_SEX = #{studentSex, jdbcType=INTEGER}
</when >
<when test="studentBirthday != null ">
AND ST.STUDENT_BIRTHDAY = #{studentBirthday, jdbcType=DATE}
</when >
<when test="classId != null and classId!= '' ">
AND ST.CLASS_ID = #{classId, jdbcType=VARCHAR}
</when >
<when test="classEntity != null and classEntity.classId !=null and classEntity.classId !=' ' ">
AND ST.CLASS_ID = #{classEntity.classId, jdbcType=VARCHAR}
</when >
<when test="placeId != null and placeId != '' ">
AND ST.PLACE_ID = #{placeId, jdbcType=VARCHAR}
</when >
<when test="placeEntity != null and placeEntity.placeId != null and placeEntity.placeId != '' ">
AND ST.PLACE_ID = #{placeEntity.placeId, jdbcType=VARCHAR}
</when >
<when test="studentId != null and studentId != '' ">