스프링

 

https://developerhjg.tistory.com/69

 

https://taetaetae.github.io/2017/04/04/mybatis-useGeneratedKeys/

 

ibatis 와  mybatis  는 다르다

 키값 아이가 테이블 컬럼 plan_id 아니라  객체 planId  값이다.

 

	  <resultMap id="planProductMAP"  type="erp.web.domain.PlanProductVO">
	 		<result property="no" column="no"/>
		    <result property="planId" column="plan_id"/> 		            
	        <result property="bomid" column="bomid"/>
	        <result property="pcode" column="pcode"/>  		        
	        <result property="planProductName" column="plan_product_name"/>       
	        <result property="planProductQuantity" column="plan_product_quantity"/>	        
	        <result property="deadline" column="deadline"/> 
	       	<result property="remarks" column="remarks"/>
	 </resultMap>


<insert id="insertPlanProduct2"   useGeneratedKeys="true" keyProperty="planId" parameterType="erp.web.domain.PlanProductVO" >
	
		INSERT INTO tbl_plan_product(
				   bomid
				  ,plan_product_name
				  ,plan_product_quantity
				  ,deadline
				  ,remarks
				) 
				VALUES
				 (
				    #{bomid}
				  ,#{planProductName}
				  ,#{planProductQuantity}
				  ,#{deadline}
				  ,#{remarks}
				)  
		  	
	</insert>

 

 

 

 

about author

PHRASE

Level 60  라이트

철옹성을 믿는다 , (약속 따위를) 굳게 믿는다는 말.

댓글 ( 4)

댓글 남기기

작성

스프링 목록    more