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.

114 lines
6.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.saleaimsg.mapper.SaleAiMsgMapper">
<resultMap id="BaseResultMap" type="cc.hiver.mall.saleaimsg.entity.SaleAiMsg">
<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="ai_msg" jdbcType="VARCHAR" property="aiMsg" />
<result column="ai_status" jdbcType="INTEGER" property="aiStatus" />
<result column="ai_result_msg" jdbcType="VARCHAR" property="aiResultMsg" />
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
<result column="shop_name" jdbcType="VARCHAR" property="shopName" />
</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, ai_msg,
ai_status, ai_result_msg, shop_id, shop_name
</sql>
<insert id="batchSave" parameterType="java.util.List">
insert into t_sale_ai_msg (id, create_by, create_by_name, create_time, del_flag, update_by, update_time, order_id, ai_msg,
ai_status, ai_result_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.aiMsg,jdbcType=VARCHAR},
#{purchaseOcrPicture.aiStatus,jdbcType=INTEGER},#{purchaseOcrPicture.aiResultMsg,jdbcType=VARCHAR},
#{purchaseOcrPicture.shopId,jdbcType=VARCHAR},#{purchaseOcrPicture.shopName,jdbcType=VARCHAR})
</foreach>
</insert>
<update id="batchUpdate">
<foreach collection="purchaseOcrPictureList" item="item" separator=";" open="" close="">
UPDATE t_sale_ai_msg SET ai_result_msg = #{item.aiResultMsg} , ai_status = #{item.aiStatus} WHERE id = #{item.id}
</foreach>
</update>
<select id="querySaleAiMsgBySaleId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_sale_ai_msg
where order_id =#{purchaseId}
</select>
</mapper>