IMProductConfigureMapper.xml 1.6 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.sibu.orderHelper.integral.web.dao.IMWebProductConfigureDao">
	<select id="listProductConfigure" resultMap="resultProductConfigureBean" parameterType="String">
		SELECT * from im_product_configure WHERE supplier_id = #{id}
	</select>

	<select id="totalProductConfigure" resultType="int" parameterType="String">
		SELECT count(*) from im_product_configure WHERE supplier_id = #{id}
	</select>
	
	<insert id="addProductConfigure" parameterType="IMProductConfigureBean">
		insert into im_product_configure (configure_id,configure_type,integral,money,freight,is_enable,supplier_id,supplier_name)
		value(
			#{configureId},
			#{configureType},
			#{integral},
			#{money},
			#{freight},
			#{isEnable},
			#{supplierId},
			#{isEnable}
		)
	</insert>
	
	<update id="updateProductConfigure" parameterType="IMProductConfigureBean">
		update im_product_configure set 
			integral = #{integral},
			money = #{money},
			freight = #{freight},
			is_enable = #{isEnable} 
		where configure_id = #{configureId} and configure_type = #{configureType} 
	</update>
	
	<resultMap type="IMProductConfigureBean" id="resultProductConfigureBean">
		<result column="configure_id" property="configureId" />
		<result column="configure_type" property="configureType" />
		<result column="integral" property="integral" />
		<result column="money" property="money" />
		<result column="freight" property="freight" />
		<result column="is_enable" property="isEnable" />
	</resultMap>
</mapper>