mybatis框架,执行插入语句的时候,如果没有字段传过来就赋值为空 进行判断
<insert id="insert" parameterType="com.picc.hmbms.outinterface.scoreDetail.po.ScoreSettlePo"> insert into t_score_settel (score_settel_id, member_code, order_no, product_code, product_name, pay_way, payable_amount, payable_score, consumer_date, consumer_org, sys_no, settel_type, remark, insert_time, insert_oper, update_time, update_oper) values ( cast(#{scoreSettelId} as NUMERIC), #{memberCode}, #{orderNo}, #{productCode}, #{productName}, #{payWay}, <choose> <when test="payableAmount != null and payableAmount != ‘‘"> cast(#{payableAmount} as NUMERIC), </when> <otherwise> null, </otherwise> </choose> <choose> <when test="payableScore != null and payableScore != ‘‘"> cast(#{payableScore} as NUMERIC), </when> <otherwise> null, </otherwise> </choose> #{consumerDate}, #{consumerOrg}, #{sysNo}, #{settelType}, #{remark}, #{insertTime}, #{insertOper}, #{updateTime}, #{updateOper}) </insert>
相关推荐
xiuyangsong 2020-11-16
Nishinoshou 2020-11-09
jimgreatly 2020-09-01
dongxurr 2020-08-18
Dullonjiang 2020-08-15
Dullonjiang 2020-08-11
Dullonjiang 2020-08-09
dongxurr 2020-08-08
yunzhonmghe 2020-08-07
jimgreatly 2020-08-03
Dullonjiang 2020-07-30
jimgreatly 2020-07-27
liqiancao 2020-07-26
xiuyangsong 2020-07-26
dongxurr 2020-07-26
mcvsyy 2020-07-26
helloxusir 2020-07-25
牧场SZShepherd 2020-07-20