备忘代码

用 Java正则中环视去移除JSON字符串中多余的”

1     public static void main(String[] args) {
2         String a = "{\"color\":\"7.3\"双耳汤盘-绿色\",\"warename\":\"瓷彩美(CECEME)创意陶瓷盘子 个性双耳汤盘家用菜盘深盘西餐盘牛排盘早餐盘沙拉盘 7.3\"双耳汤盘-绿色 盘子\"}";
3         JSONObject jsonObject = JSON.parseObject(a);
4         System.out.println(jsonObject);
5     }

 

mybatis 中 批量插入更新语句

    <insert id="batchInsertOrUpdate" parameterType="com.report.entity.po.ReportPO">
        insert into report
        (
        column_1,
        column_2,
        column_3
        )
        values
        <foreach collection="list" item="item" index="index" separator="," >
            (
            #{item.column1},
            #{item.column2},
            #{item.column3}
        ON DUPLICATE KEY UPDATE
        column_1 = values(column_1)

</insert>

 mybatis 更新语句

    <update id="update" parameterType="com.report.Update">
        update report
        set column_1 = #{condition.column1}
        where 1 = 1
        <if test="condition != null and condition.column2 != null">
            and column_2 = #{condition.column2}
        </if>
        <if test="condition != null and condition.column3 != null">
            and column_3 = #{condition.column3}
        </if>
    </update>

 

转载于:https://www.cnblogs.com/sanmubird/p/11445033.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值