|
@@ -41,7 +41,7 @@
|
|
|
|
|
|
<select id="findList" resultType="com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage" >
|
|
|
SELECT
|
|
|
- a.id,a.material_name,a.price,a.create_date as createDate,r.project_name,sys_area.name as 'areaName',a.project_number as 'projectNumber',a.unit as 'unit',r.project_id as 'projectId'
|
|
|
+ a.id,a.material_name,a.price,a.create_date as createDate,r.project_name,sys_area.name as 'areaName',a.project_number as 'projectNumber',a.unit as 'unit',r.project_id as 'projectId',a.create_by as 'createBy.id'
|
|
|
FROM project_material_storage a
|
|
|
left join rural_project_records as r
|
|
|
on a.project_number = r.id
|
|
@@ -70,9 +70,7 @@
|
|
|
<if test="endDate !=null">
|
|
|
AND a.create_date < #{endDate}
|
|
|
</if>
|
|
|
- <if test="projectId !=null">
|
|
|
- AND r.project_id like concat(concat('%',#{projectId}),'%')
|
|
|
- </if>
|
|
|
+
|
|
|
</where>
|
|
|
<choose>
|
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
@@ -200,4 +198,54 @@
|
|
|
(#{data.id},#{data.createDate},#{data.delFlag},#{data.materialName},#{data.price},' ',#{data.projectNumber},#{data.updateBy.id},#{data.updateDate},#{data.createBy.id},#{data.unit})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
+
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
+<!-- select count(1)-->
|
|
|
+<!-- from project_material_storage a-->
|
|
|
+<!-- <where>-->
|
|
|
+<!-- a.del_flag = 0-->
|
|
|
+<!-- AND a.del_flag = #{DEL_FLAG_NORMAL}-->
|
|
|
+<!-- <if test="projectId !=null">-->
|
|
|
+<!-- AND a.project_id like concat(concat('%',#{projectId}),'%')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </where>-->
|
|
|
+
|
|
|
+ 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
|
|
|
+ <where>
|
|
|
+ a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
+ <if test="projectNumber != null and projectNumber != ''">
|
|
|
+ AND a.project_number LIKE
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{projectNumber}||'%'</if>
|
|
|
+ <if test="dbName == 'mssql'">'%'+#{projectNumber}+'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">concat('%',#{projectNumber},'%')</if>
|
|
|
+ </if>
|
|
|
+ <if test="projectName != null and projectName != ''">
|
|
|
+ AND r.project_name like concat(concat('%',#{projectName}),'%')
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ <if test="beginDate !=null">
|
|
|
+ AND a.create_date >= #{beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null">
|
|
|
+ AND a.create_date < #{endDate}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|