<?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.fuxi.ws.data.dao.WShipmentMapper">
	<resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WShipment">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		<id column="Province" property="province" jdbcType="BIGINT" />
		<result column="name" property="name" jdbcType="VARCHAR" />
		<result column="Fee" property="fee" jdbcType="DECIMAL" />
		<result column="Created" property="created" jdbcType="TIMESTAMP" />
		<result column="Creater" property="creater" jdbcType="VARCHAR" />
		<result column="Modified" property="modified" jdbcType="TIMESTAMP" />
		<result column="Modifier" property="modifier" jdbcType="VARCHAR" />
	</resultMap>
	<sql id="Example_Where_Clause">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		<where>
			<foreach collection="oredCriteria" item="criteria" separator="or">
				<if test="criteria.valid">
					<trim prefix="(" suffix=")" prefixOverrides="and">
						<foreach collection="criteria.criteria" item="criterion">
							<choose>
								<when test="criterion.noValue">
									and ${criterion.condition}
								</when>
								<when test="criterion.singleValue">
									and ${criterion.condition} #{criterion.value}
								</when>
								<when test="criterion.betweenValue">
									and ${criterion.condition} #{criterion.value}
									and
									#{criterion.secondValue}
								</when>
								<when test="criterion.listValue">
									and ${criterion.condition}
									<foreach collection="criterion.value" item="listItem"
										open="(" close=")" separator=",">
										#{listItem}
									</foreach>
								</when>
							</choose>
						</foreach>
					</trim>
				</if>
			</foreach>
		</where>
	</sql>
	<sql id="Base_Column_List">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		Province, name, Fee, Created, Creater, Modified, Modifier
	</sql>
	<select id="selectByExample" resultMap="BaseResultMap"
		parameterType="com.fuxi.ws.data.entity.WShipmentExample">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		select
		<if test="distinct">
			distinct
		</if>
		'false' as QUERYID,
		<include refid="Base_Column_List" />
		from W_Shipment
		<if test="_parameter != null">
			<include refid="Example_Where_Clause" />
		</if>
		<if test="orderByClause != null">
			order by ${orderByClause}
		</if>
	</select>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
		parameterType="java.lang.Long">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		select
		<include refid="Base_Column_List" />
		from W_Shipment
		where Province = #{province,jdbcType=BIGINT}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		delete from W_Shipment
		where Province = #{province,jdbcType=BIGINT}
	</delete>
	<insert id="insert" parameterType="com.fuxi.ws.data.entity.WShipment">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		insert into W_Shipment (Province, name, Fee,
		Created, Creater,
		Modified,
		Modifier)
		values (#{province,jdbcType=BIGINT},
		#{name,jdbcType=VARCHAR},
		#{fee,jdbcType=DECIMAL},
		#{created,jdbcType=TIMESTAMP}, #{creater,jdbcType=VARCHAR},
		#{modified,jdbcType=TIMESTAMP},
		#{modifier,jdbcType=VARCHAR})
	</insert>
	<insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WShipment">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		insert into W_Shipment
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="province != null">
				Province,
			</if>
			<if test="name != null">
				name,
			</if>
			<if test="fee != null">
				Fee,
			</if>
			<if test="created != null">
				Created,
			</if>
			<if test="creater != null">
				Creater,
			</if>
			<if test="modified != null">
				Modified,
			</if>
			<if test="modifier != null">
				Modifier,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="province != null">
				#{province,jdbcType=BIGINT},
			</if>
			<if test="name != null">
				#{name,jdbcType=VARCHAR},
			</if>
			<if test="fee != null">
				#{fee,jdbcType=DECIMAL},
			</if>
			<if test="created != null">
				#{created,jdbcType=TIMESTAMP},
			</if>
			<if test="creater != null">
				#{creater,jdbcType=VARCHAR},
			</if>
			<if test="modified != null">
				#{modified,jdbcType=TIMESTAMP},
			</if>
			<if test="modifier != null">
				#{modifier,jdbcType=VARCHAR},
			</if>
		</trim>
	</insert>
	<select id="countByExample" parameterType="com.fuxi.ws.data.entity.WShipmentExample"
		resultType="java.lang.Integer">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		select count(*) from W_Shipment
		<if test="_parameter != null">
			<include refid="Example_Where_Clause" />
		</if>
	</select>
	<update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WShipment">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		update W_Shipment
		<set>
			<if test="name != null">
				name = #{name,jdbcType=VARCHAR},
			</if>
			<if test="fee != null">
				Fee = #{fee,jdbcType=DECIMAL},
			</if>
			<if test="created != null">
				Created = #{created,jdbcType=TIMESTAMP},
			</if>
			<if test="creater != null">
				Creater = #{creater,jdbcType=VARCHAR},
			</if>
			<if test="modified != null">
				Modified = #{modified,jdbcType=TIMESTAMP},
			</if>
			<if test="modifier != null">
				Modifier = #{modifier,jdbcType=VARCHAR},
			</if>
		</set>
		where Province = #{province,jdbcType=BIGINT}
	</update>
	<update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WShipment">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Fri Nov 20 
			12:25:09 CST 2015. -->
		update W_Shipment
		set name = #{name,jdbcType=VARCHAR},
		Fee =
		#{fee,jdbcType=DECIMAL},
		Created = #{created,jdbcType=TIMESTAMP},
		Creater = #{creater,jdbcType=VARCHAR},
		Modified =
		#{modified,jdbcType=TIMESTAMP},
		Modifier = #{modifier,jdbcType=VARCHAR}
		where Province = #{province,jdbcType=BIGINT}
	</update>

	<!-- 获取最大和最小运费 -->
	<select id="getMaxAndMinFee" resultType="java.util.LinkedHashMap">
		select MAX(fee)
		max,MIN(fee) min
		from W_ShipMent where fee is not null and fee != 0
	</select>
</mapper>