充值机信息和用户充值记录的逻辑实现以及用户充值卡账单明细和用户充值卡接口修改
This commit is contained in:
@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fastbee.rechargecard.mapper.NgRechargeMachinesMapper">
|
||||
|
||||
<resultMap type="NgRechargeMachines" id="NgRechargeMachinesResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="location" column="location" />
|
||||
<result property="deviceModel" column="device_model" />
|
||||
<result property="serialNumber" column="serial_number" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="installationDate" column="installation_date" />
|
||||
<result property="status" column="status" />
|
||||
<result property="contactPerson" column="contact_person" />
|
||||
<result property="contactPhone" column="contact_phone" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNgRechargeMachinesVo">
|
||||
select id, location, device_model, serial_number, area_code, installation_date, status, contact_person, contact_phone, remark, create_time, update_time, create_by, update_by from ng_recharge_machines
|
||||
</sql>
|
||||
|
||||
<select id="selectNgRechargeMachinesList" parameterType="NgRechargeMachines" resultMap="NgRechargeMachinesResult">
|
||||
<include refid="selectNgRechargeMachinesVo"/>
|
||||
<where>
|
||||
<if test="location != null and location != ''"> and location = #{location}</if>
|
||||
<if test="deviceModel != null and deviceModel != ''"> and device_model = #{deviceModel}</if>
|
||||
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
|
||||
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
|
||||
<if test="installationDate != null "> and installation_date = #{installationDate}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
|
||||
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNgRechargeMachinesById" parameterType="Long" resultMap="NgRechargeMachinesResult">
|
||||
<include refid="selectNgRechargeMachinesVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertNgRechargeMachines" parameterType="NgRechargeMachines" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ng_recharge_machines
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="location != null">location,</if>
|
||||
<if test="deviceModel != null">device_model,</if>
|
||||
<if test="serialNumber != null and serialNumber != ''">serial_number,</if>
|
||||
<if test="areaCode != null">area_code,</if>
|
||||
<if test="installationDate != null">installation_date,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="contactPerson != null">contact_person,</if>
|
||||
<if test="contactPhone != null">contact_phone,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="location != null">#{location},</if>
|
||||
<if test="deviceModel != null">#{deviceModel},</if>
|
||||
<if test="serialNumber != null and serialNumber != ''">#{serialNumber},</if>
|
||||
<if test="areaCode != null">#{areaCode},</if>
|
||||
<if test="installationDate != null">#{installationDate},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="contactPerson != null">#{contactPerson},</if>
|
||||
<if test="contactPhone != null">#{contactPhone},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateNgRechargeMachines" parameterType="NgRechargeMachines">
|
||||
update ng_recharge_machines
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="location != null">location = #{location},</if>
|
||||
<if test="deviceModel != null">device_model = #{deviceModel},</if>
|
||||
<if test="serialNumber != null and serialNumber != ''">serial_number = #{serialNumber},</if>
|
||||
<if test="areaCode != null">area_code = #{areaCode},</if>
|
||||
<if test="installationDate != null">installation_date = #{installationDate},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
|
||||
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNgRechargeMachinesById" parameterType="Long">
|
||||
delete from ng_recharge_machines where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNgRechargeMachinesByIds" parameterType="String">
|
||||
delete from ng_recharge_machines where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fastbee.rechargecard.mapper.NgUserRechargeRecordsMapper">
|
||||
|
||||
<resultMap type="NgUserRechargeRecords" id="NgUserRechargeRecordsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="cardNumber" column="card_number" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="type" column="type" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="rechargeTime" column="recharge_time" />
|
||||
<result property="rechargeCode" column="recharge_code" />
|
||||
<result property="status" column="status" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNgUserRechargeRecordsVo">
|
||||
select id, user_id, user_name, card_number, area_code, type, amount, balance, recharge_time, recharge_code, status, device_id, remark, create_time, update_time, create_by, update_by from ng_user_recharge_records
|
||||
</sql>
|
||||
|
||||
<select id="selectNgUserRechargeRecordsList" parameterType="NgUserRechargeRecords" resultMap="NgUserRechargeRecordsResult">
|
||||
<include refid="selectNgUserRechargeRecordsVo"/>
|
||||
<where>
|
||||
<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="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNgUserRechargeRecordsById" parameterType="Long" resultMap="NgUserRechargeRecordsResult">
|
||||
<include refid="selectNgUserRechargeRecordsVo"/>
|
||||
where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<insert id="insertNgUserRechargeRecords" parameterType="NgUserRechargeRecords" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ng_user_recharge_records
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="cardNumber != null and cardNumber != ''">card_number,</if>
|
||||
<if test="areaCode != null">area_code,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="balance != null">balance,</if>
|
||||
<if test="rechargeTime != null">recharge_time,</if>
|
||||
<if test="rechargeCode != null">recharge_code,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="cardNumber != null and cardNumber != ''">#{cardNumber},</if>
|
||||
<if test="areaCode != null">#{areaCode},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="balance != null">#{balance},</if>
|
||||
<if test="rechargeTime != null">#{rechargeTime},</if>
|
||||
<if test="rechargeCode != null">#{rechargeCode},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateNgUserRechargeRecords" parameterType="NgUserRechargeRecords">
|
||||
update ng_user_recharge_records
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="cardNumber != null and cardNumber != ''">card_number = #{cardNumber},</if>
|
||||
<if test="areaCode != null">area_code = #{areaCode},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="balance != null">balance = #{balance},</if>
|
||||
<if test="rechargeTime != null">recharge_time = #{rechargeTime},</if>
|
||||
<if test="rechargeCode != null">recharge_code = #{rechargeCode},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNgUserRechargeRecordsById" parameterType="Long">
|
||||
delete from ng_user_recharge_records where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNgUserRechargeRecordsByIds" parameterType="String">
|
||||
delete from ng_user_recharge_records where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -27,7 +27,7 @@
|
||||
<result property="paymentMethod" column="payment_method" />
|
||||
<result property="paymentTime" column="payment_time" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remarks" column="remarks" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
@ -35,7 +35,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserConsumptionDetailsVo">
|
||||
select id, user_id, device_number, card_number, project_id, dept_id, billing_type, pump_time, unit_price, total_price, discount, tax_amount, amount_due, billing_period_unit, billing_period_duration, billing_date, start_time, end_time, payment_status, payment_method, payment_time, status, remarks, create_time, update_time, create_by, update_by from user_consumption_details
|
||||
select id, user_id, device_number, card_number, project_id, dept_id, billing_type, pump_time, unit_price, total_price, discount, tax_amount, amount_due, billing_period_unit, billing_period_duration, billing_date, start_time, end_time, payment_status, payment_method, payment_time, status, remark, create_time, update_time, create_by, update_by from user_consumption_details
|
||||
</sql>
|
||||
|
||||
<select id="selectUserConsumptionDetailsList" parameterType="UserConsumptionDetails" resultMap="UserConsumptionDetailsResult">
|
||||
@ -62,7 +62,7 @@
|
||||
<if test="paymentMethod != null "> and payment_method = #{paymentMethod}</if>
|
||||
<if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -102,7 +102,7 @@
|
||||
<if test="paymentMethod != null">payment_method,</if>
|
||||
<if test="paymentTime != null">payment_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remarks != null">remarks,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
@ -130,7 +130,7 @@
|
||||
<if test="paymentMethod != null">#{paymentMethod},</if>
|
||||
<if test="paymentTime != null">#{paymentTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remarks != null">#{remarks},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
@ -162,7 +162,7 @@
|
||||
<if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
|
||||
<if test="paymentTime != null">payment_time = #{paymentTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remarks != null">remarks = #{remarks},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
|
@ -57,10 +57,11 @@
|
||||
<select id="selectUserIrrigationRecordListBycardNumber" parameterType="String" resultMap="UserIrrigationRecordResult">
|
||||
<include refid="selectUserIrrigationRecordVo"/>
|
||||
<where>
|
||||
card_number=#{cardNumber}
|
||||
<if test="cardNumber != null and cardNumber != ''"> card_number = #{cardNumber}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectUserIrrigationRecordById" parameterType="Long" resultMap="UserIrrigationRecordResult">
|
||||
<include refid="selectUserIrrigationRecordVo"/>
|
||||
where id = #{id}
|
||||
|
@ -23,10 +23,11 @@
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserRechargeCardsVo">
|
||||
select id, user_name, name, phone, project_id, dept_id, balance, card_number, card_password, issue_date, expiration_date, status, create_time, update_time, create_by, update_by, del_flag, user_id from user_recharge_cards
|
||||
select id, user_name, name, phone, project_id, dept_id, balance, card_number, card_password, issue_date, expiration_date, status, create_time, update_time, create_by, update_by, del_flag, user_id, area_code from user_recharge_cards
|
||||
</sql>
|
||||
|
||||
<select id="selectUserRechargeCardsList" parameterType="UserRechargeCards" resultMap="UserRechargeCardsResult">
|
||||
@ -44,6 +45,7 @@
|
||||
<if test="expirationDate != null "> and expiration_date = #{expirationDate}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="areaCode != null "> and area_code = #{areaCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -72,6 +74,7 @@
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="areaCode != null ">area_code </if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null">#{userName},</if>
|
||||
@ -91,6 +94,7 @@
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="areaCode != null ">#{areaCode}</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -114,6 +118,7 @@
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="areaCode != null "> area_code = #{areaCode}</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
Reference in New Issue
Block a user