0
null이 아닌 경우에만 null 값을 삽입하려고합니다. null 인 경우, DB에 디폴트 치를 삽입합니다.myBatis는 조건부로 null 값을 삽입하지 않습니다.
<insert id ="inventorySave">
<[CDATA[
INSET INTO inventory
(itemname,amount,id,level)
values
]]
<foreach item="inventory" collection="inventoryies" separator=",">
<[CDATA[
(#{inventory.itemName},#{inventory.amount}, #{inventory.id}, #{inventory.level})
]]
</foreach>
</insert>
내가 '수준'에 대한 값을 확인 할 유효한 문자열입니다, '보통', '중요', '심각한'. 빈 문자열 또는 널 (null) 값이있는 경우에는 any를 지정하지 말고 데이터베이스가 기본값을 삽입하도록 결정해야합니다.
누구든지 조건부로 레코드를 삽입하는 방법을 알려주십시오.