用 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>