|
@@ -5,8 +5,10 @@
|
|
|
<!--插入数据-->
|
|
|
<!--int insert(ProductCategory productCategory);-->
|
|
|
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into product_category (product_category_name, remark, license_rate, create_person_id, create_person_name)
|
|
|
- values (#{productCategoryName}, #{remark}, #{licenseRate}, #{createPersonId}, #{createPersonName})
|
|
|
+ insert into product_category (product_category_name, remark, license_rate, tenant_id, create_person_id,
|
|
|
+ create_person_name)
|
|
|
+ values (#{productCategoryName}, #{remark}, #{licenseRate}, #{tenantId}, #{createPersonId},
|
|
|
+ #{createPersonName})
|
|
|
</insert>
|
|
|
|
|
|
<!--根据id删除数据-->
|
|
@@ -86,6 +88,9 @@
|
|
|
asso_product_patent where patent_no = #{patentNo} union select product_id from
|
|
|
asso_structure_patent where patent_no = #{patentNo}))
|
|
|
</if>
|
|
|
+ <if test="true">
|
|
|
+ and tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
order by pc_id
|
|
|
</select>
|
|
@@ -125,8 +130,8 @@
|
|
|
<!--按照月份返回总体-->
|
|
|
<select id="categoryQueryByMonth" resultMap="queryByDateMap">
|
|
|
SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'-',MONTH(CONCAT(sale_time,'-02'))) AS market_date,
|
|
|
- sum(sale_money) AS sale_total_money,
|
|
|
- CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
|
|
|
+ sum(sale_money) AS sale_total_money,
|
|
|
+ CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
|
|
|
FROM product_market_data
|
|
|
WHERE product_id IN(SELECT id AS product_id
|
|
|
FROM product
|
|
@@ -204,8 +209,8 @@
|
|
|
<!--按照月份返回每个-->
|
|
|
<select id="queryByMonth" resultMap="queryByDateMap">
|
|
|
SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'-',MONTH(CONCAT(sale_time,'-02'))) AS market_date,
|
|
|
- sum(sale_money) AS sale_total_money,
|
|
|
- CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
|
|
|
+ sum(sale_money) AS sale_total_money,
|
|
|
+ CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
|
|
|
FROM product_market_data
|
|
|
WHERE product_id = #{productId}
|
|
|
<if test="categoryArea != null and categoryArea != ''">
|