81,092
社区成员
发帖
与我相关
我的任务
分享
<mapper namespace="com.jeesite.modules.gjp.dao.GjpLedgerDao">
<resultMap id="BaseResultMap" type="com.jeesite.modules.gjp.entity.GjpLedger" >
<id column="lid" property="lid" jdbcType="INTEGER" />
<result column="parent" property="parent" jdbcType="VARCHAR" />
<result column="money" property="money" jdbcType="DOUBLE" />
<result column="account" property="account" jdbcType="VARCHAR" />
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
<result column="ldesc" property="ldesc" jdbcType="VARCHAR" />
<result column="create_by" property="createBy" jdbcType="VARCHAR" />
<result column="update_by" property="updateBy" jdbcType="VARCHAR" />
<result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
<association property="sid" javaType="com.jeesite.modules.gjp.entity.GjpSort">
<id column="sid" property="sid" />
<result column="sname" property="sname"/>
<result column="parent" property="parent"/>
<result column="sdesc" property="sdesc"/>
<result column="create_by" property="createBy"/>
<result column="create_date" property="createDate"/>
<result column="update_by" property="updateBy"/>
<result column="update_date" property="updateDate"/>
</association>
</resultMap>
<!-- 插入 -->
<insert id="insertGjpLedger" parameterType="com.jeesite.modules.gjp.entity.GjpLedger">
insert into
gjp_ledger
(
parent,
sid.sname,
money,
account,
create_date,
ldesc,
update_date
)
value (
<if test="parent != null and parent != ''">and parent = #{parent, jdbcType=VARCHAR}</if>
<if test="sid.sname != null and sid.sname != ''">and sid.sname = #{sid.sname, jdbcType=INTEGER}</if>
<if test="money != null and money != ''">and money = #{money, jdbcType=DOUBLE}</if>
<if test="account != null and account != ''">and account = #{account, jdbcType=VARCHAR}</if>
<if test="createDate != null">and create_date = #{createDate, jdbcType=TIMESTAMP}</if>
<if test="ldesc != null and ldesc != ''">and ldesc = #{ldesc, jdbcType=VARCHAR}</if>
<if test="updateDate != null">and update_date = #{updateDate, jdbcType=TIMESTAMP}</if>
)
</insert>
我需要插入数据 然后报错You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and parent = '0'
and sid.sname = '1'
and money = 999.0
and accoun' at line 13
我这语法哪里有问题吗?求教
==> Preparing: insert into gjp_ledger ( parent, money, account, create_date, ldesc, update_date ) values ( parent = ?, money = ?, account = ?, create_date = ?, ldesc = ?, update_date = ? )
03-19 10:29:54.005 DEBUG [c.j.modules.gjp.dao.GjpLedgerDao.insertGjpLedger] - ==> Parameters: 0(String), 999.0(Double), 工商银行(String), 2015-05-05 00:00:00.0(Timestamp), 野炊(String), 2015-05-05 00:00:00.0(Timestamp)
03-19 10:29:54.007 DEBUG [c.j.modules.gjp.dao.GjpLedgerDao.insertGjpLedger] - <== Updates: 1
另外请问下怎么针对楼层进行回复啊 ,我怎么不能给相应的楼层回复呢