skip to Main Content

Mysql – MyBatis xml update query using set tag throws org.springframework.jdbc.BadSqlGrammarException

Built update query in MyBatis xml but no luck to pass BadSqlGrammarException Here's my query <update id="updateRecordingVideoStatus"> UPDATE game_record_metadata <set> <if test="modifiedVideoStatus = null"> status = #{originalVideoStatus} </if> <if test="modifiedVideoStatus != null"> status = #{modifiedVideoStatus} </if> </set> WHERE id =…

VIEW QUESTION

Postgresql – How to use resultMap with type of HashMap to select list of HashMap with mybatis?

My tables are like this: DROP TABLE IF EXISTS "public"."agri_pest_control"; CREATE TABLE "public"."agri_pest_control" ( "pest_type" varchar(10) COLLATE "pg_catalog"."default" DEFAULT ''::character varying, "pest_status" bit(3) DEFAULT '000'::"bit", "crop_type" varchar(20) COLLATE "pg_catalog"."default", "id" int8 NOT NULL, "comments" varchar(255) COLLATE "pg_catalog"."default", "land_id" int8, "test_time"…

VIEW QUESTION

inserting data iff there are no duplicated datas in mysql db

<insert id="insertStockOrderAbusingList" parameterType="java.util.List"> INSERT IGNORE INTO iruda_trade.stock_order_abusing ( market_day, uid, stock_account_id, order_number, symbol, conclusion_quantity, order_type, created_at ) VALUES <foreach collection="list" item="item" index="index" separator=","> ( #{item.transactionDate}, #{item.uid}, #{item.stockAccountId}, #{item.transactionNumber}, #{item.symbol}, #{item.filledVolume}, #{item.transactionType}, #{item.clientTimeStamp} ) </foreach> </insert> I'm trying to insert the…

VIEW QUESTION
Back To Top
Search