128c72e7a78fb218e2cc3585dc171379ae6f555c.svn-base 12.3 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.hisCtMedicineMaterial.HisCtMedicineMaterialDao">

	<!--BaseResultMap-->
    <resultMap id="BaseResultMap" type="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
		<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="goods_code" property="goodsCode" jdbcType="VARCHAR"/>
		<result column="goods_spec" property="goodsSpec" jdbcType="VARCHAR"/>
		<result column="goods_name" property="goodsName" jdbcType="VARCHAR"/>
		<result column="s_name" property="sName" jdbcType="VARCHAR"/>
		<result column="p_name" property="pName" jdbcType="VARCHAR"/>
		<result column="help_code" property="helpCode" jdbcType="VARCHAR"/>
		<result column="producer" property="producer" jdbcType="VARCHAR"/>
		<result column="agent_name" property="agentName" jdbcType="VARCHAR"/>
		<result column="med_goods_gateGUID" property="medGoodsCateGUID" jdbcType="VARCHAR"/>
		<result column="med_goods_cate_name" property="medGoodsCateName" jdbcType="VARCHAR"/>
		<result column="regist_key" property="registKey" jdbcType="VARCHAR"/>
		<result column="price" property="price" jdbcType="DECIMAL"/>
		<result column="sale_price" property="salePrice" jdbcType="DECIMAL"/>
		<result column="bat_sale_price" property="batSalePrice" jdbcType="DECIMAL"/>
		<result column="production_address" property="productionAddress" jdbcType="VARCHAR"/>
		<result column="dosage_form" property="dosageForm" jdbcType="VARCHAR"/>
		<result column="length" property="length" jdbcType="DECIMAL"/>
		<result column="width" property="width" jdbcType="DECIMAL"/>
		<result column="height" property="height" jdbcType="DECIMAL"/>
		<result column="gross_weight" property="grossWeight" jdbcType="DECIMAL"/>
		<result column="net_weight" property="netWeight" jdbcType="DECIMAL"/>
		<result column="unit_style" property="unitStyle" jdbcType="VARCHAR"/>
		<result column="big_unit_style" property="bigUnitStyle" jdbcType="VARCHAR"/>
		<result column="big_unit_qty" property="bigUnitQty" jdbcType="DECIMAL"/>
		<result column="big_bcd" property="bigBcd" jdbcType="VARCHAR"/>
		<result column="min_unit_style" property="minUnitStyle" jdbcType="VARCHAR"/>
		<result column="min_unit_qty" property="minUnitQty" jdbcType="DECIMAL"/>
		<result column="lit_bcd" property="litBcd" jdbcType="VARCHAR"/>
		<result column="is_lot_ctrl_input" property="isLotCtrlInput" jdbcType="VARCHAR"/>
		<result column="biz_state" property="bizState" jdbcType="VARCHAR"/>
		<result column="imported_flag" property="importedFlag" jdbcType="VARCHAR"/>
		<result column="report_flag" property="reportFlag" jdbcType="VARCHAR"/>
		<result column="noxious_flag" property="noxiousFlag" jdbcType="VARCHAR"/>
		<result column="drug_nerve_flag" property="drugNerveFlag" jdbcType="VARCHAR"/>
		<result column="product_standard_code" property="productStandardCode" jdbcType="VARCHAR"/>
		<result column="spec_standard_code" property="specStandardCode" jdbcType="VARCHAR"/>
		<result column="brand" property="brand" jdbcType="VARCHAR"/>
		<result column="cold_flag" property="coldFlag" jdbcType="VARCHAR"/>
		<result column="supplier_code" property="supplierCode" jdbcType="VARCHAR"/>
		<result column="supplier_name" property="supplierName" jdbcType="VARCHAR"/>
		<result column="memo" property="memo" jdbcType="VARCHAR"/>
    </resultMap>
	
	<!--Base_Column_List-->
	<sql id="Base_Column_List">id,med_code,med_name,goods_code,goods_spec,goods_name,s_name,p_name,help_code,producer,agent_name,med_goods_gateGUID,med_goods_cate_name,regist_key,price,sale_price,bat_sale_price,production_address,dosage_form,length,width,height,gross_weight,net_weight,unit_style,big_unit_style,big_unit_qty,big_bcd,min_unit_style,min_unit_qty,lit_bcd,is_lot_ctrl_input,biz_state,imported_flag,report_flag,noxious_flag,drug_nerve_flag,product_standard_code,spec_standard_code,brand,cold_flag,supplier_code,supplier_name,memo</sql>
    
  	<!-- 新增HisCtMedicineMaterial-->
    <insert id="insert"  parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
	    insert into med_hli_medicine_material (id,med_code,med_name,goods_code,goods_spec,goods_name,s_name,p_name,help_code,producer,agent_name,med_goods_gateGUID,med_goods_cate_name,regist_key,price,sale_price,bat_sale_price,production_address,dosage_form,length,width,height,gross_weight,net_weight,unit_style,big_unit_style,big_unit_qty,big_bcd,min_unit_style,min_unit_qty,lit_bcd,is_lot_ctrl_input,biz_state,imported_flag,report_flag,noxious_flag,drug_nerve_flag,product_standard_code,spec_standard_code,brand,cold_flag,supplier_code,supplier_name,memo)
	    values (
	        #{id,jdbcType=VARCHAR}
				,#{medCode,jdbcType=VARCHAR}
				,#{medName,jdbcType=VARCHAR}
				,#{goodsCode,jdbcType=VARCHAR}
				,#{goodsSpec,jdbcType=VARCHAR}
				,#{goodsName,jdbcType=VARCHAR}
				,#{sName,jdbcType=VARCHAR}
				,#{pName,jdbcType=VARCHAR}
				,#{helpCode,jdbcType=VARCHAR}
				,#{producer,jdbcType=VARCHAR}
				,#{agentName,jdbcType=VARCHAR}
				,#{medGoodsCateGUID,jdbcType=VARCHAR}
				,#{medGoodsCateName,jdbcType=VARCHAR}
				,#{registKey,jdbcType=VARCHAR}
				,#{price,jdbcType=DECIMAL}
				,#{salePrice,jdbcType=DECIMAL}
				,#{batSalePrice,jdbcType=DECIMAL}
				,#{productionAddress,jdbcType=VARCHAR}
				,#{dosageForm,jdbcType=VARCHAR}
				,#{length,jdbcType=DECIMAL}
				,#{width,jdbcType=DECIMAL}
				,#{height,jdbcType=DECIMAL}
				,#{grossWeight,jdbcType=DECIMAL}
				,#{netWeight,jdbcType=DECIMAL}
				,#{unitStyle,jdbcType=VARCHAR}
				,#{bigUnitStyle,jdbcType=VARCHAR}
				,#{bigUnitQty,jdbcType=DECIMAL}
				,#{bigBcd,jdbcType=VARCHAR}
				,#{minUnitStyle,jdbcType=VARCHAR}
				,#{minUnitQty,jdbcType=DECIMAL}
				,#{litBcd,jdbcType=VARCHAR}
				,#{isLotCtrlInput,jdbcType=VARCHAR}
				,#{bizState,jdbcType=VARCHAR}
				,#{importedFlag,jdbcType=VARCHAR}
				,#{reportFlag,jdbcType=VARCHAR}
				,#{noxiousFlag,jdbcType=VARCHAR}
				,#{drugNerveFlag,jdbcType=VARCHAR}
				,#{productStandardCode,jdbcType=VARCHAR}
				,#{specStandardCode,jdbcType=VARCHAR}
				,#{brand,jdbcType=VARCHAR}
				,#{coldFlag,jdbcType=VARCHAR}
				,#{supplierCode,jdbcType=VARCHAR}
				,#{supplierName,jdbcType=VARCHAR}
				,#{memo,jdbcType=VARCHAR}
	    )
	</insert>
	
	<!-- 按需修改HisCtMedicineMaterial-->   
    <update id="update" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
        update med_hli_medicine_material
        <set>
            <if test="medName != null and medName != ''">
    			med_name = #{medName,jdbcType=VARCHAR},
    		</if>
            <if test="goodsCode != null and goodsCode != ''">
    			goods_code = #{goodsCode,jdbcType=VARCHAR},
    		</if>
            <if test="goodsSpec != null and goodsSpec != ''">
    			goods_spec = #{goodsSpec,jdbcType=VARCHAR},
    		</if>
            <if test="goodsName != null and goodsName != ''">
    			goods_name = #{goodsName,jdbcType=VARCHAR},
    		</if>
            <if test="sName != null and sName != ''">
    			s_name = #{sName,jdbcType=VARCHAR},
    		</if>
            <if test="pName != null and pName != ''">
    			p_name = #{pName,jdbcType=VARCHAR},
    		</if>
            <if test="helpCode != null and helpCode != ''">
    			help_code = #{helpCode,jdbcType=VARCHAR},
    		</if>
            <if test="producer != null and producer != ''">
    			producer = #{producer,jdbcType=VARCHAR},
    		</if>
            <if test="agentName != null and agentName != ''">
    			agent_name = #{agentName,jdbcType=VARCHAR},
    		</if>
            <if test="medGoodsCateGUID != null and medGoodsCateGUID != ''">
    			med_goods_gateGUID = #{medGoodsCateGUID,jdbcType=VARCHAR},
    		</if>
            <if test="medGoodsCateName != null and medGoodsCateName != ''">
    			med_goods_cate_name = #{medGoodsCateName,jdbcType=VARCHAR},
    		</if>
            <if test="registKey != null and registKey != ''">
    			regist_key = #{registKey,jdbcType=VARCHAR},
    		</if>
            <if test="price != null and price != ''">
    			price = #{price,jdbcType=DECIMAL},
    		</if>
            <if test="salePrice != null and salePrice != ''">
    			sale_price = #{salePrice,jdbcType=DECIMAL},
    		</if>
            <if test="batSalePrice != null and batSalePrice != ''">
    			bat_sale_price = #{batSalePrice,jdbcType=DECIMAL},
    		</if>
            <if test="productionAddress != null and productionAddress != ''">
    			production_address = #{productionAddress,jdbcType=VARCHAR},
    		</if>
            <if test="dosageForm != null and dosageForm != ''">
    			dosage_form = #{dosageForm,jdbcType=VARCHAR},
    		</if>
            <if test="length != null and length != ''">
    			length = #{length,jdbcType=DECIMAL},
    		</if>
            <if test="width != null and width != ''">
    			width = #{width,jdbcType=DECIMAL},
    		</if>
            <if test="height != null and height != ''">
    			height = #{height,jdbcType=DECIMAL},
    		</if>
            <if test="grossWeight != null and grossWeight != ''">
    			gross_weight = #{grossWeight,jdbcType=DECIMAL},
    		</if>
            <if test="netWeight != null and netWeight != ''">
    			net_weight = #{netWeight,jdbcType=DECIMAL},
    		</if>
            <if test="unitStyle != null and unitStyle != ''">
    			unit_style = #{unitStyle,jdbcType=VARCHAR},
    		</if>
            <if test="bigUnitStyle != null and bigUnitStyle != ''">
    			big_unit_style = #{bigUnitStyle,jdbcType=VARCHAR},
    		</if>
            <if test="bigUnitQty != null and bigUnitQty != ''">
    			big_unit_qty = #{bigUnitQty,jdbcType=DECIMAL},
    		</if>
             <if test="bigBcd != null and bigBcd != ''">
    			big_bcd = #{bigBcd,jdbcType=VARCHAR},
    		</if>
            <if test="minUnitStyle != null and minUnitStyle != ''">
    			min_unit_style = #{minUnitStyle,jdbcType=VARCHAR},
    		</if>
            <if test="minUnitQty != null and minUnitQty != ''">
    			min_unit_qty = #{minUnitQty,jdbcType=DECIMAL},
    		</if>
            <if test="litBcd != null and litBcd != ''">
    			lit_bcd = #{litBcd,jdbcType=VARCHAR},
    		</if>
            <if test="isLotCtrlInput != null and isLotCtrlInput != ''">
    			is_lot_ctrl_input = #{isLotCtrlInput,jdbcType=VARCHAR},
    		</if>
            <if test="bizState != null and bizState != ''">
    			biz_state = #{bizState,jdbcType=VARCHAR},
    		</if>
            <if test="importedFlag != null and importedFlag != ''">
    			imported_flag = #{importedFlag,jdbcType=VARCHAR},
    		</if>
             <if test="reportFlag != null and reportFlag != ''">
    			report_flag = #{reportFlag,jdbcType=VARCHAR},
    		</if>
            <if test="noxiousFlag != null and noxiousFlag != ''">
    			noxious_flag = #{noxiousFlag,jdbcType=VARCHAR},
    		</if>
            <if test="drugNerveFlag != null and drugNerveFlag != ''">
    			drug_nerve_flag = #{drugNerveFlag,jdbcType=VARCHAR},
    		</if>
             <if test="productStandardCode != null and productStandardCode != ''">
    			product_standard_code = #{productStandardCode,jdbcType=VARCHAR},
    		</if>
            <if test="specStandardCode != null and specStandardCode != ''">
    			spec_standard_code = #{specStandardCode,jdbcType=VARCHAR},
    		</if>
            <if test="brand != null and brand != ''">
    			brand = #{brand,jdbcType=VARCHAR},
    		</if>
            <if test="coldFlag != null and coldFlag != ''">
    			cold_flag = #{coldFlag,jdbcType=VARCHAR},
    		</if>
             <if test="supplierCode != null and supplierCode != ''">
    			supplier_code = #{supplierCode,jdbcType=VARCHAR},
    		</if>
	    	<if test="supplierName != null and supplierName != ''">
				supplier_name=#{supplierName,jdbcType=VARCHAR},
		    </if>
		     <if test="memo != null and memo != ''">
				memo=#{memo,jdbcType=VARCHAR}
		    </if>
        </set>
        where med_code = #{medCode,jdbcType=BIGINT}
    </update>
    
    
     <!-- 查询HisCtMedicineMaterial详情 -->
    <select id="get" resultMap="BaseResultMap" parameterType="com.phxl.modules.goods.entity.hisCtMedicineMaterial.HisCtMedicineMaterial">
        select
        <include refid="Base_Column_List"/>
        from med_hli_medicine_material material
        <where>
        	<if test="goodsCode!=null and goodsCode!=''">
        		And goods_code = #{goodsCode,jdbcType=VARCHAR}
        	</if>
        </where>
    </select>

</mapper>