Mybatis 中 update 语句 动态 语句

时间:2021-12-01 02:18:45

<update id="updateAdministrationAsset" parameterType="com.opple.fa.assetcard.entity.AdministrationAsset">
        update TB_FA_ADMINISTRATION_ASSET
          <trim prefix="SET" suffixOverrides=",">
                  <if test="null != serialNumber and '' != serialNumber">
                       SERIAL_NUMBER=#{serialNumber},
                   </if>
                  <if test="null != managementCode and '' != managementCode">
                       MANAGEMENT_CODE=#{managementCode},
                   </if>
          </trim>
             where ID=#{id}
</update>