dl521357
稷下学宫榆树
2019-11-15 14:13
采纳率: 50%
浏览 1.2k
已采纳

Mapper.xml 中的 update 方法一直报sql语句的错。

Mapper.xml 中的 update 方法一直报sql语句的错。

这是报错信息:
Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
SQLErrorCodes loaded: [DB2, Derby, H2, HDB, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]

<update id="update" parameterType="com.pacypay.aliwc.common.domain.PMerInfoDO">
        update P_MER_INFO
        <set>
            <if test="merId != null">MER_ID = #{merId,jdbcType=VARCHAR} </if>
            <if test="brhId != null">BRH_ID = #{brhId,jdbcType=VARCHAR}, </if>
            <if test="merNm != null">MER_NM = #{merNm,jdbcType=VARCHAR}, </if>
            <if test="merShortNm != null">MER_SHORT_NM = #{merShortNm,jdbcType=VARCHAR}, </if>
            <if test="merType != null">MER_TYPE = #{merType,jdbcType=VARCHAR}, </if>
            <if test="holderName != null">HOLDER_NAME = #{holderName,jdbcType=VARCHAR}, </if>
            <if test="idType != null">ID_TYPE = #{idType,jdbcType=VARCHAR}, </if>
            <if test="idNo != null">ID_NO = #{idNo,jdbcType=VARCHAR}, </if>
            <if test="licenceNo != null">LICENCE_NO = #{licenceNo,jdbcType=VARCHAR}, </if>
            <if test="merLevel != null">MER_LEVEL = #{merLevel,jdbcType=VARCHAR}, </if>
            <if test="mccCd != null">MCC_CD = #{mccCd,jdbcType=VARCHAR}, </if>
            <if test="tradeTypeWx != null">TRADE_TYPE_WX = #{tradeTypeWx,jdbcType=VARCHAR}, </if>
            <if test="supMerId != null">SUP_MER_ID = #{supMerId,jdbcType=VARCHAR}, </if>
            <if test="mgrBrhId != null">MGR_BRH_ID = #{mgrBrhId,jdbcType=VARCHAR}, </if>
            <if test="acqBrhId != null">ACQ_BRH_ID = #{acqBrhId,jdbcType=VARCHAR}, </if>
            <if test="locNation != null">LOC_NATION = #{locNation,jdbcType=VARCHAR}, </if>
            <if test="locProv != null">LOC_PROV = #{locProv,jdbcType=VARCHAR}, </if>
            <if test="locCity != null">LOC_CITY = #{locCity,jdbcType=VARCHAR}, </if>
            <if test="locArea != null">LOC_AREA = #{locArea,jdbcType=VARCHAR}, </if>
            <if test="addr != null">ADDR = #{addr,jdbcType=VARCHAR}, </if>
            <if test="contactPerson != null">CONTACT_PERSON = #{contactPerson,jdbcType=VARCHAR}, </if>
            <if test="contactTel != null">CONTACT_TEL = #{contactTel,jdbcType=VARCHAR}, </if>
            <if test="contactEmail != null">CONTACT_EMAIL = #{contactEmail,jdbcType=VARCHAR}, </if>
            <if test="csEmail != null">CS_EMAIL = #{csEmail,jdbcType=VARCHAR}, </if>
            <if test="csTel != null">CS_TEL = #{csTel,jdbcType=VARCHAR}, </if>
            <if test="stlmtLev != null">STLMT_LEV = #{stlmtLev,jdbcType=VARCHAR}, </if>
            <if test="stlmtPeriod != null">STLMT_PERIOD = #{stlmtPeriod,jdbcType=BIGINT}, </if>
            <if test="stlmtPeriodUnit != null">STLMT_PERIOD_UNIT = #{stlmtPeriodUnit,jdbcType=VARCHAR}, </if>
            <if test="stlmtMin != null">STLMT_MIN = #{stlmtMin,jdbcType=VARCHAR}, </if>
            <if test="stlmtPeriodAdvance != null">STLMT_PERIOD_ADVANCE = #{stlmtPeriodAdvance,jdbcType=BIGINT}, </if>
            <if test="stlmtMinAdvance != null">STLMT_MIN_ADVANCE = #{stlmtMinAdvance,jdbcType=VARCHAR}, </if>
            <if test="stlmtApplyFeeAdvance != null">STLMT_APPLY_FEE_ADVANCE = #{stlmtApplyFeeAdvance,jdbcType=VARCHAR}, </if>
            <if test="stlmtRemark != null">STLMT_REMARK = #{stlmtRemark,jdbcType=VARCHAR}, </if>
            <if test="currency != null">CURRENCY = #{currency,jdbcType=VARCHAR}, </if>
            <if test="inAcctId != null">IN_ACCT_ID = #{inAcctId,jdbcType=VARCHAR}, </if>
            <if test="inAcctNm != null">IN_ACCT_NM = #{inAcctNm,jdbcType=VARCHAR}, </if>
            <if test="inAcctType != null">IN_ACCT_TYPE = #{inAcctType,jdbcType=VARCHAR}, </if>
            <if test="openBankId != null">OPEN_BANK_ID = #{openBankId,jdbcType=VARCHAR}, </if>
            <if test="openBankNm != null">OPEN_BANK_NM = #{openBankNm,jdbcType=VARCHAR}, </if>
            <if test="sta != null">STA = #{sta,jdbcType=VARCHAR}, </if>
            <if test="chkSta != null">CHK_STA = #{chkSta,jdbcType=VARCHAR}, </if>
            <if test="crtDt != null">CRT_DT = #{crtDt,jdbcType=VARCHAR}, </if>
            <if test="lastUpdBrhId != null">LAST_UPD_BRH_ID = #{lastUpdBrhId,jdbcType=VARCHAR}, </if>
            <if test="lastUpdOprId != null">LAST_UPD_OPR_ID = #{lastUpdOprId,jdbcType=VARCHAR}, </if>
            <if test="lastUpdTs != null">LAST_UPD_TS = #{lastUpdTs,jdbcType=TIMESTAMP}, </if>
            <if test="rejectMsg != null">REJECT_MSG = #{rejectMsg,jdbcType=VARCHAR}, </if>
            <if test="smsCheck != null">SMS_CHECK = #{smsCheck,jdbcType=VARCHAR}, </if>
            <if test="logoFileId != null">LOGO_FILE_ID = #{logoFileId,jdbcType=BIGINT}, </if>
            <if test="qrcodeFixedAmt != null">QRCODE_FIXED_AMT = #{qrcodeFixedAmt,jdbcType=VARCHAR}, </if>
            <if test="qrcodeFixedAmtFlg != null">QRCODE_FIXED_AMT_FLG = #{qrcodeFixedAmtFlg,jdbcType=VARCHAR}, </if>
            <if test="feeRateFlag != null">FEE_RATE_FLAG = #{feeRateFlag,jdbcType=VARCHAR}, </if>
            <if test="checkTimestamp != null">CHECK_TIMESTAMP = #{checkTimestamp,jdbcType=TIMESTAMP}, </if>
            <if test="checkOperator != null">CHECK_OPERATOR = #{checkOperator,jdbcType=VARCHAR}, </if>
            <if test="placeholder1Fileid != null">PLACEHOLDER_1_FILEID = #{placeholder1Fileid,jdbcType=BIGINT}, </if>
            <if test="placeholder2Fileid != null">PLACEHOLDER_2_FILEID = #{placeholder2Fileid,jdbcType=BIGINT}, </if>
            <if test="placeholder3Fileid != null">PLACEHOLDER_3_FILEID = #{placeholder3Fileid,jdbcType=BIGINT}, </if>
            <if test="placeholder4Fileid != null">PLACEHOLDER_4_FILEID = #{placeholder4Fileid,jdbcType=BIGINT}, </if>
            <if test="placeholder5Fileid != null">PLACEHOLDER_5_FILEID = #{placeholder5Fileid,jdbcType=BIGINT}, </if>
            <if test="placeholder6Fileid != null">PLACEHOLDER_6_FILEID = #{placeholder6Fileid,jdbcType=BIGINT}, </if>
            <if test="placeholder7Fileid != null">PLACEHOLDER_7_FILEID = #{placeholder7Fileid,jdbcType=BIGINT}, </if>
            <if test="agentSetTbank != null">AGENT_SET_TBANK = #{agentSetTbank,jdbcType=VARCHAR}, </if>
            <if test="licenceExpiration != null">LICENCE_EXPIRATION = #{licenceExpiration,jdbcType=VARCHAR}, </if>
            <if test="refundMark != null">REFUND_MARK = #{refundMark,jdbcType=VARCHAR}, </if>
            <if test="txnInfoType != null">TXN_INFO_TYPE = #{txnInfoType,jdbcType=VARCHAR}, </if>
            <if test="idExpiration != null">ID_EXPIRATION = #{idExpiration,jdbcType=VARCHAR}, </if>
            <if test="refundFeeMark != null">REFUND_FEE_MARK = #{refundFeeMark,jdbcType=VARCHAR}, </if>
            <if test="itsChnlidAlipay != null">ITS_CHNLID_ALIPAY = #{itsChnlidAlipay,jdbcType=VARCHAR}, </if>
            <if test="itsChnlidWechat != null">ITS_CHNLID_WECHAT = #{itsChnlidWechat,jdbcType=VARCHAR}</if>
            <if test="storeType != null">STORE_TYPE = #{storeType,jdbcType=VARCHAR}, </if>
            <if test="storeSupMerId != null">STORE_SUP_MER_ID = #{storeSupMerId,jdbcType=VARCHAR}</if>
        </set>
        where MER_ID = #{merId}
    </update>
这是实体
//商户号
    private String merId;
    //机构号
    private String brhId;
    //商户名称
    private String merNm;
    //商户简称
    private String merShortNm;
    //商户属性
    private String merType;
    //法人姓名
    private String holderName;
    //证件类型
    private String idType;
    //证件编号
    private String idNo;
    //营业执照编号
    private String licenceNo;
    //商户级别
    private String merLevel;
    //MCC
    private String mccCd;
    //微信经营类目
    private String tradeTypeWx;
    //上级商户号
    private String supMerId;
    //$column.comments
    private String mgrBrhId;
    //机构号
    private String acqBrhId;
    //国家
    private String locNation;
    //省
    private String locProv;
    //市
    private String locCity;
    //区
    private String locArea;
    //详细地址
    private String addr;
    //联系人
    private String contactPerson;
    //联系电话
    private String contactTel;
    //联系邮箱
    private String contactEmail;
    //客服邮箱
    private String csEmail;
    //客服电话
    private String csTel;
    //结算级别
    private String stlmtLev;
    //结算周期
    private Long stlmtPeriod;
    //结算周期参数
    private String stlmtPeriodUnit;
    //起始结算金额
    private String stlmtMin;
    //提前结算周期
    private Long stlmtPeriodAdvance;
    //提前结算最小金额
    private String stlmtMinAdvance;
    //提前结算手续费
    private String stlmtApplyFeeAdvance;
    //stlmt remark
    private String stlmtRemark;
    //币种
    private String currency;
    //结算卡号
    private String inAcctId;
    //结算户名
    private String inAcctNm;
    //结算卡类型
    private String inAcctType;
    //开户行号
    private String openBankId;
    //开户行名
    private String openBankNm;
    //状态
    private String sta;
    //审核状态
    private String chkSta;
    //创建日期
    private String crtDt;
    //最后更新机构号
    private String lastUpdBrhId;
    //最后更新操作员
    private String lastUpdOprId;
    //最后更新时间
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastUpdTs;
    //审核拒绝原因
    private String rejectMsg;
    //$column.comments 机构号(+1)
    private String smsCheck;
    //logo
    private Long logoFileId;
    //码牌固定金额
    private String qrcodeFixedAmt;
    //码牌固定金额标识
    private String qrcodeFixedAmtFlg;
    //费率标识
    private String feeRateFlag;
    //审核时间
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date checkTimestamp;
    //审核操作员
    private String checkOperator;
    //文件一
    private Long placeholder1Fileid;
    //文件二
    private Long placeholder2Fileid;
    //文件三
    private Long placeholder3Fileid;
    //文件四
    private Long placeholder4Fileid;
    //文件五
    private Long placeholder5Fileid;
    //文件六
    private Long placeholder6Fileid;
    //文件七
    private Long placeholder7Fileid;
    //代理结算银行
    private String agentSetTbank;
    //营业执照过期时间
    private String licenceExpiration;
    //退款标识
    private String refundMark;
    //商户(交易)类型
    private String txnInfoType;
    //身份证过期时间
    private String idExpiration;
    //退款标识
    private String refundFeeMark;
    //支付宝渠道编号
    private String itsChnlidAlipay;
    //微信渠道编号
    private String itsChnlidWechat;
    //店铺类型
    private String storeType;
    //店铺所属客户
    private String storeSupMerId;
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • qq_39019765
    打杂的程序员 2019-11-15 14:41
    已采纳

    建议将你的方法上的try-catch捕获异常,自定义异常信息抛掉,在控制台打印出真正的异常信息。从而判断出错误处在哪里。
    你的开始

    <if test="merId != null">MER_ID = #{merId,jdbcType=VARCHAR} </if>
    ```   /if前面是不是少了个逗号。
    
    点赞 评论
  • wojiushiwo945you
    毕小宝 2019-11-15 15:08

    第一个插入语句后面没有逗号,而后面中间又有一些没有。正常的来说,应该每一个都需要加的,set if 会智能去掉最后一个逗号的。

    点赞 评论

相关推荐