AbnormalPackageMapper.xml 1.9 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.yoho.order.dal.AbnormalPackageMapper">
    <resultMap id="BaseResultMap" type="com.yoho.order.model.AbnormalPackage">
      <result column="id" property="id" jdbcType="INTEGER" />
      <result column="seller_waybillCode" property="sellerWaybillCode" jdbcType="VARCHAR" />
      <result column="is_del" property="isDel" jdbcType="INTEGER" />
      <result column="create_time" property="createTime" jdbcType="INTEGER" />
      <result column="operate_uid" property="operateUid" jdbcType="INTEGER" />
      <result column="update_time" property="updateTime" jdbcType="INTEGER" />
    </resultMap>

    <sql id="Base_Column_List">
        id, seller_waybillCode, is_del, create_time, operate_uid, update_time
    </sql>
    
    <select id="selectValidCnt" resultType="java.lang.Integer">
        select count(1) from abnormal_package where is_del = 0
    </select>
    
    <select id="selectValidSellerWaybillCodeList" resultType="java.lang.String">
        select seller_waybillCode from abnormal_package where is_del=0
    </select>

    <select id="selectBySellerWaybillCode" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from abnormal_package where is_del=0 and seller_waybillCode = #{sellerWaybillCode}
    </select>
    
    <insert id="insert" parameterType="com.yoho.order.model.AbnormalPackage">
        insert into abnormal_package(id, seller_waybillCode, is_del, create_time, operate_uid, update_time)
        values (#{id}, #{sellerWaybillCode}, #{isDel}, #{createTime}, #{operateUid}, #{updateTime})
    </insert>
    
    <update id="update">
        update abnormal_package set operate_uid=#{operateUid}, update_time=#{updateTime}, is_del=0  
        where seller_waybillCode = #{sellerWaybillCode}
    </update>
</mapper>