|
|
|
@ -30,6 +30,7 @@ |
|
|
|
<result column="print_barcode" jdbcType="VARCHAR" property="printBarcode" /> |
|
|
|
<result column="product_count" jdbcType="INTEGER" property="productCount" /> |
|
|
|
<result column="ocr_picture_path" jdbcType="VARCHAR" property="ocrPicturePath" /> |
|
|
|
<result column="sort" jdbcType="INTEGER" property="sort" /> |
|
|
|
</resultMap> |
|
|
|
<sql id="Example_Where_Clause"> |
|
|
|
<where> |
|
|
|
@ -93,7 +94,7 @@ |
|
|
|
id, create_by, create_time, del_flag, update_by, update_time, purchase_id, product_id, |
|
|
|
product_name, unit, shop_id, category_id, attribute_list, supplier_id,supplier_name, product_sn, |
|
|
|
barcode, price, purchase_price, wholesale_price, product_picture, product_video, |
|
|
|
product_intro, sales_week, tail_warn, print_barcode, product_count,ocr_picture_path |
|
|
|
product_intro, sales_week, tail_warn, print_barcode, product_count,ocr_picture_path,sort |
|
|
|
</sql> |
|
|
|
<select id="selectByExample" parameterType="cc.hiver.mall.entity.PurchaseDetailExample" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
@ -134,7 +135,7 @@ |
|
|
|
barcode, price, purchase_price, |
|
|
|
wholesale_price, product_picture, product_video, |
|
|
|
product_intro, sales_week, tail_warn, |
|
|
|
print_barcode, product_count,ocr_picture_path) |
|
|
|
print_barcode, product_count,ocr_picture_path,sort) |
|
|
|
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
|
|
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
|
|
|
#{purchaseId,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, |
|
|
|
@ -143,7 +144,7 @@ |
|
|
|
#{barcode,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{purchasePrice,jdbcType=DECIMAL}, |
|
|
|
#{wholesalePrice,jdbcType=DECIMAL}, #{productPicture,jdbcType=VARCHAR}, #{productVideo,jdbcType=VARCHAR}, |
|
|
|
#{productIntro,jdbcType=VARCHAR}, #{salesWeek,jdbcType=TIMESTAMP}, #{tailWarn,jdbcType=INTEGER}, |
|
|
|
#{printBarcode,jdbcType=VARCHAR}, #{productCount,jdbcType=INTEGER},#{ocrPicturePath,jdbcType=VARCHAR}) |
|
|
|
#{printBarcode,jdbcType=VARCHAR}, #{productCount,jdbcType=INTEGER},#{ocrPicturePath,jdbcType=VARCHAR},#{sort,jdbcType=INTEGER}) |
|
|
|
</insert> |
|
|
|
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.PurchaseDetail"> |
|
|
|
insert into t_purchase_detail |
|
|
|
@ -232,6 +233,9 @@ |
|
|
|
<if test="ocrPicturePath != null"> |
|
|
|
ocr_picture_path, |
|
|
|
</if> |
|
|
|
<if test="sort != null"> |
|
|
|
sort, |
|
|
|
</if> |
|
|
|
|
|
|
|
</trim> |
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
|
@ -319,6 +323,9 @@ |
|
|
|
<if test="ocrPicturePath != null"> |
|
|
|
#{ocrPicturePath,jdbcType=VARCHAR}, |
|
|
|
</if> |
|
|
|
<if test="sort != null"> |
|
|
|
#{sort,jdbcType=INTEGER}, |
|
|
|
</if> |
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
<select id="countByExample" parameterType="cc.hiver.mall.entity.PurchaseDetailExample" resultType="java.lang.Long"> |
|
|
|
@ -414,6 +421,9 @@ |
|
|
|
<if test="record.ocrPicturePath != null"> |
|
|
|
ocr_picture_path = #{record.ocrPicturePath,jdbcType=VARCHAR}, |
|
|
|
</if> |
|
|
|
<if test="record.sort != null"> |
|
|
|
sort = #{record.sort,jdbcType=INTEGER}, |
|
|
|
</if> |
|
|
|
</set> |
|
|
|
<if test="_parameter != null"> |
|
|
|
<include refid="Update_By_Example_Where_Clause" /> |
|
|
|
@ -448,7 +458,8 @@ |
|
|
|
tail_warn = #{record.tailWarn,jdbcType=INTEGER}, |
|
|
|
print_barcode = #{record.printBarcode,jdbcType=VARCHAR}, |
|
|
|
product_count = #{record.productCount,jdbcType=INTEGER}, |
|
|
|
ocr_picture_path = #{record.ocrPicturePath,jdbcType=VARCHAR} |
|
|
|
ocr_picture_path = #{record.ocrPicturePath,jdbcType=VARCHAR}, |
|
|
|
sort = #{record.sort,jdbcType=INTEGER} |
|
|
|
<if test="_parameter != null"> |
|
|
|
<include refid="Update_By_Example_Where_Clause" /> |
|
|
|
</if> |
|
|
|
@ -537,6 +548,9 @@ |
|
|
|
<if test="ocrPicturePath != null"> |
|
|
|
ocr_picture_path = #{ocrPicturePath,jdbcType=VARCHAR}, |
|
|
|
</if> |
|
|
|
<if test="sort != null"> |
|
|
|
sort = #{sort,jdbcType=INTEGER}, |
|
|
|
</if> |
|
|
|
</set> |
|
|
|
where id = #{id,jdbcType=VARCHAR} |
|
|
|
</update> |
|
|
|
@ -568,7 +582,8 @@ |
|
|
|
tail_warn = #{tailWarn,jdbcType=INTEGER}, |
|
|
|
print_barcode = #{printBarcode,jdbcType=VARCHAR}, |
|
|
|
product_count = #{productCount,jdbcType=INTEGER}, |
|
|
|
ocr_picture_path = #{ocrPicturePath,jdbcType=VARCHAR} |
|
|
|
ocr_picture_path = #{ocrPicturePath,jdbcType=VARCHAR}, |
|
|
|
sort = #{sort,jdbcType=INTEGER} |
|
|
|
where id = #{id,jdbcType=VARCHAR} |
|
|
|
</update> |
|
|
|
|
|
|
|
@ -578,7 +593,7 @@ |
|
|
|
<include refid="Base_Column_List" /> |
|
|
|
from t_purchase_detail |
|
|
|
where purchase_id = #{id,jdbcType=VARCHAR} |
|
|
|
order by create_time desc |
|
|
|
order by create_time desc ,sort asc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getByPurchaseIdList" resultMap="BaseResultMap"> |
|
|
|
@ -599,7 +614,7 @@ |
|
|
|
insert into t_purchase_detail (id, create_by, create_time, del_flag, update_by, update_time, purchase_id, product_id, |
|
|
|
product_name, unit, shop_id, category_id, attribute_list, supplier_id,supplier_name, product_sn, |
|
|
|
barcode, price, purchase_price, wholesale_price, product_picture, product_video, |
|
|
|
product_intro, sales_week, tail_warn, print_barcode, product_count, ocr_picture_path) values |
|
|
|
product_intro, sales_week, tail_warn, print_barcode, product_count, ocr_picture_path,sort) values |
|
|
|
<foreach item="purchaseDetail" collection="purchaseDetails" index="index" separator=","> |
|
|
|
(#{purchaseDetail.id}, #{purchaseDetail.createBy}, #{purchaseDetail.createTime}, #{purchaseDetail.delFlag}, |
|
|
|
#{purchaseDetail.updateBy}, #{purchaseDetail.updateTime}, #{purchaseDetail.purchaseId}, #{purchaseDetail.productId}, |
|
|
|
@ -607,7 +622,8 @@ |
|
|
|
#{purchaseDetail.attributeList}, #{purchaseDetail.supplierId}, #{purchaseDetail.supplierName}, #{purchaseDetail.productSn}, |
|
|
|
#{purchaseDetail.barcode}, #{purchaseDetail.price}, #{purchaseDetail.purchasePrice}, #{purchaseDetail.wholesalePrice}, |
|
|
|
#{purchaseDetail.productPicture}, #{purchaseDetail.productVideo}, #{purchaseDetail.productIntro}, |
|
|
|
#{purchaseDetail.salesWeek}, #{purchaseDetail.tailWarn}, #{purchaseDetail.printBarcode}, #{purchaseDetail.productCount},#{purchaseDetail.ocrPicturePath}) |
|
|
|
#{purchaseDetail.salesWeek}, #{purchaseDetail.tailWarn}, #{purchaseDetail.printBarcode}, #{purchaseDetail.productCount}, |
|
|
|
#{purchaseDetail.ocrPicturePath},#{purchaseDetail.sort}) |
|
|
|
</foreach> |
|
|
|
|
|
|
|
</insert> |
|
|
|
@ -631,6 +647,12 @@ |
|
|
|
update t_purchase_detail set del_flag = '1' where purchase_id = #{purchaseId,jdbcType=VARCHAR} |
|
|
|
</update> |
|
|
|
|
|
|
|
<!--根据入库单id真删除--> |
|
|
|
<delete id="realDeleteByPurchaseId" parameterType="java.lang.String"> |
|
|
|
delete from t_purchase_detail |
|
|
|
where purchase_id = #{purchaseId,jdbcType=VARCHAR} |
|
|
|
</delete> |
|
|
|
|
|
|
|
<select id="getPurchaseDetails" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="Base_Column_List"/> |
|
|
|
|