MedPlanMapper.xml 4.06 KB
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.phxl.modules.goods.dao.medplan.MedPlanDao">

	<!--BaseResultMap -->
	<resultMap id="BaseResultMap"
		type="com.phxl.modules.goods.entity.medplan.MedPlan">
		<id column="id" property="id" jdbcType="BIGINT" />
		<result column="med_code" property="medCode" jdbcType="VARCHAR" />
		<result column="med_name" property="medName" jdbcType="VARCHAR" />
		<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR" />
		<result column="supplier_name" property="suppliername" jdbcType="VARCHAR" />
		<result column="bill_no" property="billNo" jdbcType="VARCHAR" />
		<result column="bill_type" property="billType" jdbcType="VARCHAR" />
		<result column="settle_type" property="settleType" jdbcType="VARCHAR" />
		<result column="med_dept_code" property="medDeptCode" jdbcType="VARCHAR" />
		<result column="med_dept_name" property="medDeptName" jdbcType="VARCHAR" />
		<result column="med_store_code" property="medStoreCode" jdbcType="VARCHAR" />
		<result column="med_store_name" property="medStoreName" jdbcType="VARCHAR" />
		<result column="first_flag" property="firstFlag" jdbcType="VARCHAR" />
		<result column="plan_begin_date" property="planBeginDate" jdbcType="TIMESTAMP" />
		<result column="plan_end_date" property="planEndDate" jdbcType="TIMESTAMP" />
		<result column="memo" property="memo" jdbcType="VARCHAR" />
		<result column="operater_name" property="operaterName" jdbcType="VARCHAR" />
		<result column="input_date" property="inputDate" jdbcType="TIMESTAMP" />
		<result column="create_time" property="create_time" jdbcType="TIMESTAMP" />
		<result column="update_time" property="update_time" jdbcType="TIMESTAMP" />
	</resultMap>

	<!--Base_Column_List -->
	<sql id="Base_Column_List">id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time</sql>

	<!--批量插入 -->
	<insert id="batchInsert" parameterType="list">
		insert into med_hli_plan (id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time)
		values
		<foreach collection ="list" item="obj" separator =",">
		<trim prefix=" (" suffix=")" suffixOverrides=",">
				#{obj.id},
				#{obj.medCode},
				#{obj.medName},
				#{obj.supplierCode},
				#{obj.suppliername},
				#{obj.billNo},
				#{obj.billType},
				#{obj.medDeptCode},
				#{obj.medDeptName},
				#{obj.medStoreCode},
				#{obj.medStoreName},
				#{obj.firstFlag},
				#{obj.planBeginDate},
				#{obj.planEndDate},
				#{obj.memo},
				#{obj.operaterName},
				#{obj.inputDate},
				#{obj.create_time},
				#{obj.update_time}
			</trim>
          </foreach>
	</insert>
	
	<!-- 新增MedPlan-->
    <insert id="insert"  parameterType="com.phxl.modules.goods.entity.medplan.MedPlan">
	    insert into med_hli_plan (id,med_code,med_name,supplier_code,supplier_name,bill_no,bill_type,settle_type,med_dept_code,med_dept_name,med_store_code,med_store_name,first_flag,plan_begin_date,plan_end_date,memo,operater_name,input_date,create_time,update_time)
	    values (
	        #{id,jdbcType=VARCHAR}
				,#{medCode,jdbcType=VARCHAR}
				,#{medName,jdbcType=VARCHAR}
				,#{supplierCode,jdbcType=VARCHAR}
				,#{suppliername,jdbcType=VARCHAR}
				,#{billNo,jdbcType=VARCHAR}
				,#{billType,jdbcType=VARCHAR}
				,#{settleType,jdbcType=VARCHAR}
				,#{medDeptCode,jdbcType=VARCHAR}
				,#{medDeptName,jdbcType=VARCHAR}
				,#{medStoreCode,jdbcType=VARCHAR}
				,#{medStoreName,jdbcType=VARCHAR}
				,#{firstFlag,jdbcType=VARCHAR}
				,#{planBeginDate,jdbcType=TIMESTAMP}
				,#{planEndDate,jdbcType=TIMESTAMP}
				,#{memo,jdbcType=VARCHAR}
				,#{operaterName,jdbcType=VARCHAR}
				,#{inputDate,jdbcType=TIMESTAMP}
				,#{create_time,jdbcType=TIMESTAMP}
				,#{update_time,jdbcType=TIMESTAMP}
	    )
	</insert>

</mapper>