From 18c509d71b6b382aa2bf846ba7c9b6d64ade1182 Mon Sep 17 00:00:00 2001 From: suerwei <18810552194@163.com> Date: 星期二, 02 七月 2024 14:39:02 +0800 Subject: [PATCH] 加上传扫描 --- javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml | 41 +++++++++++++++++++++++++++++++++++++++-- 1 files changed, 39 insertions(+), 2 deletions(-) diff --git a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml index fd32d2b..e4801e7 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml +++ b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/TubLogMapper.xml @@ -17,11 +17,14 @@ <result property="number" column="number" /> <result property="unit" column="unit" /> <result property="createDate" column="create_date" /> + <result property="fileUrl" column="file_url" /> <result property="remark" column="remark" /> + <result property="outboundNumber" column="outbound_number" /> + <result property="inboundNumber" column="inbound_number" /> </resultMap> <sql id="selectTubLogVo"> - select id, code, project_id, tub_name, type, outbound_date, inbound_date, opt_user, apply_user, number, unit, create_date, remark from js_tub_log + select id, code, project_id, tub_name, type, outbound_date, inbound_date, opt_user, apply_user, number, unit, create_date, file_url, remark from js_tub_log </sql> <select id="selectTubLogList" parameterType="TubLog" resultMap="TubLogResult"> @@ -45,7 +48,38 @@ <include refid="selectTubLogVo"/> where id = #{id} </select> - + + <select id="selectMaxTubLogId" resultType="java.lang.Integer"> + SELECT MAX(id) FROM js_tub_log where project_id = #{projectId} + </select> + + <select id="countTubLogDate2" resultMap="TubLogResult"> + SELECT + a.tub_name, + b.inbound_number, + a.outbound_number, + a.unit + FROM + ( SELECT tub_name, SUM( number ) AS outbound_number, unit FROM js_tub_log WHERE outbound_date IS NOT NULL GROUP BY tub_name ) a + LEFT JOIN ( SELECT tub_name, SUM( number ) AS inbound_number, unit FROM js_tub_log WHERE inbound_date IS NOT NULL GROUP BY tub_name ) b ON a.tub_name = b.tub_name + </select> + + <select id="countTubLogDate" resultMap="TubLogResult"> + SELECT + a.project_id, + a.tub_name, + b.inbound_number, + a.outbound_number, + a.unit + FROM + ( SELECT project_id, tub_name, SUM( number ) AS outbound_number, unit FROM js_tub_log WHERE outbound_date IS NOT NULL GROUP BY tub_name ) a + LEFT JOIN ( SELECT project_id, tub_name, SUM( number ) AS inbound_number, unit FROM js_tub_log WHERE inbound_date IS NOT NULL GROUP BY tub_name ) b ON a.tub_name = b.tub_name + AND a.project_id = b.project_id + <where> + <if test="projectId != null and projectId != ''"> and a.project_id = #{projectId}</if> + </where> + </select> + <insert id="insertTubLog" parameterType="TubLog" useGeneratedKeys="true" keyProperty="id"> insert into js_tub_log <trim prefix="(" suffix=")" suffixOverrides=","> @@ -60,6 +94,7 @@ <if test="number != null ">number,</if> <if test="unit != null and unit != ''">unit,</if> <if test="createDate != null ">create_date,</if> + <if test="fileUrl != null and fileUrl != ''">file_url,</if> <if test="remark != null and remark != ''">remark,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> @@ -74,6 +109,7 @@ <if test="number != null ">#{number},</if> <if test="unit != null and unit != ''">#{unit},</if> <if test="createDate != null ">#{createDate},</if> + <if test="fileUrl != null and fileUrl != ''">#{fileUrl},</if> <if test="remark != null and remark != ''">#{remark},</if> </trim> </insert> @@ -92,6 +128,7 @@ <if test="number != null ">number = #{number},</if> <if test="unit != null and unit != ''">unit = #{unit},</if> <if test="createDate != null ">create_date = #{createDate},</if> + <if test="fileUrl != null and fileUrl != ''">file_url = #{fileUrl},</if> <if test="remark != null and remark != ''">remark = #{remark},</if> </trim> where id = #{id} -- Gitblit v1.9.1