|
@@ -29,7 +29,9 @@
|
|
|
a.monomer_project_description AS "monomerProjectDescription",
|
|
|
a.quoted_price_year AS "quotedPriceYear",
|
|
|
a.quoted_price_month AS "quotedPriceMonth",
|
|
|
- r.project_name as "projectName"
|
|
|
+ a.project_name AS "projectName",
|
|
|
+ a.report_number AS "reportNumber",
|
|
|
+ a.area_id AS "areaId"
|
|
|
</sql>
|
|
|
|
|
|
<sql id="projectJoins">
|
|
@@ -49,8 +51,6 @@
|
|
|
SELECT
|
|
|
<include refid="projectMaterialStorageColumns"/>
|
|
|
FROM project_material_storage a
|
|
|
- left join rural_project_records r on a.project_number = r.id
|
|
|
-<!-- <include refid="projectJoins"/>-->
|
|
|
WHERE a.id = #{id}
|
|
|
</select>
|
|
|
|
|
@@ -66,12 +66,9 @@
|
|
|
<select id="findList" resultType="com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage" >
|
|
|
SELECT
|
|
|
<include refid="projectMaterialStorageColumns"/>
|
|
|
- ,prd.number as 'projectId'
|
|
|
- ,sys_area.name as 'areaName'
|
|
|
+ ,sa.name as 'areaName'
|
|
|
FROM project_material_storage a
|
|
|
- left join rural_project_records as r on a.project_number = r.id
|
|
|
- left join project_report_data as prd on a.project_number = prd.project_id
|
|
|
- LEFT JOIN sys_area on sys_area.id = r.area_id
|
|
|
+ LEFT JOIN sys_area sa on a.area_id = sa.id
|
|
|
<where>
|
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
<if test="projectNumber != null and projectNumber != ''">
|
|
@@ -80,8 +77,14 @@
|
|
|
<if test="dbName == 'mssql'">'%'+#{projectNumber}+'%'</if>
|
|
|
<if test="dbName == 'mysql'">concat('%',#{projectNumber},'%')</if>
|
|
|
</if>
|
|
|
+ <if test="reportNumber != null and reportNumber != ''">
|
|
|
+ AND a.report_number LIKE
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{reportNumber}||'%'</if>
|
|
|
+ <if test="dbName == 'mssql'">'%'+#{reportNumber}+'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">concat('%',#{reportNumber},'%')</if>
|
|
|
+ </if>
|
|
|
<if test="projectName != null and projectName != ''">
|
|
|
- AND r.project_name like concat(concat('%',#{projectName}),'%')
|
|
|
+ AND a.project_name like concat(concat('%',#{projectName}),'%')
|
|
|
</if>
|
|
|
<if test="projectId != null and projectId != ''">
|
|
|
AND prd.number like concat(concat('%',#{projectId}),'%')
|
|
@@ -166,7 +169,7 @@
|
|
|
ORDER BY ${page.orderBy}
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- ORDER BY a.create_date DESC,r.create_date DESC
|
|
|
+ ORDER BY a.create_date DESC
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</select>
|
|
@@ -215,7 +218,10 @@
|
|
|
price_source,
|
|
|
monomer_project_description,
|
|
|
quoted_price_year,
|
|
|
- quoted_price_month
|
|
|
+ quoted_price_month,
|
|
|
+ project_name,
|
|
|
+ report_number,
|
|
|
+ area_id
|
|
|
) VALUES (
|
|
|
#{id},
|
|
|
#{createBy.id},
|
|
@@ -241,7 +247,10 @@
|
|
|
#{priceSource},
|
|
|
#{monomerProjectDescription},
|
|
|
#{quotedPriceYear},
|
|
|
- #{quotedPriceMonth}
|
|
|
+ #{quotedPriceMonth},
|
|
|
+ #{projectName},
|
|
|
+ #{reportNumber},
|
|
|
+ #{areaId}
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
@@ -271,7 +280,10 @@
|
|
|
price_source,
|
|
|
monomer_project_description,
|
|
|
quoted_price_year,
|
|
|
- quoted_price_month
|
|
|
+ quoted_price_month,
|
|
|
+ project_name,
|
|
|
+ report_number,
|
|
|
+ area_id
|
|
|
) VALUES (
|
|
|
#{id},
|
|
|
#{createBy.id},
|
|
@@ -297,7 +309,10 @@
|
|
|
#{priceSource},
|
|
|
#{monomerProjectDescription},
|
|
|
#{quotedPriceYear},
|
|
|
- #{quotedPriceMonth}
|
|
|
+ #{quotedPriceMonth},
|
|
|
+ #{projectName},
|
|
|
+ #{reportNumber},
|
|
|
+ #{areaId}
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
@@ -324,7 +339,10 @@
|
|
|
price_source = #{priceSource},
|
|
|
monomer_project_description = #{monomerProjectDescription},
|
|
|
quoted_price_year = #{quotedPriceYear},
|
|
|
- quoted_price_month = #{quotedPriceMonth}
|
|
|
+ quoted_price_month = #{quotedPriceMonth},
|
|
|
+ project_name = #{projectName},
|
|
|
+ report_number = #{reportNumber},
|
|
|
+ area_id = #{areaId}
|
|
|
WHERE id = #{id}
|
|
|
</update>
|
|
|
|
|
@@ -416,7 +434,10 @@
|
|
|
price_source,
|
|
|
monomer_project_description,
|
|
|
quoted_price_year,
|
|
|
- quoted_price_month
|
|
|
+ quoted_price_month,
|
|
|
+ project_name,
|
|
|
+ report_number,
|
|
|
+ area_id
|
|
|
)
|
|
|
values
|
|
|
<foreach collection="projectMaterialStorageImportList" item="data" separator=",">
|
|
@@ -444,7 +465,10 @@
|
|
|
#{data.priceSource},
|
|
|
#{data.monomerProjectDescription},
|
|
|
#{data.quotedPriceYear},
|
|
|
- #{data.quotedPriceMonth}
|
|
|
+ #{data.quotedPriceMonth},
|
|
|
+ #{data.projectName},
|
|
|
+ #{data.reportNumber},
|
|
|
+ #{data.areaId}
|
|
|
)
|
|
|
</foreach>
|
|
|
</insert>
|
|
@@ -452,13 +476,9 @@
|
|
|
<select id="queryCount" resultType="int">
|
|
|
|
|
|
SELECT
|
|
|
- count(1)
|
|
|
- FROM project_material_storage a
|
|
|
- left join rural_project_records as r
|
|
|
- on a.project_number = r.id
|
|
|
- LEFT JOIN sys_area
|
|
|
- on sys_area.id = r.area_id
|
|
|
- left join project_report_data as prd on a.project_number = prd.project_id
|
|
|
+ count(1)
|
|
|
+ FROM project_material_storage a
|
|
|
+ LEFT JOIN sys_area sa on a.area_id = sa.id
|
|
|
<where>
|
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
<if test="projectNumber != null and projectNumber != ''">
|
|
@@ -467,8 +487,14 @@
|
|
|
<if test="dbName == 'mssql'">'%'+#{projectNumber}+'%'</if>
|
|
|
<if test="dbName == 'mysql'">concat('%',#{projectNumber},'%')</if>
|
|
|
</if>
|
|
|
+ <if test="reportNumber != null and reportNumber != ''">
|
|
|
+ AND a.report_number LIKE
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{reportNumber}||'%'</if>
|
|
|
+ <if test="dbName == 'mssql'">'%'+#{reportNumber}+'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">concat('%',#{reportNumber},'%')</if>
|
|
|
+ </if>
|
|
|
<if test="projectName != null and projectName != ''">
|
|
|
- AND r.project_name like concat(concat('%',#{projectName}),'%')
|
|
|
+ AND a.project_name like concat(concat('%',#{projectName}),'%')
|
|
|
</if>
|
|
|
<if test="projectId != null and projectId != ''">
|
|
|
AND prd.number like concat(concat('%',#{projectId}),'%')
|
|
@@ -476,9 +502,70 @@
|
|
|
<if test="materialName != null and materialName != ''">
|
|
|
AND a.material_name like concat(concat('%',#{materialName}),'%')
|
|
|
</if>
|
|
|
- <if test="areaName != null and areaName != ''">
|
|
|
- AND r.area_name like concat(concat('%',#{areaName}),'%')
|
|
|
+ <if test="brand != null and brand != ''">
|
|
|
+ AND a.brand like concat(concat('%',#{brand}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="specifications != null and specifications != ''">
|
|
|
+ AND a.specifications like concat(concat('%',#{specifications}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="unit != null and unit != ''">
|
|
|
+ AND a.unit like concat(concat('%',#{unit}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="explain != null and explain != ''">
|
|
|
+ AND a.explain like concat(concat('%',#{explain}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="supplier != null and supplier != ''">
|
|
|
+ AND a.supplier like concat(concat('%',#{supplier}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="monomerProjectDescription != null and monomerProjectDescription != ''">
|
|
|
+ AND a.monomer_project_description like concat(concat('%',#{monomerProjectDescription}),'%')
|
|
|
</if>
|
|
|
+ <if test="priceSource != null and priceSource != ''">
|
|
|
+ AND a.price_source = #{priceSource}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="beginProjectPriceIncludingTax !=null and beginProjectPriceIncludingTax != ''">
|
|
|
+ AND a.project_price_including_tax >= #{beginProjectPriceIncludingTax}
|
|
|
+ </if>
|
|
|
+ <if test="endProjectPriceIncludingTax !=null and endProjectPriceIncludingTax != ''">
|
|
|
+ AND a.project_price_including_tax <= #{endProjectPriceIncludingTax}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="beginMarketPriceIncludingTax !=null and beginMarketPriceIncludingTax != ''">
|
|
|
+ AND a.market_price_including_tax >= #{beginMarketPriceIncludingTax}
|
|
|
+ </if>
|
|
|
+ <if test="endMarketPriceIncludingTax !=null and endMarketPriceIncludingTax != ''">
|
|
|
+ AND a.market_price_including_tax <= #{endMarketPriceIncludingTax}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="beginProjectPriceExcludingTax !=null and beginProjectPriceExcludingTax != ''">
|
|
|
+ AND a.project_price_excluding_tax >= #{beginProjectPriceExcludingTax}
|
|
|
+ </if>
|
|
|
+ <if test="endProjectPriceExcludingTax !=null and endProjectPriceExcludingTax != ''">
|
|
|
+ AND a.project_price_excluding_tax <= #{endProjectPriceExcludingTax}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="beginMarketPriceExcludingTax !=null and beginMarketPriceExcludingTax != ''">
|
|
|
+ AND a.market_price_excluding_tax >= #{beginMarketPriceExcludingTax}
|
|
|
+ </if>
|
|
|
+ <if test="endMarketPriceExcludingTax !=null and endMarketPriceExcludingTax != ''">
|
|
|
+ AND a.market_price_excluding_tax <= #{endMarketPriceExcludingTax}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="beginTaxRate !=null and beginTaxRate != ''">
|
|
|
+ AND a.tax_rate >= #{beginTaxRate}
|
|
|
+ </if>
|
|
|
+ <if test="endTaxRate !=null and endTaxRate != ''">
|
|
|
+ AND a.tax_rate <= #{endTaxRate}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="beginQuotedPriceDate !=null">
|
|
|
+ AND a.quoted_price_date >= #{beginQuotedPriceDate}
|
|
|
+ </if>
|
|
|
+ <if test="endQuotedPriceDate !=null">
|
|
|
+ AND a.quoted_price_date < #{endQuotedPriceDate}
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="beginDate !=null">
|
|
|
AND a.create_date >= #{beginDate}
|
|
|
</if>
|