灌溉逻辑+修改充值记录接口添加了时间检索

This commit is contained in:
2024-12-31 16:52:55 +08:00
parent 48b18a9e8b
commit aba6f51ea7
17 changed files with 431 additions and 12 deletions

View File

@@ -32,6 +32,30 @@
from ng_user_recharge_records
</sql>
<select id="selectNgUserRechargeRecordsListByTime" parameterType="NgUserRechargeRecordsDto" resultMap="NgUserRechargeRecordsResult">
<include refid="selectNgUserRechargeRecordsVo"/>
<where>
<if test="startTime !=null and endTime!=null">and recharge_time between #{startTime} and #{endTime}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="cardNumber != null and cardNumber != ''"> and card_number = #{cardNumber}</if>
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
<if test="type != null "> and type = #{type}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="balance != null "> and balance = #{balance}</if>
<if test="rechargeTime != null "> and recharge_time = #{rechargeTime}</if>
<if test="rechargeCode != null and rechargeCode != ''"> and recharge_code = #{rechargeCode}</if>
<if test="status != null "> and status = #{status}</if>
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
<if test="deviceNumber != null and deviceNumber != ''"> and device_number = #{deviceNumber}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
</where>
<!-- 添加排序 -->
order by recharge_time desc
</select>
<select id="selectNgUserRechargeRecordsList" parameterType="NgUserRechargeRecords" resultMap="NgUserRechargeRecordsResult">
<include refid="selectNgUserRechargeRecordsVo"/>
<where>

View File

@@ -26,15 +26,18 @@
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="openCumFlow" column="open_cum_flow" />
<result property="closeCumFlow" column="close_cum_flow" />
</resultMap>
<sql id="selectUserIrrigationRecordVo">
select id, user_id, device_number, project_id, dept_id, card_number, area_code, cur_flow, cur_ele, balance, start_time, end_time, duration, unit, last_time, status, remarks, create_time, update_time, create_by, update_by from user_irrigation_record
select id, user_id, device_number, project_id, dept_id, card_number, area_code, cur_flow, cur_ele, balance, start_time, end_time, duration, unit, last_time, status, remarks, create_time, update_time, create_by, update_by,open_cum_flow,close_cum_flow from user_irrigation_record
</sql>
<select id="selectUserIrrigationRecordList" parameterType="UserIrrigationRecord" resultMap="UserIrrigationRecordResult">
<include refid="selectUserIrrigationRecordVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="deviceNumber != null and deviceNumber != ''"> and device_number = #{deviceNumber}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
@@ -51,6 +54,8 @@
<if test="lastTime != null "> and last_time = #{lastTime}</if>
<if test="status != null "> and status = #{status}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="openCumFlow != null "> and open_cum_flow = #{openCumFlow}</if>
<if test="closeCumFlow != null "> and close_cum_flow = #{closeCumFlow}</if>
</where>
</select>
@@ -108,6 +113,8 @@
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="openCumFlow != null">open_cum_flow,</if>
<if test="closeCumFlow != null">close_cum_flow,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
@@ -130,6 +137,8 @@
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="openCumFlow != null">#{openCumFlow},</if>
<if test="closeCumFlow != null">#{closeCumFlow},</if>
</trim>
</insert>
@@ -156,6 +165,8 @@
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="openCumFlow != null">open_cum_flow = #{openCumFlow},</if>
<if test="closeCumFlow != null">close_cum_flow = #{closeCumFlow},</if>
</trim>
where id = #{id}
</update>