求指教!!!

  org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.apache.ibatis.session.SqlSessionFactory net.huadong.core.mybatis.dao.MyBatisDao.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [springmybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\myeclipse\HD_HET_2.0\target\classes\net\huadong\system\luck\mapper\LuckMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 72; columnNumber: 25; 元素类型 "trim" 必须后跟属性规范 ">" 或 "/>"。
   配置文件:
       <?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="luck">
<resultMap type="net.huadong.system.luck.entity.Luck" id="luckMap">
<id column="id" property="id"/>
<result column="label" property="label"/>
<result column="value" property="value"/>
<result column="target" property="target"/>
<result column="description" property="description"/>
<result column="sort_id" property="sort_id"/>
<result column="disabled" property="disabled"/>
<result column="disabled_name" property="disabled_name"/>
</resultMap>

<!-- 查询 -->
<select id="select" resultMap="luckMap" parameterType="Map">
select d.*,
case when d.disabled='0' then '启用' 
when d.disabled='1' then '不启用' 
   end as disabled_name
from system_luck d
<where>
<if test="id !=null and id !='' ">
id=#{ id }
</if>
<if test="label !=null and label !='' ">
and label=#{ label }
</if>
<if test="value !=null">
and value like concat('%',#{ value },'%')
</if>
<if test="target !=null">
and target like concat('%',#{ target },'%')
</if>
<if test="description !=null">
and description=#{ description }
</if>
<if test="sort_id !=null">
and sort_id=#{ sort_id }
</if>
<if test="disabled !=null">
and disabled=#{ disabled }
</if>
</where>
</select>
<!-- 保存 -->
<insert id="insert" parameterType="net.huadong.system.luck.entity.Luck" useGeneratedKeys="true" keyProperty="id">
insert into system_luck
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id !=null">
id,
</if>
<if test="label !=null">
label,
</if>
<if test="value !=null">
value,
</if>
<if test="target !=null">
target,
</if>
<if test="description !=null">
description,
</if>
<if test="sort_id !=null">
sort_id,
</if>
<if test="disabled !=null">
disabled,
</if>
</trim>
<trim prefix="values ( "suffix=")" suffixOverrides=",">
<if test="id !=null">
#{id},
</if>
<if test="label !=null">
#{label},
</if>
<if test="value !=null">
#{value},
</if>
<if test="target !=null">
#{target},
</if>
<if test="description !=null">
#{description},
</if>
<if test="sort_id !=null">
#{sort_id},
</if>
<if test="disabled !=null">
#{disabled},
</if>
</trim>
</insert>
<!-- 修改 -->
<update id="update" parameterType="net.huadong.system.luck.entity.Luck">
update system_luck
<set>
<if test="id !=null and id !='' ">
id=#{ id },
</if>
<if test="label !=null and label !='' ">
label=#{ label },
</if>
<if test="value !=null">
value=#{ value },
</if>
<if test="target !=null">
target=#{ target },
</if>
<if test="description !=null">
description=#{ description },
</if>
<if test="sort_id !=null">
sort_id=#{ sort_id },
</if>
<if test="disabled !=null">
disabled=#{ disabled },
</if>
</set>
<where>
id=#{ id }
</where>
</update>

<!-- 删除 -->
<delete id="delete" parameterType="java.lang.Long">
delete from system_luck where id=#{id}
</delete>

<select id="selectByTarget" resultMap="luckMap" parameterType="java.lang.String">
select * from system_luck where target =#{target} and disabled=0
</select>
</mapper>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值