You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

126 lines
7.1 KiB

<?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="cc.hiver.mall.purchaseocr.mapper.PurchaseOcrPictureMapper">
<resultMap id="BaseResultMap" type="cc.hiver.mall.purchaseocr.entity.PurchaseOcrPicture">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_by_name" jdbcType="VARCHAR" property="createByName" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="del_flag" jdbcType="INTEGER" property="delFlag" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="order_id" jdbcType="VARCHAR" property="orderId" />
<result column="ocr_picture" jdbcType="VARCHAR" property="ocrPicture" />
<result column="ocr_picture_order" jdbcType="VARCHAR" property="ocrPictureOrder" />
<result column="ocr_status" jdbcType="INTEGER" property="ocrStatus" />
<result column="ocr_msg" jdbcType="VARCHAR" property="ocrMsg" />
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
<result column="shop_name" jdbcType="VARCHAR" property="shopName" />
<result column="count" jdbcType="INTEGER" property="count" />
<result column="ocr_count" jdbcType="INTEGER" property="ocrCount" />
<result column="parent_picture_path" jdbcType="VARCHAR" property="parentPicturePath" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, create_by, create_by_name, create_time, del_flag, update_by, update_time, order_id, ocr_picture,
ocr_picture_order, ocr_status, ocr_msg, shop_id, shop_name,count,ocr_count,parent_picture_path
</sql>
<insert id="batchSave" parameterType="java.util.List">
insert into t_purchase_ocr_picture (id, create_by, create_by_name, create_time, del_flag, update_by, update_time, order_id, ocr_picture,
ocr_picture_order, ocr_status, ocr_msg, shop_id, shop_name,count,ocr_count,parent_picture_path) values
<foreach item="purchaseOcrPicture" collection="purchaseOcrPictureList" index="index" separator=",">
(#{purchaseOcrPicture.id,jdbcType=VARCHAR},#{purchaseOcrPicture.createBy,jdbcType=VARCHAR},
#{purchaseOcrPicture.createByName,jdbcType=VARCHAR},#{purchaseOcrPicture.createTime,jdbcType=TIMESTAMP},
#{purchaseOcrPicture.delFlag,jdbcType=INTEGER},#{purchaseOcrPicture.updateBy,jdbcType=VARCHAR},
#{purchaseOcrPicture.updateTime,jdbcType=TIMESTAMP},#{purchaseOcrPicture.orderId,jdbcType=VARCHAR},
#{purchaseOcrPicture.ocrPicture,jdbcType=VARCHAR},#{purchaseOcrPicture.ocrPictureOrder,jdbcType=VARCHAR},
#{purchaseOcrPicture.ocrStatus,jdbcType=INTEGER},#{purchaseOcrPicture.ocrMsg,jdbcType=VARCHAR},
#{purchaseOcrPicture.shopId,jdbcType=VARCHAR},#{purchaseOcrPicture.shopName,jdbcType=VARCHAR},
#{purchaseOcrPicture.count,jdbcType=INTEGER},#{purchaseOcrPicture.ocrCount,jdbcType=INTEGER},#{purchaseOcrPicture.parentPicturePath,jdbcType=VARCHAR})
</foreach>
</insert>
<update id="batchUpdate">
<foreach collection="purchaseOcrPictureList" item="item" separator=";" open="" close="">
UPDATE t_purchase_ocr_picture SET ocr_msg = #{item.ocrMsg} , ocr_status = #{item.ocrStatus} WHERE id = #{item.id}
</foreach>
</update>
<select id="queryAllPictureStatus" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_purchase_ocr_picture
where order_id =#{purchaseId}
</select>
<select id="getOcrCount" resultType="cc.hiver.mall.purchaseocr.vo.PurchaseOcrCountVo">
select
order_id as purchase_Id,ifnull(sum(count),0) as count ,ifnull(sum(ocr_count),0) as ocr_count
from t_purchase_ocr_picture
where shop_id =#{shopId}
group by order_id
</select>
</mapper>