This commit is contained in:
2023-03-04 16:29:55 +08:00
commit 397ba75479
1007 changed files with 109050 additions and 0 deletions

View File

@@ -0,0 +1,114 @@
<?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.jsowell.pile.mapper.MemberTransactionRecordMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.MemberTransactionRecord">
<!--@mbg.generated-->
<!--@Table member_transaction_record-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="scenario_type" jdbcType="VARCHAR" property="scenarioType" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="action_type" jdbcType="VARCHAR" property="actionType" />
<result column="pay_mode" jdbcType="VARCHAR" property="payMode" />
<result column="amount" jdbcType="VARCHAR" property="amount" />
<result column="out_trade_no" jdbcType="VARCHAR" property="outTradeNo" />
<result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
<result column="out_refund_no" jdbcType="VARCHAR" property="outRefundNo" />
<result column="refund_id" jdbcType="VARCHAR" property="refundId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, order_code, scenario_type, member_id, action_type, pay_mode, amount, out_trade_no,
transaction_id, out_refund_no, refund_id, create_time
</sql>
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.MemberTransactionRecord">
<!--@mbg.generated-->
insert into member_transaction_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="orderCode != null and orderCode != ''">
order_code,
</if>
<if test="scenarioType != null and scenarioType != ''">
scenario_type,
</if>
<if test="memberId != null and memberId != ''">
member_id,
</if>
<if test="actionType != null and actionType != ''">
action_type,
</if>
<if test="payMode != null and payMode != ''">
pay_mode,
</if>
<if test="amount != null and amount != ''">
amount,
</if>
<if test="outTradeNo != null and outTradeNo != ''">
out_trade_no,
</if>
<if test="transactionId != null and transactionId != ''">
transaction_id,
</if>
<if test="outRefundNo != null and outRefundNo != ''">
out_refund_no,
</if>
<if test="refundId != null and refundId != ''">
refund_id,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="orderCode != null and orderCode != ''">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="scenarioType != null and scenarioType != ''">
#{scenarioType,jdbcType=VARCHAR},
</if>
<if test="memberId != null and memberId != ''">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="actionType != null and actionType != ''">
#{actionType,jdbcType=VARCHAR},
</if>
<if test="payMode != null and payMode != ''">
#{payMode,jdbcType=VARCHAR},
</if>
<if test="amount != null and amount != ''">
#{amount,jdbcType=VARCHAR},
</if>
<if test="outTradeNo != null and outTradeNo != ''">
#{outTradeNo,jdbcType=VARCHAR},
</if>
<if test="transactionId != null and transactionId != ''">
#{transactionId,jdbcType=VARCHAR},
</if>
<if test="outRefundNo != null and outRefundNo != ''">
#{outRefundNo,jdbcType=VARCHAR},
</if>
<if test="refundId != null and refundId != ''">
#{refundId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="selectByMemberId" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM `member_transaction_record`
where member_id = #{memberId,jdbcType=VARCHAR}
order by create_time desc
</select>
</mapper>

View File

@@ -0,0 +1,211 @@
<?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.jsowell.pile.mapper.MemberBasicInfoMapper">
<resultMap type="com.jsowell.pile.domain.MemberBasicInfo" id="MemberBasicInfoResult">
<result property="id" column="id" />
<result property="memberId" column="member_id"/>
<result property="openId" column="open_id"/>
<result property="nickName" column="nick_name" />
<result property="logicCard" column="logic_card"/>
<result property="physicsCard" column="physics_card"/>
<result property="status" column="status" />
<result property="avatarUrl" column="avatar_url" />
<result property="mobileNumber" column="mobile_number" />
<result property="merchantId" column="merchant_id" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectMemberBasicInfoVo">
select
<include refid="Base_Column_List"/>
from member_basic_info
</sql>
<sql id="Base_Column_List">
<!--@mbg.generated PileBillingTemplate-->
id, member_id, open_id, nick_name,logic_card, physics_card, status, avatar_url, mobile_number, merchant_id, remark,
create_time, create_by, update_time, update_by, del_flag
</sql>
<select id="selectMemberBasicInfoList" parameterType="com.jsowell.pile.domain.MemberBasicInfo" resultMap="MemberBasicInfoResult">
<include refid="selectMemberBasicInfoVo"/>
<where>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="logicCard != null and logicCard != ''"> and logic_card = #{logicCard}</if>
<if test="physicsCard != null and physicsCard != ''"> and physics_card = #{physicsCard}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="avatarUrl != null and avatarUrl != ''"> and avatar_url = #{avatarUrl}</if>
<if test="mobileNumber != null and mobileNumber != ''"> and mobile_number = #{mobileNumber}</if>
<if test="merchantId != null "> and merchant_id = #{merchantId}</if>
</where>
</select>
<select id="selectMemberBasicInfoById" parameterType="Integer" resultMap="MemberBasicInfoResult">
<include refid="selectMemberBasicInfoVo"/>
where id = #{id}
</select>
<insert id="insertMemberBasicInfo" parameterType="com.jsowell.pile.domain.MemberBasicInfo" useGeneratedKeys="true" keyProperty="id">
insert into member_basic_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="memberId != null">member_id,</if>
<if test="openId != null">open_id,</if>
<if test="nickName != null">nick_name,</if>
<if test="logicCard != null">logic_card,</if>
<if test="physicsCard != null">physics_card,</if>
<if test="status != null">status,</if>
<if test="avatarUrl != null">avatar_url,</if>
<if test="mobileNumber != null">mobile_number,</if>
<if test="merchantId != null">merchant_id,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="memberId != null">#{memberId},</if>
<if test="openId != null">#{openId},</if>
<if test="nickName != null">#{nickName},</if>
<if test="logicCard != null">#{logicCard},</if>
<if test="physicsCard != null">#{physicsCard},</if>
<if test="status != null">#{status},</if>
<if test="avatarUrl != null">#{avatarUrl},</if>
<if test="mobileNumber != null">#{mobileNumber},</if>
<if test="merchantId != null">#{merchantId},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateMemberBasicInfo" parameterType="com.jsowell.pile.domain.MemberBasicInfo">
update member_basic_info
<trim prefix="SET" suffixOverrides=",">
<if test="memberId != null">member_id = #{memberId},</if>
<if test="openId != null">open_id = #{openId},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="logicCard != null">logic_card = #{logicCard},</if>
<if test="physicsCard != null">physics_card = #{physicsCard},</if>
<if test="status != null">status = #{status},</if>
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
<if test="mobileNumber != null">mobile_number = #{mobileNumber},</if>
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMemberBasicInfoByIds" parameterType="String">
delete from member_basic_info where id in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectInfoByPhysicsCard" resultType="com.jsowell.pile.vo.uniapp.MemberVO">
SELECT
t1.member_id as memberId,
t1.STATUS as status,
t1.nick_name as nickName,
t1.mobile_number as mobileNumber,
t1.password,
t1.avatar_url,
t1.logic_card,
t1.physics_card,
t1.merchant_id,
t1.remark,
t1.create_time,
t1.create_by,
t1.update_time,
t1.update_by,
t1.del_flag,
t2.principal_balance as principalBalance,
t2.gift_balance as giftBalance
FROM
member_basic_info t1
JOIN member_wallet_info t2 ON t1.member_id = t2.member_id
where t1.del_flag = '0'
and physics_card = #{physicsCard,jdbcType=VARCHAR}
</select>
<select id="selectInfoByMobileNumberAndMerchantId" resultMap="MemberBasicInfoResult">
select
<include refid="Base_Column_List"/>
from member_basic_info
where del_flag = '0'
and mobile_number = #{mobileNumber,jdbcType=VARCHAR}
<if test="merchantId != null and merchantId != ''" >
and merchant_id = #{merchantId,jdbcType=VARCHAR}
</if>
order by create_time DESC, update_time DESC
limit 1
</select>
<select id="selectInfoByMemberId" resultMap="MemberBasicInfoResult">
SELECT
<include refid="Base_Column_List"/>
FROM member_basic_info
WHERE del_flag = '0'
and member_id = #{memberId,jdbcType=VARCHAR,jdbcType=VARCHAR}
</select>
<update id="updateMemberBalance">
update member_wallet_info
<trim prefix="SET" suffixOverrides=",">
version = version + 1,
<if test="newPrincipalBalance != null">principal_balance = #{newPrincipalBalance},</if>
<if test="newGiftBalance != null">gift_balance = #{newGiftBalance},</if>
</trim>
where member_id = #{memberId,jdbcType=VARCHAR}
and version = #{version,jdbcType=INTEGER}
</update>
<select id="queryMemberInfoByMemberId" resultType="com.jsowell.pile.vo.uniapp.MemberVO">
SELECT
t1.member_id as memberId,
t1.STATUS as status,
t1.nick_name as nickName,
t1.mobile_number as mobileNumber,
t2.principal_balance as principalBalance,
t2.gift_balance as giftBalance
FROM
member_basic_info t1
JOIN member_wallet_info t2 ON t1.member_id = t2.member_id
where t1.del_flag = '0'
and t1.member_id = #{memberId,jdbcType=VARCHAR}
</select>
<select id="selectMemberList" resultType="com.jsowell.pile.vo.uniapp.MemberVO">
SELECT
t1.member_id as memberId,
t1.STATUS as status,
t1.nick_name as nickName,
t1.mobile_number as mobileNumber,
t2.principal_balance as principalBalance,
t2.gift_balance as giftBalance
FROM
member_basic_info t1
JOIN member_wallet_info t2 ON t1.member_id = t2.member_id
where t1.del_flag = '0'
<if test="mobileNumber != null and mobileNumber != ''">and mobile_number like '%${mobileNumber}%'</if>
<if test="nickName != null and mobileNumber != ''">and nick_name like '%${nickName}%'</if>
</select>
</mapper>

View File

@@ -0,0 +1,170 @@
<?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.jsowell.pile.mapper.MemberWalletInfoMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
<!--@Table member_wallet_info-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="principal_balance" jdbcType="DECIMAL" property="principalBalance" />
<result column="gift_balance" jdbcType="DECIMAL" property="giftBalance" />
<result column="version" jdbcType="INTEGER" property="version" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="CHAR" property="delFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, member_id, principal_balance, gift_balance, version, create_by, create_time,
update_by, update_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from member_wallet_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from member_wallet_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
insert into member_wallet_info (id, member_id, principal_balance,
gift_balance, version, create_by,
create_time, update_by, update_time,
del_flag)
values (#{id,jdbcType=INTEGER}, #{memberId,jdbcType=VARCHAR}, #{principalBalance,jdbcType=DECIMAL},
#{giftBalance,jdbcType=DECIMAL}, #{version,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=CHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
insert into member_wallet_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="memberId != null and memberId != ''">
member_id,
</if>
<if test="principalBalance != null">
principal_balance,
</if>
<if test="giftBalance != null">
gift_balance,
</if>
<if test="version != null">
version,
</if>
<if test="createBy != null and createBy != ''">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null and updateBy != ''">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null and delFlag != ''">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="memberId != null and memberId != ''">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="principalBalance != null">
#{principalBalance,jdbcType=DECIMAL},
</if>
<if test="giftBalance != null">
#{giftBalance,jdbcType=DECIMAL},
</if>
<if test="version != null">
#{version,jdbcType=INTEGER},
</if>
<if test="createBy != null and createBy != ''">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null and delFlag != ''">
#{delFlag,jdbcType=CHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
update member_wallet_info
<set>
<if test="memberId != null and memberId != ''">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="principalBalance != null">
principal_balance = #{principalBalance,jdbcType=DECIMAL},
</if>
<if test="giftBalance != null">
gift_balance = #{giftBalance,jdbcType=DECIMAL},
</if>
<if test="version != null">
version = #{version,jdbcType=INTEGER},
</if>
<if test="createBy != null and createBy != ''">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag,jdbcType=CHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.MemberWalletInfo">
<!--@mbg.generated-->
update member_wallet_info
set member_id = #{memberId,jdbcType=VARCHAR},
principal_balance = #{principalBalance,jdbcType=DECIMAL},
gift_balance = #{giftBalance,jdbcType=DECIMAL},
version = #{version,jdbcType=INTEGER},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=CHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByMemberId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from member_wallet_info
where member_id = #{memberId,jdbcType=INTEGER}
and del_flag = '0'
</select>
</mapper>

View File

@@ -0,0 +1,50 @@
<?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.jsowell.pile.mapper.MemberWalletLogMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.MemberWalletLog">
<!--@mbg.generated-->
<!--@Table member_wallet_log-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="sub_type" jdbcType="VARCHAR" property="subType" />
<result column="amount" jdbcType="DECIMAL" property="amount" />
<result column="category" jdbcType="CHAR" property="category" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, member_id, `type`, sub_type, amount, category, create_by, create_time
</sql>
<insert id="batchInsert">
insert into member_wallet_log (member_id, `type`,
sub_type, amount, category, related_order_code, create_by)
values
<foreach collection="list" item="item" separator=",">
(
#{item.memberId,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.subType,jdbcType=VARCHAR},
#{item.amount,jdbcType=DECIMAL}, #{item.category,jdbcType=CHAR}, #{item.relatedOrderCode,jdbcType=VARCHAR},
#{item.createBy,jdbcType=VARCHAR}
)
</foreach>
</insert>
<select id="getMemberBalanceChanges" resultType="com.jsowell.pile.vo.uniapp.MemberWalletLogVO">
SELECT
t1.member_id as memberId,
t1.type,
t1.sub_type as subType,
t1.amount,
t1.category,
t1.create_time as transactionTime
from member_wallet_log t1
where
t1.member_id = #{memberId,jdbcType=VARCHAR}
<if test="type != null and type != ''">
and t1.type = #{type,jdbcType=VARCHAR}
</if>
order by t1.create_time DESC
</select>
</mapper>

View File

@@ -0,0 +1,183 @@
<?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.jsowell.pile.mapper.OrderAbnormalRecordMapper">
<resultMap type="com.jsowell.pile.domain.OrderAbnormalRecord" id="OrderAbnormalRecordResult">
<result property="id" column="id" />
<result property="orderCode" column="order_code" />
<result property="pileSn" column="pile_sn" />
<result property="connectorCode" column="connector_code" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="sharpPrice" column="sharp_price" />
<result property="sharpUsedElectricity" column="sharp_used_electricity" />
<result property="sharpPlanLossElectricity" column="sharp_plan_loss_electricity" />
<result property="sharpAmount" column="sharp_amount" />
<result property="peakPrice" column="peak_price" />
<result property="peakUsedElectricity" column="peak_used_electricity" />
<result property="peakPlanLossElectricity" column="peak_plan_loss_electricity" />
<result property="peakAmount" column="peak_amount" />
<result property="flatPrice" column="flat_price" />
<result property="flatUsedElectricity" column="flat_used_electricity" />
<result property="flatPlanLossElectricity" column="flat_plan_loss_electricity" />
<result property="flatAmount" column="flat_amount" />
<result property="valleyPrice" column="valley_price" />
<result property="valleyUsedElectricity" column="valley_used_electricity" />
<result property="valleyPlanLossElectricity" column="valley_plan_loss_electricity" />
<result property="valleyAmount" column="valley_amount" />
<result property="ammeterTotalStart" column="ammeter_total_start" />
<result property="ammeterTotalEnd" column="ammeter_total_end" />
<result property="totalElectricity" column="total_electricity" />
<result property="planLossTotalElectricity" column="plan_loss_total_electricity" />
<result property="consumptionAmount" column="consumption_amount" />
<result property="vinCode" column="vin_code" />
<result property="transactionIdentifier" column="transaction_identifier" />
<result property="transactionTime" column="transaction_time" />
<result property="stopReasonMsg" column="stop_reason_msg" />
<result property="logicCard" column="logic_card" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectOrderAbnormalRecordVo">
select id, order_code, pile_sn, connector_code, start_time, end_time, sharp_price, sharp_used_electricity, sharp_plan_loss_electricity, sharp_amount, peak_price, peak_used_electricity, peak_plan_loss_electricity, peak_amount, flat_price, flat_used_electricity, flat_plan_loss_electricity, flat_amount, valley_price, valley_used_electricity, valley_plan_loss_electricity, valley_amount, ammeter_total_start, ammeter_total_end, total_electricity, plan_loss_total_electricity, consumption_amount, vin_code, transaction_identifier, transaction_time, stop_reason_msg, logic_card, create_time from order_abnormal_record
</sql>
<select id="selectOrderAbnormalRecordList" parameterType="com.jsowell.pile.domain.OrderAbnormalRecord" resultMap="OrderAbnormalRecordResult">
<include refid="selectOrderAbnormalRecordVo"/>
<where>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="pileSn != null and pileSn != ''"> and pile_sn = #{pileSn}</if>
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
<if test="endTime != null and endTime != ''"> and end_time = #{endTime}</if>
</where>
</select>
<select id="selectOrderAbnormalRecordById" parameterType="Integer" resultMap="OrderAbnormalRecordResult">
<include refid="selectOrderAbnormalRecordVo"/>
where id = #{id}
</select>
<insert id="insertOrderAbnormalRecord" parameterType="com.jsowell.pile.domain.OrderAbnormalRecord" useGeneratedKeys="true" keyProperty="id">
insert into order_abnormal_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null">order_code,</if>
<if test="pileSn != null">pile_sn,</if>
<if test="connectorCode != null">connector_code,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="sharpPrice != null">sharp_price,</if>
<if test="sharpUsedElectricity != null">sharp_used_electricity,</if>
<if test="sharpPlanLossElectricity != null">sharp_plan_loss_electricity,</if>
<if test="sharpAmount != null">sharp_amount,</if>
<if test="peakPrice != null">peak_price,</if>
<if test="peakUsedElectricity != null">peak_used_electricity,</if>
<if test="peakPlanLossElectricity != null">peak_plan_loss_electricity,</if>
<if test="peakAmount != null">peak_amount,</if>
<if test="flatPrice != null">flat_price,</if>
<if test="flatUsedElectricity != null">flat_used_electricity,</if>
<if test="flatPlanLossElectricity != null">flat_plan_loss_electricity,</if>
<if test="flatAmount != null">flat_amount,</if>
<if test="valleyPrice != null">valley_price,</if>
<if test="valleyUsedElectricity != null">valley_used_electricity,</if>
<if test="valleyPlanLossElectricity != null">valley_plan_loss_electricity,</if>
<if test="valleyAmount != null">valley_amount,</if>
<if test="ammeterTotalStart != null">ammeter_total_start,</if>
<if test="ammeterTotalEnd != null">ammeter_total_end,</if>
<if test="totalElectricity != null">total_electricity,</if>
<if test="planLossTotalElectricity != null">plan_loss_total_electricity,</if>
<if test="consumptionAmount != null">consumption_amount,</if>
<if test="vinCode != null">vin_code,</if>
<if test="transactionIdentifier != null">transaction_identifier,</if>
<if test="transactionTime != null">transaction_time,</if>
<if test="stopReasonMsg != null">stop_reason_msg,</if>
<if test="logicCard != null">logic_card,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null">#{orderCode},</if>
<if test="pileSn != null">#{pileSn},</if>
<if test="connectorCode != null">#{connectorCode},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="sharpPrice != null">#{sharpPrice},</if>
<if test="sharpUsedElectricity != null">#{sharpUsedElectricity},</if>
<if test="sharpPlanLossElectricity != null">#{sharpPlanLossElectricity},</if>
<if test="sharpAmount != null">#{sharpAmount},</if>
<if test="peakPrice != null">#{peakPrice},</if>
<if test="peakUsedElectricity != null">#{peakUsedElectricity},</if>
<if test="peakPlanLossElectricity != null">#{peakPlanLossElectricity},</if>
<if test="peakAmount != null">#{peakAmount},</if>
<if test="flatPrice != null">#{flatPrice},</if>
<if test="flatUsedElectricity != null">#{flatUsedElectricity},</if>
<if test="flatPlanLossElectricity != null">#{flatPlanLossElectricity},</if>
<if test="flatAmount != null">#{flatAmount},</if>
<if test="valleyPrice != null">#{valleyPrice},</if>
<if test="valleyUsedElectricity != null">#{valleyUsedElectricity},</if>
<if test="valleyPlanLossElectricity != null">#{valleyPlanLossElectricity},</if>
<if test="valleyAmount != null">#{valleyAmount},</if>
<if test="ammeterTotalStart != null">#{ammeterTotalStart},</if>
<if test="ammeterTotalEnd != null">#{ammeterTotalEnd},</if>
<if test="totalElectricity != null">#{totalElectricity},</if>
<if test="planLossTotalElectricity != null">#{planLossTotalElectricity},</if>
<if test="consumptionAmount != null">#{consumptionAmount},</if>
<if test="vinCode != null">#{vinCode},</if>
<if test="transactionIdentifier != null">#{transactionIdentifier},</if>
<if test="transactionTime != null">#{transactionTime},</if>
<if test="stopReasonMsg != null">#{stopReasonMsg},</if>
<if test="logicCard != null">#{logicCard},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateOrderAbnormalRecord" parameterType="com.jsowell.pile.domain.OrderAbnormalRecord">
update order_abnormal_record
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="pileSn != null">pile_sn = #{pileSn},</if>
<if test="connectorCode != null">connector_code = #{connectorCode},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="sharpPrice != null">sharp_price = #{sharpPrice},</if>
<if test="sharpUsedElectricity != null">sharp_used_electricity = #{sharpUsedElectricity},</if>
<if test="sharpPlanLossElectricity != null">sharp_plan_loss_electricity = #{sharpPlanLossElectricity},</if>
<if test="sharpAmount != null">sharp_amount = #{sharpAmount},</if>
<if test="peakPrice != null">peak_price = #{peakPrice},</if>
<if test="peakUsedElectricity != null">peak_used_electricity = #{peakUsedElectricity},</if>
<if test="peakPlanLossElectricity != null">peak_plan_loss_electricity = #{peakPlanLossElectricity},</if>
<if test="peakAmount != null">peak_amount = #{peakAmount},</if>
<if test="flatPrice != null">flat_price = #{flatPrice},</if>
<if test="flatUsedElectricity != null">flat_used_electricity = #{flatUsedElectricity},</if>
<if test="flatPlanLossElectricity != null">flat_plan_loss_electricity = #{flatPlanLossElectricity},</if>
<if test="flatAmount != null">flat_amount = #{flatAmount},</if>
<if test="valleyPrice != null">valley_price = #{valleyPrice},</if>
<if test="valleyUsedElectricity != null">valley_used_electricity = #{valleyUsedElectricity},</if>
<if test="valleyPlanLossElectricity != null">valley_plan_loss_electricity = #{valleyPlanLossElectricity},</if>
<if test="valleyAmount != null">valley_amount = #{valleyAmount},</if>
<if test="ammeterTotalStart != null">ammeter_total_start = #{ammeterTotalStart},</if>
<if test="ammeterTotalEnd != null">ammeter_total_end = #{ammeterTotalEnd},</if>
<if test="totalElectricity != null">total_electricity = #{totalElectricity},</if>
<if test="planLossTotalElectricity != null">plan_loss_total_electricity = #{planLossTotalElectricity},</if>
<if test="consumptionAmount != null">consumption_amount = #{consumptionAmount},</if>
<if test="vinCode != null">vin_code = #{vinCode},</if>
<if test="transactionIdentifier != null">transaction_identifier = #{transactionIdentifier},</if>
<if test="transactionTime != null">transaction_time = #{transactionTime},</if>
<if test="stopReasonMsg != null">stop_reason_msg = #{stopReasonMsg},</if>
<if test="logicCard != null">logic_card = #{logicCard},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOrderAbnormalRecordById" parameterType="Integer">
delete from order_abnormal_record where id = #{id}
</delete>
<delete id="deleteOrderAbnormalRecordByIds" parameterType="String">
delete from order_abnormal_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,775 @@
<?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.jsowell.pile.mapper.OrderBasicInfoMapper">
<resultMap type="com.jsowell.pile.domain.OrderBasicInfo" id="OrderBasicInfoResult">
<result property="id" column="id"/>
<result property="orderCode" column="order_code"/>
<result property="orderStatus" column="order_status"/>
<result property="memberId" column="member_id"/>
<result property="stationId" column="station_id"/>
<result property="pileSn" column="pile_sn"/>
<result property="connectorCode" column="connector_code"/>
<result property="pileConnectorCode" column="pile_connector_code"/>
<result property="startMode" column="start_mode"/>
<result property="payMode" column="pay_mode"/>
<result property="payStatus" column="pay_status"/>
<result property="payAmount" column="pay_amount"/>
<result property="payTime" column="pay_time"/>
<result property="orderAmount" column="order_amount"/>
<result property="chargeStartTime" column="charge_start_time"/>
<result property="chargeEndTime" column="charge_end_time"/>
<result property="startSOC" column="start_soc"/>
<result property="endSOC" column="end_soc"/>
<result property="reason" column="reason"/>
<result property="settlementTime" column="settlement_time"/>
<result property="refundAmount" column="refund_amount"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<resultMap id="OrderBasicInfoOrderDetailResult" type="com.jsowell.pile.domain.OrderBasicInfo" extends="OrderBasicInfoResult">
<collection property="orderDetailList" notNullColumn="sub_id" javaType="java.util.List"
resultMap="OrderDetailResult"/>
</resultMap>
<resultMap type="com.jsowell.pile.domain.OrderDetail" id="OrderDetailResult">
<result property="id" column="id"/>
<result property="orderCode" column="order_code"/>
<result property="totalUsedElectricity" column="total_used_electricity"/>
<result property="totalOrderAmount" column="total_order_amount"/>
<result property="totalElectricityAmount" column="total_electricity_amount"/>
<result property="totalServiceAmount" column="total_service_amount"/>
<result property="sharpUsedElectricity" column="sharp_used_electricity"/>
<result property="sharpElectricityPrice" column="sharp_electricity_price"/>
<result property="sharpServicePrice" column="sharp_service_price"/>
<result property="peakUsedElectricity" column="peak_used_electricity"/>
<result property="peakElectricityPrice" column="peak_electricity_price"/>
<result property="peakServicePrice" column="peak_service_price"/>
<result property="flatUsedElectricity" column="flat_used_electricity"/>
<result property="flatElectricityPrice" column="flat_electricity_price"/>
<result property="flatServicePrice" column="flat_service_price"/>
<result property="valleyUsedElectricity" column="valley_used_electricity"/>
<result property="valleyElectricityPrice" column="valley_electricity_price"/>
<result property="valleyServicePrice" column="valley_service_price"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="selectOrderBasicInfoVo">
select
<include refid="Base_Column_List"/>
from order_basic_info
</sql>
<sql id="Base_Column_List">
id,
order_code,
order_status,
member_id,
station_id,
pile_sn,
connector_code,
pile_connector_code,
start_mode,
pay_mode,
pay_status,
pay_amount,
pay_time,
order_amount,
charge_start_time,
charge_end_time,
start_soc,
end_soc,
reason,
settlement_time,
refund_amount,
create_by,
create_time,
update_by,
update_time,
del_flag
</sql>
<sql id="Detail_Base_Column_List">
id,
order_code,
total_used_electricity,
total_order_amount,
total_electricity_amount,
total_service_amount,
sharp_used_electricity,
sharp_electricity_price,
sharp_service_price,
peak_used_electricity,
peak_electricity_price,
peak_service_price,
flat_used_electricity,
flat_electricity_price,
flat_service_price,
valley_used_electricity,
valley_electricity_price,
valley_service_price,
create_by,
create_time,
update_by,
update_time,
del_flag
</sql>
<select id="selectOrderBasicInfoList" parameterType="com.jsowell.pile.dto.QueryOrderDTO" resultType="com.jsowell.pile.vo.web.OrderListVO">
SELECT
t1.id as id,
t1.order_code as orderCode,
t1.order_status as orderStatus,
t1.member_id as memberId,
t2.nick_name as nickName,
t2.mobile_number as mobileNumber,
t1.station_id as stationId,
t3.station_name as stationName,
t1.pile_sn as pileSn,
t1.connector_code as connectorCode,
t1.start_mode as startMode,
t1.pay_mode as payMode,
t1.pay_status as payStatus,
t1.pay_amount as payAmount,
t1.order_amount as orderAmount,
t1.start_soc as startSoc,
t1.end_soc as endSoc,
t1.charge_start_time as chargeStartTime,
t1.charge_end_time as chargeEndTime,
t1.create_time as createTime,
t4.total_used_electricity as chargingDegree
from order_basic_info t1
join member_basic_info t2 on t1.member_id = t2.member_id
join pile_station_info t3 on t1.station_id = t3.id
join order_detail t4 on t4.order_code = t1.order_code
where t1.del_flag = '0'
<if test="pileSn != null and pileSn != ''">
and t1.pile_sn = #{pileSn,jdbcType=VARCHAR}
</if>
<if test="connectorCode != null and connectorCode != ''">
and t1.connector_code = #{connectorCode,jdbcType=VARCHAR}
</if>
<if test="memberId != null and memberId != ''">
and t1.member_id = #{memberId,jdbcType=VARCHAR}
</if>
<if test="orderStatus != null and orderStatus != ''">
and t1.order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="orderCode != null and orderCode != ''">
and t1.order_code = #{orderCode,jdbcType=VARCHAR}
</if>
<if test="mobileNumber != null and mobileNumber != ''">
and t2.mobile_number = #{mobileNumber,jdbcType=VARCHAR}
</if>
<if test="stationId != null and stationId != ''">
and t1.station_id = #{stationId,jdbcType=VARCHAR}
</if>
<if test="startTime != null and startTime != ''">
and t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != null and endTime != ''">
and t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by t1.create_time desc
</select>
<select id="selectOrderBasicInfoById" parameterType="Long" resultMap="OrderBasicInfoOrderDetailResult">
select a.id,
a.order_code,
a.order_status,
a.member_id,
a.station_id,
a.pile_sn,
a.connector_code,
a.start_mode,
a.pay_mode,
a.pay_status,
a.pay_amount,
a.pay_time,
a.order_amount,
a.reason,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
b.id as sub_id,
b.order_code as sub_order_code,
b.total_used_electricity as sub_total_used_electricity,
b.total_order_amount as sub_total_order_amount,
b.total_electricity_amount as sub_total_electricity_amount,
b.total_service_amount as sub_total_service_amount,
b.sharp_used_electricity as sub_sharp_used_electricity,
b.sharp_electricity_price as sub_sharp_electricity_price,
b.sharp_service_price as sub_sharp_service_price,
b.peak_used_electricity as sub_peak_used_electricity,
b.peak_electricity_price as sub_peak_electricity_price,
b.peak_service_price as sub_peak_service_price,
b.flat_used_electricity as sub_flat_used_electricity,
b.flat_electricity_price as sub_flat_electricity_price,
b.flat_service_price as sub_flat_service_price,
b.valley_used_electricity as sub_valley_used_electricity,
b.valley_electricity_price as sub_valley_electricity_price,
b.valley_service_price as sub_valley_service_price,
b.create_by as sub_create_by,
b.create_time as sub_create_time,
b.update_by as sub_update_by,
b.update_time as sub_update_time,
b.del_flag as sub_del_flag
from order_basic_info a
left join order_detail b on b.order_code = a.id
where a.id = #{id}
</select>
<insert id="insertOrderBasicInfo" parameterType="com.jsowell.pile.domain.OrderBasicInfo" useGeneratedKeys="true" keyProperty="id">
insert into order_basic_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null">
order_code,
</if>
<if test="orderStatus != null">
order_status,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="stationId != null">
station_id,
</if>
<if test="pileSn != null">
pile_sn,
</if>
<if test="connectorCode != null">
connector_code,
</if>
<if test="pileConnectorCode != null">
pile_connector_code,
</if>
<if test="startMode != null">
start_mode,
</if>
<if test="payMode != null">
pay_mode,
</if>
<if test="payStatus != null">
pay_status,
</if>
<if test="payAmount != null">
pay_amount,
</if>
<if test="payTime != null">
pay_time,
</if>
<if test="orderAmount != null">
order_amount,
</if>
<if test="chargeStartTime != null">
charge_start_time,
</if>
<if test="chargeEndTime != null">
charge_end_time,
</if>
<if test="startSOC != null">
start_soc,
</if>
<if test="endSOC != null">
end_soc,
</if>
<if test="reason != null">
reason,
</if>
<if test="settlementTime != null">
settlement_time,
</if>
<if test="refundAmount != null">
refund_amount,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null">
#{orderCode},
</if>
<if test="orderStatus != null">
#{orderStatus},
</if>
<if test="memberId != null">
#{memberId},
</if>
<if test="stationId != null">
#{stationId},
</if>
<if test="pileSn != null">
#{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
#{connectorCode},
</if>
<if test="pileConnectorCode != null">
#{pileConnectorCode},
</if>
<if test="startMode != null">
#{startMode},
</if>
<if test="payMode != null">
#{payMode},
</if>
<if test="payStatus != null">
#{payStatus},
</if>
<if test="payAmount != null">
#{payAmount},
</if>
<if test="payTime != null">
#{payTime},
</if>
<if test="orderAmount != null">
#{orderAmount},
</if>
<if test="chargeStartTime != null">
#{chargeStartTime},
</if>
<if test="chargeEndTime != null">
#{chargeEndTime},
</if>
<if test="startSOC != null">
#{startSOC},
</if>
<if test="endSOC != null">
#{endSOC},
</if>
<if test="reason != null">
#{reason},
</if>
<if test="settlementTime != null">
#{settlementTime},
</if>
<if test="refundAmount != null">
#{refundAmount},
</if>
<if test="createBy != null">
#{createBy},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateBy != null">
#{updateBy},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="delFlag != null">
#{delFlag},
</if>
</trim>
</insert>
<update id="updateOrderBasicInfo" parameterType="com.jsowell.pile.domain.OrderBasicInfo">
update order_basic_info
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">
order_code = #{orderCode},
</if>
<if test="orderStatus != null">
order_status = #{orderStatus},
</if>
<if test="memberId != null">
member_id = #{memberId},
</if>
<if test="stationId != null">
station_id = #{stationId},
</if>
<if test="pileSn != null">
pile_sn = #{pileSn},
</if>
<if test="connectorCode != null">
connector_code = #{connectorCode},
</if>
<if test="pileConnectorCode != null">
pile_connector_code = #{pileConnectorCode},
</if>
<if test="startMode != null">
start_mode = #{startMode},
</if>
<if test="payMode != null">
pay_mode = #{payMode},
</if>
<if test="payStatus != null">
pay_status = #{payStatus},
</if>
<if test="payAmount != null">
pay_amount = #{payAmount},
</if>
<if test="payTime != null">
pay_time = #{payTime},
</if>
<if test="orderAmount != null">
order_amount = #{orderAmount},
</if>
<if test="chargeStartTime != null">
charge_start_time = #{chargeStartTime},
</if>
<if test="chargeEndTime != null">
charge_end_time = #{chargeEndTime},
</if>
<if test="startSOC != null">
start_soc = #{startSOC},
</if>
<if test="endSOC != null">
end_soc = #{endSOC},
</if>
<if test="reason != null">
reason = #{reason},
</if>
<if test="settlementTime != null">
settlement_time = #{settlementTime},
</if>
<if test="refundAmount != null">
refund_amount = #{refundAmount},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOrderBasicInfoByIds" parameterType="String">
delete
from order_basic_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteOrderDetailByOrderCodes" parameterType="String">
delete
from order_detail where order_code in
<foreach item="orderCode" collection="array" open="(" separator="," close=")">
#{orderCode}
</foreach>
</delete>
<delete id="deleteOrderDetailByOrderCode" parameterType="Long">
delete
from order_detail
where order_code = #{orderCode}
</delete>
<insert id="batchOrderDetail">
insert into order_detail(id, order_code, total_used_electricity, total_order_amount, total_electricity_amount,
total_service_amount, sharp_used_electricity, sharp_electricity_price,
sharp_service_price,
peak_used_electricity, peak_electricity_price, peak_service_price,
flat_used_electricity, flat_electricity_price,
flat_service_price, valley_used_electricity, valley_electricity_price,
valley_service_price, create_by,
update_by) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.id}, #{item.orderCode}, #{item.totalUsedElectricity}, #{item.totalOrderAmount},
#{item.totalElectricityAmount}, #{item.totalServiceAmount}, #{item.sharpUsedElectricity},
#{item.sharpElectricityPrice}, #{item.sharpServicePrice}, #{item.peakUsedElectricity},
#{item.peakElectricityPrice}, #{item.peakServicePrice}, #{item.flatUsedElectricity},
#{item.flatElectricityPrice}, #{item.flatServicePrice}, #{item.valleyUsedElectricity},
#{item.valleyElectricityPrice}, #{item.valleyServicePrice}, #{item.createBy}, #{item.updateBy})
</foreach>
</insert>
<update id="updateOrderDetail" parameterType="com.jsowell.pile.domain.OrderDetail">
update order_detail
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">
order_code = #{orderCode},
</if>
<if test="totalUsedElectricity != null">
total_used_electricity = #{totalUsedElectricity},
</if>
<if test="totalOrderAmount != null">
total_order_amount = #{totalOrderAmount},
</if>
<if test="totalElectricityAmount != null">
total_electricity_amount = #{totalElectricityAmount},
</if>
<if test="totalServiceAmount != null">
total_service_amount = #{totalServiceAmount},
</if>
<if test="sharpUsedElectricity != null">
sharp_used_electricity = #{sharpUsedElectricity},
</if>
<if test="sharpElectricityPrice != null">
sharp_electricity_price = #{sharpElectricityPrice},
</if>
<if test="sharpServicePrice != null">
sharp_service_price = #{sharpServicePrice},
</if>
<if test="peakUsedElectricity != null">
peak_used_electricity = #{peakUsedElectricity},
</if>
<if test="peakElectricityPrice != null">
peak_electricity_price = #{peakElectricityPrice},
</if>
<if test="peakServicePrice != null">
peak_service_price = #{peakServicePrice},
</if>
<if test="flatUsedElectricity != null">
flat_used_electricity = #{flatUsedElectricity},
</if>
<if test="flatElectricityPrice != null">
flat_electricity_price = #{flatElectricityPrice},
</if>
<if test="flatServicePrice != null">
flat_service_price = #{flatServicePrice},
</if>
<if test="valleyUsedElectricity != null">
valley_used_electricity = #{valleyUsedElectricity},
</if>
<if test="valleyElectricityPrice != null">
valley_electricity_price = #{valleyElectricityPrice},
</if>
<if test="valleyServicePrice != null">
valley_service_price = #{valleyServicePrice},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</trim>
where id = #{id}
</update>
<select id="getOrderInfoByOrderCode" resultMap="OrderBasicInfoResult">
select
<include refid="Base_Column_List"/>
from order_basic_info
<where>
order_code = #{orderCode,jdbcType=VARCHAR}
</where>
and del_flag = '0'
</select>
<select id="queryOrderBasicInfo" resultMap="OrderBasicInfoResult">
select
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
and pile_sn = #{pileSn,jdbcType=VARCHAR}
and connector_code = #{connectorCode,jdbcType=VARCHAR}
and order_status = #{orderStatus,jdbcType=VARCHAR}
order by create_time DESC
limit 1
</select>
<select id="getOrderDetailByOrderCode" resultMap="OrderDetailResult">
select
<include refid="Detail_Base_Column_List"/>
from order_detail
where del_flag = '0'
and order_code = #{orderCode,jdbcType=VARCHAR}
</select>
<select id="getListByMemberIdAndOrderStatus" resultType="com.jsowell.pile.vo.uniapp.OrderVO">
SELECT
t1.order_code as orderCode,
t1.order_status as orderStatus,
t1.reason,
t1.station_id,
t3.station_name as stationName,
t1.pile_sn as pileSn,
t1.connector_code as connectorCode,
t1.pay_status as payStatus,
t1.order_amount as orderAmount,
t1.pay_amount as payAmount,
t2.total_used_electricity as chargingDegree,
t2.create_time as startTime,
t2.update_time as endTime
from order_basic_info t1
join order_detail t2 on t1.order_code = t2.order_code
join pile_station_info t3 on t1.station_id = t3.id
where t1.del_flag = '0'
and t1.member_id = #{memberId,jdbcType=VARCHAR}
<if test="orderStatusList != null and orderStatusList.size() != 0">
and t1.order_status in
<foreach collection="orderStatusList" item="orderStatus" open="(" separator="," close=")">
#{orderStatus,jdbcType=VARCHAR}
</foreach>
</if>
order by t1.create_time desc
</select>
<update id="updateOrderStatusByOrderCode">
update order_basic_info set order_status = #{orderStatus,jdbcType=VARCHAR}
where del_flag = '0'
and order_code = #{orderCode,jdbcType=VARCHAR}
</update>
<select id="getIndexOrderInfo" resultType="com.jsowell.pile.vo.web.IndexOrderInfoVO">
SELECT
DATE_FORMAT(t1.create_time,'%Y-%m-%d') as date,
sum( t2.total_used_electricity ) AS totalElectricity,
sum( t2.total_order_amount ) AS totalOrderAmount,
sum( t2.sharp_used_electricity ) AS totalSharpUsedElectricity,
sum( t2.peak_used_electricity ) AS totalPeakUsedElectricity,
sum( t2.flat_used_electricity ) AS totalFlatUsedElectricity,
sum( t2.valley_used_electricity ) AS totalValleyUsedElectricity
FROM
order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code
AND t1.del_flag = '0'
WHERE
date(t1.create_time) >= DATE_SUB(CURDATE(),INTERVAL 30 day)
and t1.order_status = '6'
<if test="dto.stationId != null and dto.stationId != ''">
and t1,station_id = #{dto.stationId,jdbcType=VARCHAR}
</if>
group by DATE_FORMAT(t1.create_time,'%Y-%m-%d')
</select>
<select id="getUnpaidOrderListOver15Min" resultMap="OrderBasicInfoResult">
select
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
and order_status = '0'
and pay_status = '0'
and create_time <![CDATA[ <= ]]> #{createTime,jdbcType=VARCHAR}
</select>
<select id="selectOrderListByTimeRangeAndStatus" resultMap="OrderBasicInfoResult">
select
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
<if test="startTime != null and startTime != ''">
and create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != null and endTime != ''">
and create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</if>
<if test="orderStatus != null and orderStatus != ''">
and order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="payStatus != null and payStatus != ''">
and pay_status = #{payStatus,jdbcType=VARCHAR}
</if>
</select>
<update id="updateOrderStatusById">
update order_basic_info set order_status = #{orderStatus,jdbcType=VARCHAR}
where del_flag = '0'
and id in
<foreach collection="orderIds" item="orderId" open="(" separator="," close=")" >
#{orderId,jdbcType=VARCHAR}
</foreach>
</update>
<select id="selectOrderInfoByOrderCode" resultType="com.jsowell.pile.vo.uniapp.SendMessageVO">
SELECT
t1.order_code as orderCode,
t1.charge_start_time as chargeStartTime,
t1.charge_end_time as chargeStopTime,
t1.reason as stopReason,
t1.station_id as stationId,
t2.station_name as stationName,
t3.total_order_amount as orderAmount,
t4.open_id as openId
FROM
order_basic_info t1
JOIN pile_station_info t2 ON t1.station_id = t2.id
join order_detail t3 on t1.order_code = t3.order_code
join member_basic_info t4 on t1.member_id = t4.member_id
where t1.order_code = #{orderCode,jdbcType=VARCHAR}
</select>
<select id="getOrderBasicInfo" resultMap="OrderBasicInfoResult">
select
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
<if test="memberId != null and memberId != ''">
AND member_id = #{memberId,jdbcType=VARCHAR}
</if>
<if test="pileConnectorCode != null and pileConnectorCode != ''">
AND pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
</if>
<if test="orderStatus != null and orderStatus != ''">
AND order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="startMode != null and startMode != ''">
AND start_mode = #{startMode,jdbcType=VARCHAR}
</if>
order by create_time desc
limit 1
</select>
<select id="getAccumulativeInfo" resultType="com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO">
SELECT
t1.member_id as memberId,
t1.pile_connector_code as pileConnectorCode,
t1.pile_sn as pileSn,
t1.charge_start_time as chargeStartTime,
t1.charge_end_time as chargeEndTime,
t2.total_used_electricity as sumChargingDegree
FROM
order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code
WHERE
t1.pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
AND t1.member_id = #{memberId,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
AND t1.order_status = '6'
AND t1.del_flag = '0'
</select>
</mapper>

View File

@@ -0,0 +1,173 @@
<?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.jsowell.pile.mapper.OrderPayRecordMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.OrderPayRecord">
<!--@mbg.generated-->
<!--@Table order_pay_record-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="pay_mode" jdbcType="VARCHAR" property="payMode" />
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount" />
<result column="refund_amount" jdbcType="DECIMAL" property="refundAmount" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="CHAR" property="delFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, order_code, pay_mode, pay_amount, refund_amount, create_by, create_time, update_by, update_time,
del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from order_pay_record
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from order_pay_record
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPayRecord" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_pay_record (order_code, pay_mode, pay_amount, refund_amount,
create_by, create_time, update_by,
update_time, del_flag)
values (#{orderCode,jdbcType=VARCHAR}, #{payMode,jdbcType=VARCHAR}, #{payAmount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPayRecord" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_pay_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null and orderCode != ''">
order_code,
</if>
<if test="payMode != null and payMode != ''">
pay_mode,
</if>
<if test="payAmount != null">
pay_amount,
</if>
<if test="refundAmount != null">
refund_amount,
</if>
<if test="createBy != null and createBy != ''">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null and updateBy != ''">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null and delFlag != ''">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null and orderCode != ''">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="payMode != null and payMode != ''">
#{payMode,jdbcType=VARCHAR},
</if>
<if test="payAmount != null">
#{payAmount,jdbcType=DECIMAL},
</if>
<if test="refundAmount != null">
#{refundAmount,jdbcType=DECIMAL},
</if>
<if test="createBy != null and createBy != ''">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null and delFlag != ''">
#{delFlag,jdbcType=CHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.OrderPayRecord">
<!--@mbg.generated-->
update order_pay_record
<set>
<if test="orderCode != null and orderCode != ''">
order_code = #{orderCode,jdbcType=VARCHAR},
</if>
<if test="payMode != null and payMode != ''">
pay_mode = #{payMode,jdbcType=VARCHAR},
</if>
<if test="payAmount != null">
pay_amount = #{payAmount,jdbcType=DECIMAL},
</if>
<if test="refundAmount != null">
refund_amount = #{refundAmount,jdbcType=DECIMAL},
</if>
<if test="createBy != null and createBy != ''">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null and delFlag != ''">
del_flag = #{delFlag,jdbcType=CHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.OrderPayRecord">
<!--@mbg.generated-->
update order_pay_record
set order_code = #{orderCode,jdbcType=VARCHAR},
pay_mode = #{payMode,jdbcType=VARCHAR},
pay_amount = #{payAmount,jdbcType=DECIMAL},
refund_amount = #{refundAmount,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=CHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<insert id="batchInsert">
insert into order_pay_record
(order_code, pay_mode, pay_amount, create_by)
values
<foreach collection="payRecordList" item="item" separator=",">
(
#{item.orderCode,jdbcType=VARCHAR}, #{item.payMode,jdbcType=VARCHAR}, #{item.payAmount,jdbcType=DECIMAL},
#{item.createBy,jdbcType=VARCHAR}
)
</foreach>
</insert>
<select id="getOrderPayRecordList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from order_pay_record
where order_code = #{orderCode,jdbcType=VARCHAR}
</select>
</mapper>

View File

@@ -0,0 +1,345 @@
<?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.jsowell.pile.mapper.PileBasicInfoMapper">
<resultMap type="com.jsowell.pile.domain.PileBasicInfo" id="PileBasicInfoResult">
<result property="id" column="id" />
<result property="sn" column="sn" />
<result property="businessType" column="business_type" />
<result property="softwareProtocol" column="software_protocol" />
<result property="productionDate" column="production_date" />
<result property="licenceId" column="licence_id" />
<result property="modelId" column="model_id" />
<result property="simId" column="sim_id" />
<result property="merchantId" column="merchant_id" />
<result property="stationId" column="station_id" />
<result property="faultReason" column="fault_reason" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, sn, business_type, software_protocol, production_date, licence_id, model_id, sim_id,
merchant_id, station_id, fault_reason, create_by, create_time, update_by, update_time, del_flag, remark
</sql>
<sql id="selectPileBasicInfoVo">
select <include refid="Base_Column_List"/>
from pile_basic_info
</sql>
<select id="selectPileBasicInfoList" parameterType="com.jsowell.pile.domain.PileBasicInfo" resultMap="PileBasicInfoResult">
<include refid="selectPileBasicInfoVo"/>
<where>
<if test="sn != null and sn != ''"> and sn = #{sn}</if>
<if test="businessType != null and businessType != ''"> and business_type = #{businessType}</if>
<if test="softwareProtocol != null and softwareProtocol != ''"> and software_protocol = #{softwareProtocol}</if>
<!--<if test="params.beginProductionDate != null and params.beginProductionDate != '' and params.endProductionDate != null and params.endProductionDate != ''"> and production_date between #{params.beginProductionDate} and #{params.endProductionDate}</if>
--> <if test="licenceId != null "> and licence_id = #{licenceId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>
<if test="simId != null "> and sim_id = #{simId}</if>
<if test="merchantId != null "> and merchant_id = #{merchantId}</if>
<if test="stationId != null "> and station_id = #{stationId}</if>
<if test="faultReason != null and faultReason != ''"> and fault_reason = #{faultReason}</if>
</where>
</select>
<select id="selectPileBasicInfoById" parameterType="Long" resultMap="PileBasicInfoResult">
<include refid="selectPileBasicInfoVo"/>
where id = #{id}
</select>
<select id="selectPileBasicInfoBySn" resultMap="PileBasicInfoResult">
select <include refid="Base_Column_List"/>
from pile_basic_info
where sn = #{pileSn,jdbcType=VARCHAR}
</select>
<insert id="insertPileBasicInfo" parameterType="com.jsowell.pile.domain.PileBasicInfo" useGeneratedKeys="true" keyProperty="id">
insert into pile_basic_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sn != null">sn,</if>
<if test="businessType != null">business_type,</if>
<if test="softwareProtocol != null">software_protocol,</if>
<if test="productionDate != null">production_date,</if>
<if test="licenceId != null">licence_id,</if>
<if test="modelId != null">model_id,</if>
<if test="simId != null">sim_id,</if>
<if test="merchantId != null">merchant_id,</if>
<if test="stationId != null">station_id,</if>
<if test="faultReason != null">fault_reason,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sn != null">#{sn},</if>
<if test="businessType != null">#{businessType},</if>
<if test="softwareProtocol != null">#{softwareProtocol},</if>
<if test="productionDate != null">#{productionDate},</if>
<if test="licenceId != null">#{licenceId},</if>
<if test="modelId != null">#{modelId},</if>
<if test="simId != null">#{simId},</if>
<if test="merchantId != null">#{merchantId},</if>
<if test="stationId != null">#{stationId},</if>
<if test="faultReason != null">#{faultReason},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updatePileBasicInfo" parameterType="com.jsowell.pile.domain.PileBasicInfo">
update pile_basic_info
<trim prefix="SET" suffixOverrides=",">
<if test="sn != null">sn = #{sn},</if>
<if test="businessType != null">business_type = #{businessType},</if>
<if test="softwareProtocol != null">software_protocol = #{softwareProtocol},</if>
<if test="productionDate != null">production_date = #{productionDate},</if>
<if test="licenceId != null">licence_id = #{licenceId},</if>
<if test="modelId != null">model_id = #{modelId},</if>
<if test="simId != null">sim_id = #{simId},</if>
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="stationId != null">station_id = #{stationId},</if>
<if test="faultReason != null">fault_reason = #{faultReason},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileBasicInfoById" parameterType="Long">
delete from pile_basic_info where id = #{id}
</delete>
<delete id="deletePileBasicInfoByIds" parameterType="String">
delete from pile_basic_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="queryPileInfos" resultType="com.jsowell.pile.vo.web.PileDetailVO">
SELECT
t1.id as pileId,
t1.sn as pileSn,
t1.station_id AS stationId,
t3.station_name as stationName,
t1.sim_id,
t5.iccid as ICCID,
t5.sim_supplier as simSupplier,
t1.merchant_id as merchantId,
t2.merchant_name as merchantName,
count(t4.id)as gunNum,
t1.create_time as registrationTime,
IF(t6.charger_pile_type = '2','3',(IF(t6.speed_type = '1','1','2'))) AS pileType
FROM
pile_basic_info t1
LEFT JOIN pile_merchant_info t2 ON (t2.id = t1.merchant_id and t2.del_flag = '0')
LEFT JOIN pile_station_info t3 ON (t3.id = t1.station_id and t3.del_flag = '0')
LEFT JOIN pile_connector_info t4 on (t4.pile_sn = t1.sn and t4.del_flag = '0')
LEFT JOIN pile_sim_info t5 on (t5.id = t1.sim_id and t5.del_flag = '0')
LEFT join pile_model_info t6 on t6.id = t1.model_id
where t1.del_flag = '0'
<if test="dto.pileSn != null and dto.pileSn != ''">
and t1.sn = #{dto.pileSn,jdbcType=VARCHAR}
</if>
<if test="dto.stationId != null and dto.stationId != ''">
and t1.station_Id = #{dto.stationId,jdbcType=VARCHAR}
</if>
<if test="dto.pileSns != null and dto.pileSns.size() != 0">
and t1.sn in
<foreach collection="dto.pileSns" item="item" open="(" close=")" separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<!-- 数据范围过滤 -->
${dto.params.dataScope}
group by t1.id
order by t1.sn
</select>
<insert id="batchInsertPileBasicInfo">
insert into pile_basic_info
(sn, business_type, software_protocol, production_date, licence_id, model_id, sim_id,
merchant_id, station_id, fault_reason, create_by, update_by, del_flag, remark)
values
<foreach collection="infoList" item="item" separator=",">
(
#{item.sn,jdbcType=VARCHAR},
#{item.businessType,jdbcType=VARCHAR},
#{item.softwareProtocol,jdbcType=VARCHAR},
#{item.productionDate,jdbcType=TIMESTAMP},
#{item.licenceId,jdbcType=BIGINT},
#{item.modelId,jdbcType=BIGINT},
#{item.simId,jdbcType=BIGINT},
#{item.merchantId,jdbcType=BIGINT},
#{item.stationId,jdbcType=BIGINT},
#{item.faultReason,jdbcType=VARCHAR},
#{item.createBy,jdbcType=VARCHAR},
#{item.updateBy,jdbcType=VARCHAR},
#{item.delFlag,jdbcType=VARCHAR},
#{item.remark,jdbcType=VARCHAR}
)
</foreach>
</insert>
<update id="replaceMerchantStationByPileIds">
update pile_basic_info
<trim prefix="SET" suffixOverrides=",">
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="stationId != null">station_id = #{stationId},</if>
<if test="modelId != null">model_id = #{modelId},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id in
<foreach collection="pileIdList" item="pileId" open="(" separator="," close=")">
#{pileId,jdbcType=BIGINT}
</foreach>
</update>
<select id="selectBasicInfoById" resultType="com.jsowell.pile.vo.web.PileDetailVO">
SELECT
t1.id as pileId,
t1.sn AS pileSn,
t1.merchant_id AS merchantId,
t2.merchant_name AS merchantName,
t1.station_id AS stationId,
t3.station_name AS stationName,
t1.model_id AS modelId,
t4.rated_power AS ratedPower,
t4.rated_current AS ratedCurrent,
t1.sim_id AS simId,
t5.iccid AS iccid ,
t5.sim_supplier as simSupplier,
t5.operator
FROM
pile_basic_info t1
left JOIN pile_merchant_info t2 ON t1.merchant_id = t2.id
left JOIN pile_station_info t3 ON t1.station_id = t3.id
left JOIN pile_model_info t4 ON t1.model_id = t4.id
left JOIN pile_sim_info t5 ON t1.sim_id = t5.id
WHERE
t1.del_flag = '0'
and t1.id = #{id}
</select>
<select id="selectPileListByStationIds" resultType="com.jsowell.pile.vo.web.PileDetailVO">
select
t1.id as pileId,
t1.sn as pileSn
from
pile_basic_info t1
where
t1.del_flag = '0'
<if test="stationIds != null and stationIds.size() != 0">
and t1.station_id in
<foreach collection="stationIds" item="stationId" open="(" separator="," close=")">
#{stationId,jdbcType=BIGINT}
</foreach>
</if>
</select>
<select id="selectByIdList" resultMap="PileBasicInfoResult">
<include refid="selectPileBasicInfoVo"/>
where id in
<foreach collection="pileIdList" item="pileId" open="(" separator="," close=")">
#{pileId,jdbcType=BIGINT}
</foreach>
</select>
<select id="queryPileConnectorDetail" resultType="com.jsowell.pile.vo.uniapp.PileConnectorDetailVO">
SELECT
t1.id AS pileId,
t1.sn AS pileSn,
t1.station_id AS stationId,
t2.id AS connectorId,
t2.pile_connector_code AS pileConnectorCode,
t2.status AS connectorStatus,
t1.business_type AS businessType,
t1.software_protocol AS softwareProtocol
FROM
pile_basic_info t1
JOIN pile_connector_info t2 ON t1.sn = t2.pile_sn
WHERE
t2.pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
</select>
<select id="getGeneralSituation" resultType="com.jsowell.pile.vo.web.IndexGeneralSituationVO">
SELECT
sum( t3.total_used_electricity ) AS totalChargingDegree,
sum( t3.total_order_amount ) AS totalChargingAmount,
count( DISTINCT t2.order_code ) AS totalChargingQuantity,
count( DISTINCT t1.sn ) AS totalPileQuantity,
t4.totalMemberAmount
FROM
pile_basic_info t1
LEFT JOIN order_basic_info t2 ON t1.sn = t2.pile_sn
LEFT JOIN order_detail t3 ON t2.order_code = t3.order_code
AND t2.order_status = '6'
AND t2.del_flag = '0',
(
SELECT
sum( t2.principal_balance + t2.gift_balance ) AS totalMemberAmount
FROM
member_basic_info t1
JOIN member_wallet_info t2 ON t1.member_id = t2.member_id
AND t1.del_flag = '0'
AND t1.STATUS = '1'
) t4
WHERE
t1.del_flag = '0'
<if test="IndexQueryDTO.stationId != null and IndexQueryDTO.stationId != ''">
and t1.station_id = #{IndexQueryDTO.stationId,jdbcType=VARCHAR}
</if>
group by t4.totalMemberAmount
</select>
<select id="getPileInfoByMemberId" resultType="com.jsowell.pile.vo.uniapp.PersonalPileInfoVO">
SELECT
t1.pile_sn as pileSn,
t1.member_id as memberId,
t1.type,
t3.model_name as modelName,
t3.rated_power as ratedPower,
t3.rated_current as ratedCurrent,
t3.rated_voltage as ratedVoltage,
t3.speed_type as speedType,
count(t4.id) as connectorNum
FROM
pile_member_relation t1
JOIN pile_basic_info t2 ON t1.pile_sn = t2.sn
JOIN pile_model_info t3 ON t2.model_id = t3.id
JOIN pile_connector_info t4 on t2.sn = t4.pile_sn
WHERE
t1.member_id = #{memberId,jdbcType=VARCHAR}
group by
t1.pile_sn,
t1.member_id,
t1.type,
t3.model_name,
t3.rated_power,
t3.rated_current,
t3.rated_voltage,
t3.speed_type
</select>
</mapper>

View File

@@ -0,0 +1,433 @@
<?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.jsowell.pile.mapper.PileBillingTemplateMapper">
<resultMap type="com.jsowell.pile.domain.PileBillingTemplate" id="PileBillingTemplateResult">
<result property="id" column="id"/>
<result property="templateCode" column="template_code"/>
<result property="name" column="name"/>
<result property="remark" column="remark"/>
<result property="type" column="type"/>
<result property="stationId" column="station_id"/>
<result property="publicFlag" column="public_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated PileBillingTemplate-->
id, template_code, name, remark, type, station_id, public_flag,
create_time, update_by, update_time, del_flag
</sql>
<resultMap type="com.jsowell.pile.domain.PileBillingDetail" id="PileBillingDetailResult">
<result property="id" column="id"/>
<result property="templateCode" column="template_code"/>
<result property="timeType" column="time_type"/>
<result property="electricityPrice" column="electricity_price"/>
<result property="servicePrice" column="service_price"/>
<result property="applyTime" column="apply_time"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="Detail_Base_Column_List">
<!--@mbg.generated PileBillingDetail-->
id, template_code, time_type, electricity_price, service_price, apply_time, create_by,
create_time, update_by, update_time, del_flag
</sql>
<resultMap id="PileBillingTemplatePileBillingDetailResult" type="com.jsowell.pile.domain.PileBillingTemplate"
extends="PileBillingTemplateResult">
<collection property="pileBillingDetailList" ofType="com.jsowell.pile.domain.PileBillingDetail" javaType="java.util.List">
<id property="id" column="sub_id"/>
<result property="templateCode" column="sub_template_code"/>
<result property="timeType" column="sub_time_type"/>
<result property="electricityPrice" column="sub_electricity_price"/>
<result property="servicePrice" column="sub_service_price"/>
<result property="applyTime" column="sub_apply_time"/>
<result property="createBy" column="sub_create_by"/>
<result property="createTime" column="sub_create_time"/>
<result property="updateBy" column="sub_update_by"/>
<result property="updateTime" column="sub_update_time"/>
<result property="delFlag" column="sub_del_flag"/>
</collection>
</resultMap>
<sql id="selectPileBillingTemplateVo">
select
<include refid="Base_Column_List" />
from pile_billing_template
</sql>
<select id="selectPileBillingTemplateList" parameterType="com.jsowell.pile.domain.PileBillingTemplate"
resultMap="PileBillingTemplateResult">
<include refid="selectPileBillingTemplateVo"/>
<where>
<if test="publicFlag != null and publicFlag != ''">
and public_flag = #{publicFlag,jdbcType=VARCHAR}
</if>
</where>
</select>
<select id="selectPileBillingTemplateById" parameterType="Long"
resultMap="PileBillingTemplatePileBillingDetailResult">
select a.id as id,
a.template_code,
a.name,
a.remark,
a.type,
a.station_id,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
b.id as sub_id,
b.template_code as sub_template_code,
b.time_type as sub_time_type,
b.electricity_price as sub_electricity_price,
b.service_price as sub_service_price,
b.apply_time as sub_apply_time,
b.create_by as sub_create_by,
b.create_time as sub_create_time,
b.update_by as sub_update_by,
b.update_time as sub_update_time,
b.del_flag as sub_del_flag
from pile_billing_template a
left join pile_billing_detail b on b.template_code = a.template_code
where a.id = #{id}
</select>
<insert id="insertPileBillingTemplate" parameterType="com.jsowell.pile.domain.PileBillingTemplate"
useGeneratedKeys="true" keyProperty="id">
insert into pile_billing_template
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="templateCode != null">
template_code,
</if>
<if test="publicFlag != null">
public_flag,
</if>
<if test="name != null">
name,
</if>
<if test="remark != null">
remark,
</if>
<if test="type != null">
type,
</if>
<if test="stationId != null">
station_id,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="templateCode != null">
#{templateCode},
</if>
<if test="publicFlag != null">
#{publicFlag},
</if>
<if test="name != null">
#{name},
</if>
<if test="remark != null">
#{remark},
</if>
<if test="type != null">
#{type},
</if>
<if test="stationId != null">
#{stationId},
</if>
<if test="createBy != null">
#{createBy},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateBy != null">
#{updateBy},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="delFlag != null">
#{delFlag},
</if>
</trim>
</insert>
<update id="updatePileBillingTemplate" parameterType="com.jsowell.pile.domain.PileBillingTemplate">
update pile_billing_template
<trim prefix="SET" suffixOverrides=",">
<if test="templateCode != null">
template_code = #{templateCode},
</if>
<if test="publicFlag != null">
public_flag = #{publicFlag},
</if>
<if test="name != null">
name = #{name},
</if>
<if test="remark != null">
remark = #{remark},
</if>
<if test="type != null">
type = #{type},
</if>
<if test="stationId != null">
station_id = #{stationId},
</if>
<if test="publishTime != null">
publish_time = #{publishTime},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileBillingTemplateById" parameterType="Long">
delete
from pile_billing_template
where id = #{id}
</delete>
<delete id="deletePileBillingTemplateByIds" parameterType="String">
delete
from pile_billing_template where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deletePileBillingDetailByTemplateCodes" parameterType="String">
delete
from pile_billing_detail
where template_code in
<foreach item="templateCode" collection="templateCodes" open="(" separator="," close=")">
#{templateCode}
</foreach>
</delete>
<delete id="deletePileBillingDetailByTemplateCode" parameterType="String">
delete
from pile_billing_detail
where template_code = #{templateCode}
</delete>
<insert id="batchPileBillingDetail">
insert into pile_billing_detail
(id, template_code, time_type, electricity_price, service_price, apply_time,
create_by, update_by)
values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.id}, #{item.templateCode}, #{item.timeType}, #{item.electricityPrice}, #{item.servicePrice},
#{item.applyTime}, #{item.createBy}, #{item.updateBy})
</foreach>
</insert>
<select id="queryPublicBillingTemplateList" resultType="com.jsowell.pile.vo.web.BillingTemplateVO">
select
t.id as templateId,
t.template_code as templateCode,
t.name as templateName
from
pile_billing_template t
where
t.del_flag = '0'
and t.public_flag = '1'
</select>
<select id="queryStationBillingTemplateList" resultType="com.jsowell.pile.vo.web.BillingTemplateVO">
select
t2.id as templateId,
t2.template_code as templateCode,
t2.name as templateName,
t2.remark as remark,
t2.type as deviceType,
t2.publish_time as publishTime,
t3.electricity_price AS sharpElectricityPrice,
t3.service_price AS sharpServicePrice,
t3.apply_time AS sharpApplyDate,
t4.electricity_price AS peakElectricityPrice,
t4.service_price AS peakServicePrice,
t4.apply_time AS peakApplyDate,
t5.electricity_price AS flatElectricityPrice,
t5.service_price AS flatServicePrice,
t5.apply_time AS flatApplyDate,
t6.electricity_price AS valleyElectricityPrice,
t6.service_price AS valleyServicePrice,
t6.apply_time AS valleyApplyDate
from
pile_billing_template t2
left JOIN pile_billing_detail t3 ON t3.template_code = t2.template_code AND t3.time_type = '1'
left JOIN pile_billing_detail t4 ON t4.template_code = t2.template_code AND t4.time_type = '2'
left JOIN pile_billing_detail t5 ON t5.template_code = t2.template_code AND t5.time_type = '3'
left JOIN pile_billing_detail t6 ON t6.template_code = t2.template_code AND t6.time_type = '4'
where
t2.del_flag = '0'
and t2.station_id = #{stationId,jdbcType=VARCHAR}
order by t2.publish_time desc
</select>
<select id="selectBillingTemplateByPileSn" resultType="com.jsowell.pile.vo.web.BillingTemplateVO">
SELECT
t2.id as templateId,
t2.template_code AS templateCode,
t2.`name` AS templateName,
t3.electricity_price AS sharpElectricityPrice,
t3.service_price AS sharpServicePrice,
t3.apply_time AS sharpApplyDate,
t4.electricity_price AS peakElectricityPrice,
t4.service_price AS peakServicePrice,
t4.apply_time AS peakApplyDate,
t5.electricity_price AS flatElectricityPrice,
t5.service_price AS flatServicePrice,
t5.apply_time AS flatApplyDate,
t6.electricity_price AS valleyElectricityPrice,
t6.service_price AS valleyServicePrice,
t6.apply_time AS valleyApplyDate
FROM
pile_billing_relation t1
JOIN pile_billing_template t2 ON t1.billing_template_code = t2.template_code
JOIN pile_billing_detail t3 ON t3.template_code = t2.template_code AND t3.time_type = '1'
JOIN pile_billing_detail t4 ON t4.template_code = t2.template_code AND t4.time_type = '2'
JOIN pile_billing_detail t5 ON t5.template_code = t2.template_code AND t5.time_type = '3'
JOIN pile_billing_detail t6 ON t6.template_code = t2.template_code AND t6.time_type = '4'
WHERE
t1.pile_sn = #{pileSn,jdbcType=VARCHAR};
</select>
<select id="selectBillingTemplateByTemplateId" resultType="com.jsowell.pile.vo.web.BillingTemplateVO">
SELECT
t2.id as templateId,
t2.template_code AS templateCode,
t2.`name` AS templateName,
t3.electricity_price AS sharpElectricityPrice,
t3.service_price AS sharpServicePrice,
t3.apply_time AS sharpApplyDate,
t4.electricity_price AS peakElectricityPrice,
t4.service_price AS peakServicePrice,
t4.apply_time AS peakApplyDate,
t5.electricity_price AS flatElectricityPrice,
t5.service_price AS flatServicePrice,
t5.apply_time AS flatApplyDate,
t6.electricity_price AS valleyElectricityPrice,
t6.service_price AS valleyServicePrice,
t6.apply_time AS valleyApplyDate
FROM
pile_billing_template t2
left JOIN pile_billing_detail t3 ON t3.template_code = t2.template_code AND t3.time_type = '1'
left JOIN pile_billing_detail t4 ON t4.template_code = t2.template_code AND t4.time_type = '2'
left JOIN pile_billing_detail t5 ON t5.template_code = t2.template_code AND t5.time_type = '3'
left JOIN pile_billing_detail t6 ON t6.template_code = t2.template_code AND t6.time_type = '4'
WHERE
t2.id = #{templateId,jdbcType=VARCHAR};
</select>
<select id="queryBillingDetailByTemplateIds" resultMap="PileBillingDetailResult">
SELECT
t1.id,
t1.template_code,
t1.time_type,
t1.electricity_price,
t1.service_price,
t1.apply_time,
t1.create_by,
t1.create_time,
t1.update_by,
t1.update_time,
t1.del_flag
FROM pile_billing_detail t1
JOIN pile_billing_template t2 ON t2.template_code = t1.template_code
WHERE t2.id in
<foreach collection="templateIds" item="templateId" open="(" separator="," close=")">
#{templateId,jdbcType=BIGINT}
</foreach>
</select>
<insert id="insertPileBillingRelation">
insert into pile_billing_relation
(pile_sn, billing_template_code, station_id)
values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.pileSn}, #{item.billingTemplateCode}, #{item.stationId})
</foreach>
</insert>
<delete id="deleteRelationByPileSn">
delete
from pile_billing_relation
where pile_sn in
<foreach collection="pileSnList" item="pileSn" open="(" separator="," close=")">
#{pileSn,jdbcType=VARCHAR}
</foreach>
</delete>
<select id="selectBillingTemplateByStationId" resultType="com.jsowell.pile.vo.web.BillingTemplateVO">
SELECT
t2.id as templateId,
t2.template_code AS templateCode,
t2.`name` AS templateName,
t3.electricity_price AS sharpElectricityPrice,
t3.service_price AS sharpServicePrice,
t3.apply_time AS sharpApplyDate,
t4.electricity_price AS peakElectricityPrice,
t4.service_price AS peakServicePrice,
t4.apply_time AS peakApplyDate,
t5.electricity_price AS flatElectricityPrice,
t5.service_price AS flatServicePrice,
t5.apply_time AS flatApplyDate,
t6.electricity_price AS valleyElectricityPrice,
t6.service_price AS valleyServicePrice,
t6.apply_time AS valleyApplyDate
FROM
pile_billing_template t2
left JOIN pile_billing_detail t3 ON t3.template_code = t2.template_code AND t3.time_type = '1'
left JOIN pile_billing_detail t4 ON t4.template_code = t2.template_code AND t4.time_type = '2'
left JOIN pile_billing_detail t5 ON t5.template_code = t2.template_code AND t5.time_type = '3'
left JOIN pile_billing_detail t6 ON t6.template_code = t2.template_code AND t6.time_type = '4'
WHERE
t2.station_id = #{stationId,jdbcType=VARCHAR}
order by t2.publish_time DESC
limit 1
</select>
</mapper>

View File

@@ -0,0 +1,239 @@
<?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.jsowell.pile.mapper.PileConnectorInfoMapper">
<resultMap type="com.jsowell.pile.domain.PileConnectorInfo" id="PileConnectorInfoResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="pileConnectorCode" column="pile_connector_code" />
<result property="status" column="status" />
<result property="pileSn" column="pile_sn" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectPileConnectorInfoVo">
select id, name, pile_connector_code, status, pile_sn, create_by, create_time, update_by, update_time, del_flag from pile_connector_info
</sql>
<select id="selectPileConnectorInfoList" parameterType="com.jsowell.pile.domain.PileConnectorInfo"
resultMap="PileConnectorInfoResult">
<include refid="selectPileConnectorInfoVo"/>
<where>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="pileConnectorCode != null and pileConnectorCode != ''">
and pile_connector_code = #{pileConnectorCode}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="pileSn != null">
and pile_sn = #{pileSn}
</if>
</where>
</select>
<select id="selectPileConnectorInfoById" parameterType="Integer" resultMap="PileConnectorInfoResult">
<include refid="selectPileConnectorInfoVo"/>
where id = #{id}
</select>
<insert id="insertPileConnectorInfo" parameterType="com.jsowell.pile.domain.PileConnectorInfo" useGeneratedKeys="true" keyProperty="id">
insert into pile_connector_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="pileConnectorCode != null">pile_connector_code,</if>
<if test="status != null">status,</if>
<if test="pileSn != null">pile_sn,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="pileConnectorCode != null">#{pileConnectorCode},</if>
<if test="status != null">#{status},</if>
<if test="pileSn != null">#{pileSn},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updatePileConnectorInfo" parameterType="com.jsowell.pile.domain.PileConnectorInfo">
update pile_connector_info
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="pileConnectorCode != null">pile_connector_code = #{pileConnectorCode},</if>
<if test="status != null">status = #{status},</if>
<if test="pileSn != null">pile_sn = #{pileSn},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileConnectorInfoById" parameterType="Integer">
delete from pile_connector_info where id = #{id}
</delete>
<delete id="deletePileConnectorInfoByIds" parameterType="String">
delete from pile_connector_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deletePileConnectorInfoByPileSnList">
delete from pile_connector_info where pile_sn in
<foreach collection="list" item="pileSn" open="(" separator="," close=")">
#{pileSn,jdbcType=VARCHAR}
</foreach>
</delete>
<select id="getConnectorInfoList" resultType="com.jsowell.pile.vo.web.PileConnectorInfoVO">
select
id,
code,
status
from pile_connector_info
<where>
<if test="connectorDTO.connectorCode != null and connectorDTO.connectorCode != ''">
and code = #{connectorDTO.connectorCode,jdbcType=VARCHAR}
</if>
</where>
</select>
<insert id="batchInsertConnectorInfo">
insert into pile_connector_info
(name,pile_connector_code,status,pile_sn,create_by,update_by,del_flag)
values
<foreach collection="connectorList" item="item" separator=",">
(
#{item.name,jdbcType=VARCHAR},
#{item.pileConnectorCode,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR},
#{item.pileSn,jdbcType=VARCHAR},
#{item.createBy,jdbcType=VARCHAR},
#{item.updateBy,jdbcType=VARCHAR},
#{item.delFlag,jdbcType=VARCHAR}
)
</foreach>
</insert>
<select id="selectConnectorListByStationId" resultType="com.jsowell.pile.vo.web.PileConnectorInfoVO">
SELECT
t1.id as connectorId,
t1.station_id as stationId,
t1.sn as pileSn,
t2.pile_connector_code as connectorCode,
t2.status,
t1.merchant_id as merchantId,
t3.merchant_name as merchantName
FROM
pile_basic_info t1
LEFT JOIN pile_connector_info t2 ON t1.sn = t2.pile_sn
LEFT JOIN pile_merchant_info t3 ON t1.merchant_id = t3.id
where t1.del_flag = '0'
<if test="stationId != null and stationId != ''">
and station_id = #{stationId,jdbcType=VARCHAR}
</if>
</select>
<select id="getPileConnectorInfoList" resultType="com.jsowell.pile.vo.web.PileConnectorInfoVO">
select
t1.id as connectorId,
t1.pile_connector_code as pileConnectorCode,
t1.status as status,
t1.pile_sn as pileSn,
t2.station_id as stationId,
t2.merchant_id as merchantId,
t2.business_type as businessType,
t4.merchant_name as merchantName,
t3.rated_power as ratedPower,
IF(t3.charger_pile_type = '2','3',(IF(t3.speed_type = '1','1','2'))) AS type
from pile_connector_info t1
join pile_basic_info t2 on t2.sn = t1.pile_sn
join pile_model_info t3 on t3.id = t2.model_id
join pile_merchant_info t4 on t2.merchant_id = t4.id
where t1.del_flag = '0'
<if test="connectorIds != null and connectorIds.size() != 0">
and t1.id in
<foreach collection="connectorIds" item="id" open="(" separator="," close=")">
#{id,jdbcType=BIGINT}
</foreach>
</if>
<if test="pileSns != null and pileSns.size() != 0">
and t1.pile_sn in
<foreach collection="pileSns" item="pileSn" open="(" separator="," close=")">
#{pileSn,jdbcType=VARCHAR}
</foreach>
</if>
<if test="connectorCodes != null and connectorCodes.size() != 0 ">
and t1.pile_connector_code in
<foreach collection="connectorCodes" item="connectorCode" open="(" separator="," close=")">
#{connectorCode,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<select id="getPileConnectorInfoByConnectorCode" resultType="com.jsowell.pile.vo.web.PileConnectorInfoVO">
select
t1.id as connectorId,
t1.pile_connector_code as connectorCode,
t1.status as status,
t1.pile_sn as pileSn,
IF(t3.charger_pile_type = '2','3',(IF(t3.speed_type = '1','1','2'))) AS type,
t2.business_type as businessType,
t2.station_id as stationId,
t2.merchant_id as merchantId
from pile_connector_info t1
join pile_basic_info t2 on t2.sn = t1.pile_sn
join pile_model_info t3 on t3.id = t2.model_id
where t1.del_flag = '0'
and t1.pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
</select>
<update id="updateConnectorStatus">
update pile_connector_info
set status = #{connectorStatus,jdbcType=VARCHAR}
where pile_connector_code = #{connectorCode,jdbcType=VARCHAR}
</update>
<update id="updateConnectorStatusByPileSn">
update pile_connector_info
set status = #{connectorStatus,jdbcType=VARCHAR}
where pile_sn = #{pileSn,jdbcType=VARCHAR}
</update>
<select id="getUniAppConnectorList" resultType="com.jsowell.pile.vo.base.ConnectorInfoVO">
SELECT
t1.pile_connector_code as connectorCode,
t1.STATUS as connectorStatus,
t1.pile_sn,
t2.model_id,
t3.speed_type as chargingType,
t3.rated_power as ratedPower
FROM
pile_connector_info t1
JOIN pile_basic_info t2 ON (t1.pile_sn = t2.sn AND t2.del_flag = '0')
JOIN pile_model_info t3 ON (t2.model_id = t3.id AND t3.del_flag = '0')
WHERE t1.del_flag = '0'
AND t2.station_id = #{stationId,jdbcType=BIGINT}
</select>
</mapper>

View File

@@ -0,0 +1,93 @@
<?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.jsowell.pile.mapper.PileLicenceInfoMapper">
<resultMap type="com.jsowell.pile.domain.PileLicenceInfo" id="PileLicenceInfoResult">
<result property="id" column="id" />
<result property="licenceName" column="licence_name" />
<result property="merchantId" column="merchant_id" />
<result property="status" column="status" />
<result property="expireTime" column="expire_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectPileLicenceInfoVo">
select id, licence_name, merchant_id, status, expire_time, create_by, create_time, update_by, update_time, del_flag from pile_licence_info
</sql>
<select id="selectPileLicenceInfoList" parameterType="com.jsowell.pile.domain.PileLicenceInfo" resultMap="PileLicenceInfoResult">
<include refid="selectPileLicenceInfoVo"/>
<where>
<if test="licenceName != null and licenceName != ''"> and licence_name like concat('%', #{licenceName}, '%')</if>
<if test="merchantId != null "> and merchant_id = #{merchantId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="expireTime != null "> and expire_time = #{expireTime}</if>
</where>
</select>
<select id="selectPileLicenceInfoById" parameterType="Long" resultMap="PileLicenceInfoResult">
<include refid="selectPileLicenceInfoVo"/>
where id = #{id}
</select>
<insert id="insertPileLicenceInfo" parameterType="com.jsowell.pile.domain.PileLicenceInfo">
insert into pile_licence_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="licenceName != null">licence_name,</if>
<if test="merchantId != null">merchant_id,</if>
<if test="status != null">status,</if>
<if test="expireTime != null">expire_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="licenceName != null">#{licenceName},</if>
<if test="merchantId != null">#{merchantId},</if>
<if test="status != null">#{status},</if>
<if test="expireTime != null">#{expireTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updatePileLicenceInfo" parameterType="com.jsowell.pile.domain.PileLicenceInfo">
update pile_licence_info
<trim prefix="SET" suffixOverrides=",">
<if test="licenceName != null">licence_name = #{licenceName},</if>
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="status != null">status = #{status},</if>
<if test="expireTime != null">expire_time = #{expireTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileLicenceInfoById" parameterType="Long">
delete from pile_licence_info where id = #{id}
</delete>
<delete id="deletePileLicenceInfoByIds" parameterType="String">
delete from pile_licence_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,89 @@
<?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.jsowell.pile.mapper.PileMemberRelationMapper">
<resultMap type="com.jsowell.pile.domain.PileMemberRelation" id="PileMemberRelationResult">
<result property="id" column="id" />
<result property="pileSn" column="pile_sn" />
<result property="memberId" column="member_id" />
<result property="type" column="type" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectPileMemberRelationVo">
select id, pile_sn, member_id, type, create_time from pile_member_relation
</sql>
<sql id="Base_Column_List">
id, pile_sn, member_id, type, create_time
</sql>
<select id="selectPileMemberRelationList" parameterType="com.jsowell.pile.domain.PileMemberRelation" resultMap="PileMemberRelationResult">
<include refid="selectPileMemberRelationVo"/>
<where>
<if test="pileSn != null and pileSn != ''"> and pile_sn = #{pileSn}</if>
<if test="memberId != null and memberId != ''"> and member_id = #{memberId}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
</where>
</select>
<select id="selectPileMemberRelationById" parameterType="Integer" resultMap="PileMemberRelationResult">
<include refid="selectPileMemberRelationVo"/>
where id = #{id}
</select>
<insert id="insertPileMemberRelation" parameterType="com.jsowell.pile.domain.PileMemberRelation" useGeneratedKeys="true" keyProperty="id">
insert into pile_member_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pileSn != null">pile_sn,</if>
<if test="memberId != null">member_id,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pileSn != null">#{pileSn},</if>
<if test="memberId != null">#{memberId},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
<update id="updatePileMemberRelation" parameterType="com.jsowell.pile.domain.PileMemberRelation">
update pile_member_relation
<trim prefix="SET" suffixOverrides=",">
<if test="pileSn != null">pile_sn = #{pileSn},</if>
<if test="memberId != null">member_id = #{memberId},</if>
<if test="type != null">type = #{type},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileMemberRelationById" parameterType="Integer">
delete from pile_member_relation where id = #{id}
</delete>
<delete id="deletePileMemberRelationByIds" parameterType="String">
delete from pile_member_relation where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectPileMemberRelation" resultMap="PileMemberRelationResult">
select
<include refid="Base_Column_List"/>
from pile_member_relation
where 1 = 1
<if test="pileSn != null and pileSn != ''">
and pile_sn = #{pileSn,jdbcType=VARCHAR}
</if>
<if test="memberId != null and memberId != ''">
and member_id = #{memberId,jdbcType=VARCHAR}
</if>
<if test="type != null and type != ''">
and type = #{type,jdbcType=VARCHAR}
</if>
</select>
</mapper>

View File

@@ -0,0 +1,262 @@
<?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.jsowell.pile.mapper.PileMerchantInfoMapper">
<resultMap type="com.jsowell.pile.domain.PileMerchantInfo" id="PileMerchantInfoResult">
<result property="id" column="id"/>
<result property="merchantName" column="merchant_name"/>
<result property="address" column="address"/>
<result property="status" column="status"/>
<result property="organizationCode" column="organization_code"/>
<result property="managerName" column="manager_name"/>
<result property="managerPhone" column="manager_phone"/>
<result property="servicePhone" column="service_phone"/>
<result property="logoUrl" column="logo_url"/>
<result property="appId" column="app_id"/>
<result property="deptId" column="dept_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="Base_Column_List">
id,
merchant_name,
address,
status,
organization_code,
manager_name,
manager_phone,
service_phone,
logo_url,
app_id,
dept_id,
create_by,
create_time,
update_by,
update_time,
del_flag
</sql>
<sql id="selectPileMerchantInfoVo">
select
<include refid="Base_Column_List"/>
from pile_merchant_info t
</sql>
<select id="selectPileMerchantInfoList" parameterType="com.jsowell.pile.domain.PileMerchantInfo"
resultMap="PileMerchantInfoResult">
<include refid="selectPileMerchantInfoVo"/>
<where>
<if test="merchantName != null and merchantName != ''">
and merchant_name like concat('%', #{merchantName}, '%')
</if>
<if test="address != null and address != ''">
and address = #{address}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="organizationCode != null and organizationCode != ''">
and organization_code = #{organizationCode}
</if>
<if test="managerName != null and managerName != ''">
and manager_name like concat('%', #{managerName}, '%')
</if>
<if test="managerPhone != null and managerPhone != ''">
and manager_phone = #{managerPhone}
</if>
<if test="servicePhone != null and servicePhone != ''">
and service_phone = #{servicePhone}
</if>
<if test="logoUrl != null and logoUrl != ''">
and logo_url = #{logoUrl}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>
<select id="selectPileMerchantInfoById" parameterType="Long" resultMap="PileMerchantInfoResult">
<include refid="selectPileMerchantInfoVo"/>
where id = #{id}
</select>
<insert id="insertPileMerchantInfo" parameterType="com.jsowell.pile.domain.PileMerchantInfo">
insert into pile_merchant_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="merchantName != null">
merchant_name,
</if>
<if test="address != null">
address,
</if>
<if test="status != null">
status,
</if>
<if test="organizationCode != null">
organization_code,
</if>
<if test="managerName != null">
manager_name,
</if>
<if test="managerPhone != null">
manager_phone,
</if>
<if test="servicePhone != null">
service_phone,
</if>
<if test="logoUrl != null">
logo_url,
</if>
<if test="appId != null">
app_id,
</if>
<if test="deptId != null">
dept_id,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="merchantName != null">
#{merchantName},
</if>
<if test="address != null">
#{address},
</if>
<if test="status != null">
#{status},
</if>
<if test="organizationCode != null">
#{organizationCode},
</if>
<if test="managerName != null">
#{managerName},
</if>
<if test="managerPhone != null">
#{managerPhone},
</if>
<if test="servicePhone != null">
#{servicePhone},
</if>
<if test="logoUrl != null">
#{logoUrl},
</if>
<if test="appId != null">
#{appId},
</if>
<if test="deptId != null">
#{deptId},
</if>
<if test="createBy != null">
#{createBy},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateBy != null">
#{updateBy},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="delFlag != null">
#{delFlag},
</if>
</trim>
</insert>
<update id="updatePileMerchantInfo" parameterType="com.jsowell.pile.domain.PileMerchantInfo">
update pile_merchant_info
<trim prefix="SET" suffixOverrides=",">
<if test="merchantName != null">
merchant_name = #{merchantName},
</if>
<if test="address != null">
address = #{address},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="organizationCode != null">
organization_code = #{organizationCode},
</if>
<if test="managerName != null">
manager_name = #{managerName},
</if>
<if test="managerPhone != null">
manager_phone = #{managerPhone},
</if>
<if test="servicePhone != null">
service_phone = #{servicePhone},
</if>
<if test="logoUrl != null">
logo_url = #{logoUrl},
</if>
<if test="appId != null">
app_id = #{appId},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileMerchantInfoById" parameterType="Long">
delete
from pile_merchant_info
where id = #{id}
</delete>
<delete id="deletePileMerchantInfoByIds" parameterType="String">
delete
from pile_merchant_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectPileMerchantInfoByAppId" resultMap="PileMerchantInfoResult">
select
<include refid="Base_Column_List"/>
from pile_merchant_info
where
app_id = #{appId,jdbcType=VARCHAR}
</select>
</mapper>

View File

@@ -0,0 +1,147 @@
<?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.jsowell.pile.mapper.PileModelInfoMapper">
<resultMap type="com.jsowell.pile.domain.PileModelInfo" id="PileModelInfoResult">
<result property="id" column="id" />
<result property="modelName" column="model_name" />
<result property="ratedPower" column="rated_power" />
<result property="ratedCurrent" column="rated_current" />
<result property="ratedVoltage" column="rated_voltage" />
<result property="speedType" column="speed_type" />
<result property="chargerPileType" column="charger_pile_type" />
<result property="connectorNum" column="connector_num" />
<result property="interfaceStandard" column="interface_standard" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectPileModelInfoVo">
select
<include refid="Base_Column_List"/>
from pile_model_info
</sql>
<sql id="Base_Column_List">
id, model_name,rated_power, rated_current, rated_voltage, speed_type, charger_pile_type, connector_num, interface_standard, create_by,
create_time, update_by, update_time, del_flag
</sql>
<select id="selectPileModelInfoList" parameterType="com.jsowell.pile.domain.PileModelInfo" resultMap="PileModelInfoResult">
<include refid="selectPileModelInfoVo"/>
<where>
<if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
<if test="ratedPower != null and ratedPower != ''"> and rated_power = #{ratedPower}</if>
<if test="ratedCurrent != null and ratedCurrent != ''"> and rated_current = #{ratedCurrent}</if>
<if test="ratedVoltage != null and ratedVoltage != ''"> and rated_voltage = #{ratedVoltage}</if>
<if test="speedType != null and speedType != ''"> and speed_type = #{speedType}</if>
<if test="chargerPileType != null and chargerPileType != ''"> and charger_pile_type = #{chargerPileType}</if>
<if test="connectorNum != null "> and connector_num = #{connectorNum}</if>
<if test="interfaceStandard != null and interfaceStandard != ''"> and interface_standard = #{interfaceStandard}</if>
</where>
</select>
<select id="selectPileModelInfoById" parameterType="Long" resultMap="PileModelInfoResult">
<include refid="selectPileModelInfoVo"/>
where id = #{id}
</select>
<insert id="insertPileModelInfo" parameterType="com.jsowell.pile.domain.PileModelInfo" useGeneratedKeys="true" keyProperty="id">
insert into pile_model_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="modelName != null">model_name,</if>
<if test="ratedPower != null">rated_power,</if>
<if test="ratedCurrent != null">rated_current,</if>
<if test="ratedVoltage != null">rated_voltage,</if>
<if test="speedType != null">speed_type,</if>
<if test="chargerPileType != null">charger_pile_type,</if>
<if test="connectorNum != null">connector_num,</if>
<if test="interfaceStandard != null">interface_standard,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="modelName != null">#{modelName},</if>
<if test="ratedPower != null">#{ratedPower},</if>
<if test="ratedCurrent != null">#{ratedCurrent},</if>
<if test="ratedVoltage != null">#{ratedVoltage},</if>
<if test="speedType != null">#{speedType},</if>
<if test="chargerPileType != null">#{chargerPileType},</if>
<if test="connectorNum != null">#{connectorNum},</if>
<if test="interfaceStandard != null">#{interfaceStandard},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updatePileModelInfo" parameterType="com.jsowell.pile.domain.PileModelInfo">
update pile_model_info
<trim prefix="SET" suffixOverrides=",">
<if test="modelName != null">model_name = #{modelName},</if>
<if test="ratedPower != null">rated_power = #{ratedPower},</if>
<if test="ratedCurrent != null">rated_current = #{ratedCurrent},</if>
<if test="ratedVoltage != null">rated_voltage = #{ratedVoltage},</if>
<if test="speedType != null">speed_type = #{speedType},</if>
<if test="chargerPileType != null">charger_pile_type = #{chargerPileType},</if>
<if test="connectorNum != null">connector_num = #{connectorNum},</if>
<if test="interfaceStandard != null">interface_standard = #{interfaceStandard},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileModelInfoById" parameterType="Long">
delete from pile_model_info where id = #{id}
</delete>
<delete id="deletePileModelInfoByIds" parameterType="String">
delete from pile_model_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getPileModelInfoByPileSnList" resultType="com.jsowell.pile.vo.web.PileModelInfoVO">
SELECT
t1.sn as pileSn,
t2.id as modelId,
t2.model_name as modelName,
t2.rated_power as ratedPower,
t2.rated_current as ratedCurrent,
t2.rated_voltage as ratedVoltage,
t2.speed_type as speedType,
t2.charger_pile_type as chargerPileType,
t2.connector_num as connectorNum,
t2.interface_standard as interfaceStandard,
t2.create_by as createBy,
t2.create_time as createTime,
t2.update_by as updateBy,
t2.update_time as updateTime
FROM
pile_basic_info t1
JOIN pile_model_info t2 ON t1.model_id = t2.id
WHERE
t1.del_flag = '0'
and t1.sn in
<foreach collection="pileSnList" item="pileSn" open="(" separator="," close=")">
#{pileSn,jdbcType=VARCHAR}
</foreach>
</select>
</mapper>

View File

@@ -0,0 +1,131 @@
<?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.jsowell.pile.mapper.PileMsgRecordMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.PileMsgRecord">
<!--@mbg.generated-->
<!--@Table pile_msg_record-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="pile_sn" jdbcType="VARCHAR" property="pileSn" />
<result column="frame_type" jdbcType="VARCHAR" property="frameType" />
<result column="connector_code" jdbcType="VARCHAR" property="connectorCode" />
<result column="pile_connector_code" jdbcType="VARCHAR" property="pileConnectorCode" />
<result column="original_msg" jdbcType="VARCHAR" property="originalMsg" />
<result column="json_msg" jdbcType="VARCHAR" property="jsonMsg" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, pile_sn, frame_type, connector_code, pile_connector_code, original_msg, json_msg, create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from pile_msg_record
where id = #{id,jdbcType=INTEGER}
</select>
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.PileMsgRecord">
<!--@mbg.generated-->
insert into pile_msg_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="pileSn != null and pileSn != ''">
pile_sn,
</if>
<if test="frameType != null and frameType != ''">
frame_type,
</if>
<if test="connectorCode != null and connectorCode != ''">
connector_code,
</if>
<if test="pileConnectorCode != null and pileConnectorCode != ''">
pile_connector_code,
</if>
<if test="originalMsg != null and originalMsg != ''">
original_msg,
</if>
<if test="jsonMsg != null and jsonMsg != ''">
json_msg,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="pileSn != null and pileSn != ''">
#{pileSn,jdbcType=VARCHAR},
</if>
<if test="frameType != null and frameType != ''">
#{frameType,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null and connectorCode != ''">
#{connectorCode,jdbcType=VARCHAR},
</if>
<if test="pileConnectorCode != null and pileConnectorCode != ''">
#{pileConnectorCode,jdbcType=VARCHAR},
</if>
<if test="originalMsg != null and originalMsg != ''">
#{originalMsg,jdbcType=VARCHAR},
</if>
<if test="jsonMsg != null and jsonMsg != ''">
#{jsonMsg,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="getByPileSn" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pile_msg_record
where pile_sn = #{pileSn,jdbcType=VARCHAR}
</select>
<select id="getByConnectorCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pile_msg_record
where connector_code = #{connectorCode,jdbcType=VARCHAR}
</select>
<select id="getByConnectorCodeList" resultMap="BaseResultMap">
SELECT
t1.id, t1.pile_sn, t1.frame_type, t1.connector_code, t1.original_msg, t1.json_msg, t1.create_time
FROM
pile_msg_record t1,
(
SELECT
pmr.connector_code,
MAX(pmr.create_time) AS lastTime
FROM
pile_msg_record pmr
WHERE
pmr.connector_code IN
<foreach collection="connectorCodeList" item="connectorCode" open="(" separator="," close=")">
#{connectorCode,jdbcType=VARCHAR}
</foreach>
AND pmr.frame_type IN ('11', '13')
GROUP BY pmr.connector_code
) t2
WHERE
t1.connector_code = t2.connector_code
AND t1.create_time = t2.lastTime
AND t1.frame_type IN ('11', '13')
</select>
<select id="getPileFeedList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from pile_msg_record
where pile_sn = #{pileSn,jdbcType=VARCHAR}
order by create_time desc
</select>
</mapper>

View File

@@ -0,0 +1,182 @@
<?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.jsowell.pile.mapper.PileSimInfoMapper">
<resultMap type="com.jsowell.pile.domain.PileSimInfo" id="PileSimInfoResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="iccid" column="iccid" />
<result property="status" column="status" />
<result property="simSupplier" column="sim_supplier" />
<result property="totalData" column="total_data" />
<result property="surplusData" column="surplus_data" />
<result property="expireTime" column="expire_time" />
<result property="operator" column="operator" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectPileSimInfoVo">
select id, name, iccid, status, sim_supplier, total_data, surplus_data, expire_time, operator, create_by, create_time, update_by, update_time, del_flag from pile_sim_info
</sql>
<select id="selectPileSimInfoList" parameterType="com.jsowell.pile.domain.PileSimInfo" resultMap="PileSimInfoResult">
<include refid="selectPileSimInfoVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="iccid != null and iccid != ''"> and iccid = #{iccid}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="simSupplier != null and simSupplier != ''"> and sim_supplier = #{simSupplier}</if>
<if test="totalData != null and totalData != ''"> and total_data = #{totalData}</if>
<if test="surplusData != null and surplusData != ''"> and surplus_data = #{surplusData}</if>
<if test="expireTime != null "> and expire_time = #{expireTime}</if>
<if test="operator != null and operator != ''"> and operator = #{operator}</if>
</where>
</select>
<select id="selectPileSimInfoById" parameterType="Long" resultMap="PileSimInfoResult">
<include refid="selectPileSimInfoVo"/>
where id = #{id}
</select>
<insert id="insertPileSimInfo" parameterType="com.jsowell.pile.domain.PileSimInfo">
insert into pile_sim_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
<if test="iccid != null">iccid,</if>
<if test="status != null">status,</if>
<if test="simSupplier != null">sim_supplier,</if>
<if test="totalData != null">total_data,</if>
<if test="surplusData != null">surplus_data,</if>
<if test="expireTime != null">expire_time,</if>
<if test="operator != null">operator,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="iccid != null">#{iccid},</if>
<if test="status != null">#{status},</if>
<if test="simSupplier != null">#{simSupplier},</if>
<if test="totalData != null">#{totalData},</if>
<if test="surplusData != null">#{surplusData},</if>
<if test="expireTime != null">#{expireTime},</if>
<if test="operator != null">#{operator},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updatePileSimInfo" parameterType="com.jsowell.pile.domain.PileSimInfo">
update pile_sim_info
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="iccid != null">iccid = #{iccid},</if>
<if test="status != null">status = #{status},</if>
<if test="simSupplier != null">sim_supplier = #{simSupplier},</if>
<if test="totalData != null">total_data = #{totalData},</if>
<if test="surplusData != null">surplus_data = #{surplusData},</if>
<if test="expireTime != null">expire_time = #{expireTime},</if>
<if test="operator != null">operator = #{operator},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileSimInfoById" parameterType="Long">
delete from pile_sim_info where id = #{id}
</delete>
<delete id="deletePileSimInfoByIds" parameterType="String">
delete from pile_sim_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<sql id="Base_Column_List">
id, name, iccid, status, sim_supplier, total_data, surplus_data, expire_time, operator, create_by, create_time,
update_by, del_flag
</sql>
<select id="querySimCardInfoByPileSn" resultType="com.jsowell.pile.vo.web.SimCardInfoVO">
SELECT
t1.id,
t2.sn as pileSn,
t1.iccid as iccId,
t1.STATUS as simCardStatus,
t1.sim_supplier as simSupplier,
t1.total_data as totalData,
t1.surplus_data as surplusData,
t1.expire_time as expireTime,
t1.operator
from pile_sim_info t1 join pile_basic_info t2 on t1.id = t2.sim_id
where t1.del_flag = '0'
and t2.sn = #{pileSn,jdbcType=VARCHAR}
</select>
<select id="selectSimInfoByIccIds" resultMap="PileSimInfoResult">
select
<include refid="Base_Column_List"/>
from pile_sim_info
where del_flag = '0'
and iccid in
<foreach collection="iccIds" open="(" separator="," close=")" item="iccId">
#{iccId,jdbcType=VARCHAR}
</foreach>
</select>
<select id="getBasicInfoByIccId" resultMap="PileSimInfoResult">
select
<include refid="Base_Column_List"/>
from pile_sim_info
where del_flag = '0'
and iccid = #{iccId,jdbcType=VARCHAR}
</select>
<select id="getSimInfoList" resultType="com.jsowell.pile.vo.web.SimCardInfoVO">
SELECT
t2.sn as pileSn,
t2.sim_id as id,
t1.iccid as iccId,
t1.NAME as name,
t1.sim_supplier as simSupplier,
t1.STATUS as simCardStatus,
t1.total_data as totalData,
t1.surplus_data as surplusData,
t1.expire_time as expireTime,
t1.operator
from pile_sim_info t1 left join pile_basic_info t2 on t1.id = t2.sim_id
where t1.del_flag = '0'
<if test="dto.pileSn != null and dto.pileSn != ''">
and t2.sn = #{dto.pileSn,jdbcType=VARCHAR}
</if>
<if test="dto.simSupplier != null and dto.simSupplier != ''">
and t1.sim_supplier = #{dto.simSupplier,jdbcType=VARCHAR}
</if>
<if test="dto.iccId != null and dto.iccId != ''">
and t1.iccid = #{dto.iccId,jdbcType=VARCHAR}
</if>
<if test="dto.expiredTime != null and dto.expiredTime != ''">
and t1.expire_time = #{dto.expiredTime,jdbcType=VARCHAR}
</if>
</select>
</mapper>

View File

@@ -0,0 +1,352 @@
<?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.jsowell.pile.mapper.PileStationInfoMapper">
<resultMap type="com.jsowell.pile.domain.PileStationInfo" id="PileStationInfoResult">
<result property="id" column="id" />
<result property="merchantId" column="merchant_id" />
<result property="stationName" column="station_name" />
<result property="deptId" column="dept_id" />
<result property="aloneApply" column="alone_apply" />
<result property="accountNumber" column="account_number" />
<result property="capacity" column="capacity" />
<result property="publicParking" column="public_parking" />
<result property="parkingNumber" column="parking_number" />
<result property="countryCode" column="country_code" />
<result property="areaCode" column="area_code" />
<result property="address" column="address" />
<result property="stationTel" column="station_tel" />
<result property="serviceTel" column="service_tel" />
<result property="stationType" column="station_type" />
<result property="stationStatus" column="station_status" />
<result property="stationAdminName" column="station_admin_name" />
<result property="parkNums" column="park_nums" />
<result property="stationLng" column="station_lng" />
<result property="stationLat" column="station_lat" />
<result property="siteGuide" column="site_guide" />
<result property="construction" column="construction" />
<result property="pictures" column="pictures" />
<result property="matchCars" column="match_cars" />
<result property="parkInfo" column="park_info" />
<result property="parkOwner" column="park_owner" />
<result property="parkManager" column="park_manager" />
<result property="openAllDay" column="open_all_day" />
<result property="businessHours" column="business_hours" />
<result property="parkFree" column="park_free" />
<result property="payment" column="payment" />
<result property="supportOrder" column="support_order" />
<result property="remark" column="remark" />
<result property="publicFlag" column="public_flag" />
<result property="openFlag" column="open_flag" />
<result property="toiletFlag" column="toilet_flag" />
<result property="storeFlag" column="store_flag" />
<result property="restaurantFlag" column="restaurant_flag" />
<result property="loungeFlag" column="lounge_flag" />
<result property="canopyFlag" column="canopy_flag" />
<result property="printerFlag" column="printer_flag" />
<result property="barrierFlag" column="barrier_flag" />
<result property="parkingLockFlag" column="parking_lock_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectPileStationInfoVo">
select id,merchant_id, station_name, dept_id, alone_apply, account_number, capacity, public_parking, parking_number,
country_code, area_code, address, station_tel, service_tel, station_type, station_status, station_admin_name, park_nums,
station_lng, station_lat, site_guide, construction, pictures, match_cars, park_info, park_owner,
park_manager, open_all_day, business_hours, park_free, payment, support_order, remark, public_flag,
open_flag,toilet_flag, store_flag, restaurant_flag, lounge_flag, canopy_flag, printer_flag, barrier_flag,
parking_lock_flag, create_by, create_time, update_by, update_time, del_flag
from pile_station_info
</sql>
<select id="selectPileStationInfoList" parameterType="com.jsowell.pile.domain.PileStationInfo" resultMap="PileStationInfoResult">
<include refid="selectPileStationInfoVo"/>
<where>
<if test="merchantId != null and merchantId != ''"> and merchant_id = #{merchantId}</if>
<if test="stationName != null and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
<if test="aloneApply != null and aloneApply != ''"> and alone_apply = #{aloneApply}</if>
<if test="accountNumber != null and accountNumber != ''"> and account_number = #{accountNumber}</if>
<if test="capacity != null "> and capacity = #{capacity}</if>
<if test="publicParking != null and publicParking != ''"> and public_parking = #{publicParking}</if>
<if test="parkingNumber != null and parkingNumber != ''"> and parking_number = #{parkingNumber}</if>
<if test="countryCode != null and countryCode != ''"> and country_code = #{countryCode}</if>
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
<if test="stationTel != null and stationTel != ''"> and station_tel = #{stationTel}</if>
<if test="serviceTel != null and serviceTel != ''"> and service_tel = #{serviceTel}</if>
<if test="stationType != null and stationType != ''"> and station_type = #{stationType}</if>
<if test="stationStatus != null and stationStatus != ''"> and station_status = #{stationStatus}</if>
<if test="stationAdminName != null and stationAdminName != ''"> and station_admin_name = #{stationAdminName}</if>
<if test="parkNums != null and parkNums != ''"> and park_nums = #{parkNums}</if>
<if test="stationLng != null and stationLng != ''"> and station_lng = #{stationLng}</if>
<if test="stationLat != null and stationLat != ''"> and station_lat = #{stationLat}</if>
<if test="siteGuide != null and siteGuide != ''"> and site_guide = #{siteGuide}</if>
<if test="construction != null and construction != ''"> and construction = #{construction}</if>
<if test="pictures != null and pictures != ''"> and pictures = #{pictures}</if>
<if test="matchCars != null and matchCars != ''"> and match_cars = #{matchCars}</if>
<if test="parkInfo != null and parkInfo != ''"> and park_info = #{parkInfo}</if>
<if test="parkOwner != null and parkOwner != ''"> and park_owner = #{parkOwner}</if>
<if test="parkManager != null and parkManager != ''"> and park_manager = #{parkManager}</if>
<if test="openAllDay != null and openAllDay != ''"> and open_all_day = #{openAllDay}</if>
<if test="businessHours != null and businessHours != ''">
and business_hours = #{businessHours}</if>
<if test="parkFree != null and parkFree != ''"> and park_free = #{parkFree}</if>
<if test="payment != null and payment != ''"> and payment = #{payment}</if>
<if test="supportOrder != null and supportOrder != ''"> and support_order = #{supportOrder}</if>
<if test="publicFlag != null and publicFlag != ''"> and public_flag = #{publicFlag}</if>
<if test="openFlag != null and openFlag != ''"> and open_flag = #{openFlag}</if>
<if test="toiletFlag != null and toiletFlag != ''"> and toilet_flag = #{toiletFlag}</if>
<if test="storeFlag != null and storeFlag != ''"> and store_flag = #{storeFlag}</if>
<if test="restaurantFlag != null and restaurantFlag != ''"> and restaurant_flag = #{restaurantFlag}</if>
<if test="loungeFlag != null and loungeFlag != ''"> and lounge_flag = #{loungeFlag}</if>
<if test="canopyFlag != null and canopyFlag != ''"> and canopy_flag = #{canopyFlag}</if>
<if test="printerFlag != null and printerFlag != ''"> and printer_flag = #{printerFlag}</if>
<if test="barrierFlag != null and barrierFlag != ''"> and barrier_flag = #{barrierFlag}</if>
<if test="parkingLockFlag != null and parkingLockFlag != ''"> and parking_lock_flag = #{parkingLockFlag}</if>
</where>
</select>
<select id="selectPileStationInfoById" parameterType="Long" resultMap="PileStationInfoResult">
<include refid="selectPileStationInfoVo"/>
where id = #{id}
</select>
<insert id="insertPileStationInfo" parameterType="com.jsowell.pile.domain.PileStationInfo">
insert into pile_station_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="merchantId != null">merchant_id,</if>
<if test="stationName != null">station_name,</if>
<if test="deptId != null">dept_id,</if>
<if test="aloneApply != null">alone_apply,</if>
<if test="accountNumber != null">account_number,</if>
<if test="capacity != null">capacity,</if>
<if test="publicParking != null">public_parking,</if>
<if test="parkingNumber != null">parking_number,</if>
<if test="countryCode != null">country_code,</if>
<if test="areaCode != null">area_code,</if>
<if test="address != null">address,</if>
<if test="stationTel != null">station_tel,</if>
<if test="serviceTel != null">service_tel,</if>
<if test="stationType != null">station_type,</if>
<if test="stationStatus != null">station_status,</if>
<if test="stationAdminName != null">station_admin_name,</if>
<if test="parkNums != null">park_nums,</if>
<if test="stationLng != null">station_lng,</if>
<if test="stationLat != null">station_lat,</if>
<if test="siteGuide != null">site_guide,</if>
<if test="construction != null">construction,</if>
<if test="pictures != null">pictures,</if>
<if test="matchCars != null">match_cars,</if>
<if test="parkInfo != null">park_info,</if>
<if test="parkOwner != null">park_owner,</if>
<if test="parkManager != null">park_manager,</if>
<if test="openAllDay != null">open_all_day,</if>
<if test="businessHours != null">business_hours,</if>
<if test="parkFree != null">park_free,</if>
<if test="payment != null">payment,</if>
<if test="supportOrder != null">support_order,</if>
<if test="remark != null">remark,</if>
<if test="publicFlag != null">publicFlag,</if>
<if test="openFlag != null">openFlag,</if>
<if test="toiletFlag != null">toilet_flag,</if>
<if test="storeFlag != null">store_flag,</if>
<if test="restaurantFlag != null">restaurant_flag,</if>
<if test="loungeFlag != null">lounge_flag,</if>
<if test="canopyFlag != null">canopy_flag,</if>
<if test="printerFlag != null">printer_flag,</if>
<if test="barrierFlag != null">barrier_flag,</if>
<if test="parkingLockFlag != null">parking_lock_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="merchantId != null">#{merchantId},</if>
<if test="stationName != null">#{stationName},</if>
<if test="deptId != null">#{deptId},</if>
<if test="aloneApply != null">#{aloneApply},</if>
<if test="accountNumber != null">#{accountNumber},</if>
<if test="capacity != null">#{capacity},</if>
<if test="publicParking != null">#{publicParking},</if>
<if test="parkingNumber != null">#{parkingNumber},</if>
<if test="countryCode != null">#{countryCode},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="address != null">#{address},</if>
<if test="stationTel != null">#{stationTel},</if>
<if test="serviceTel != null">#{serviceTel},</if>
<if test="stationType != null">#{stationType},</if>
<if test="stationStatus != null">#{stationStatus},</if>
<if test="stationAdminName != null">#{stationAdminName},</if>
<if test="parkNums != null">#{parkNums},</if>
<if test="stationLng != null">#{stationLng},</if>
<if test="stationLat != null">#{stationLat},</if>
<if test="siteGuide != null">#{siteGuide},</if>
<if test="construction != null">#{construction},</if>
<if test="pictures != null">#{pictures},</if>
<if test="matchCars != null">#{matchCars},</if>
<if test="parkInfo != null">#{parkInfo},</if>
<if test="parkOwner != null">#{parkOwner},</if>
<if test="parkManager != null">#{parkManager},</if>
<if test="openAllDay != null">#{openAllDay},</if>
<if test="businessHours != null">#{businessHours},</if>
<if test="parkFree != null">#{parkFree},</if>
<if test="payment != null">#{payment},</if>
<if test="supportOrder != null">#{supportOrder},</if>
<if test="remark != null">#{remark},</if>
<if test="publicFlag != null">#{publicFlag},</if>
<if test="openFlag != null">#{openFlag},</if>
<if test="toiletFlag != null">#{toiletFlag},</if>
<if test="storeFlag != null">#{storeFlag},</if>
<if test="restaurantFlag != null">#{restaurantFlag},</if>
<if test="loungeFlag != null">#{loungeFlag},</if>
<if test="canopyFlag != null">#{canopyFlag},</if>
<if test="printerFlag != null">#{printerFlag},</if>
<if test="barrierFlag != null">#{barrierFlag},</if>
<if test="parkingLockFlag != null">#{parkingLockFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updatePileStationInfo" parameterType="com.jsowell.pile.domain.PileStationInfo">
update pile_station_info
<trim prefix="SET" suffixOverrides=",">
<if test="merchantId != null">merchant_id = #{merchantId},</if>
<if test="stationName != null">station_name = #{stationName},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="aloneApply != null">alone_apply = #{aloneApply},</if>
<if test="accountNumber != null">account_number = #{accountNumber},</if>
<if test="capacity != null">capacity = #{capacity},</if>
<if test="publicParking != null">public_parking = #{publicParking},</if>
<if test="parkingNumber != null">parking_number = #{parkingNumber},</if>
<if test="countryCode != null">country_code = #{countryCode},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="address != null">address = #{address},</if>
<if test="stationTel != null">station_tel = #{stationTel},</if>
<if test="serviceTel != null">service_tel = #{serviceTel},</if>
<if test="stationType != null">station_type = #{stationType},</if>
<if test="stationStatus != null">station_status = #{stationStatus},</if>
<if test="stationAdminName != null">station_admin_name = #{stationAdminName},</if>
<if test="parkNums != null">park_nums = #{parkNums},</if>
<if test="stationLng != null">station_lng = #{stationLng},</if>
<if test="stationLat != null">station_lat = #{stationLat},</if>
<if test="siteGuide != null">site_guide = #{siteGuide},</if>
<if test="construction != null">construction = #{construction},</if>
<if test="pictures != null">pictures = #{pictures},</if>
<if test="matchCars != null">match_cars = #{matchCars},</if>
<if test="parkInfo != null">park_info = #{parkInfo},</if>
<if test="parkOwner != null">park_owner = #{parkOwner},</if>
<if test="parkManager != null">park_manager = #{parkManager},</if>
<if test="openAllDay != null">open_all_day = #{openAllDay},</if>
<if test="businessHours != null">business_hours = #{businessHours},</if>
<if test="parkFree != null">park_free = #{parkFree},</if>
<if test="payment != null">payment = #{payment},</if>
<if test="supportOrder != null">support_order = #{supportOrder},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="publicFlag != null">public_flag = #{publicFlag},</if>
<if test="openFlag != null">open_flag = #{openFlag},</if>
<if test="toiletFlag != null">toilet_flag = #{toiletFlag},</if>
<if test="storeFlag != null">store_flag = #{storeFlag},</if>
<if test="restaurantFlag != null">restaurant_flag = #{restaurantFlag},</if>
<if test="loungeFlag != null">lounge_flag = #{loungeFlag},</if>
<if test="canopyFlag != null">canopy_flag = #{canopyFlag},</if>
<if test="printerFlag != null">printer_flag = #{printerFlag},</if>
<if test="barrierFlag != null">barrier_flag = #{barrierFlag},</if>
<if test="parkingLockFlag != null">parking_lock_flag = #{parkingLockFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deletePileStationInfoByIds" parameterType="String">
delete from pile_station_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="queryStationInfos" parameterType="com.jsowell.pile.dto.QueryStationDTO" resultType="com.jsowell.pile.vo.web.PileStationVO">
SELECT
t1.id as id,
t1.station_name as stationName,
count(t2.id) as pileNum,
t1.area_code as areaCode,
t1.address as address,
t1.station_type as stationType,
t1.station_status as stationStatus,
t1.create_time as createTime,
t1.pictures as pictures,
t2.merchant_id as merchantId,
t3.merchant_name as merchantName,
t3.manager_name as merchantAdminName,
t1.station_tel as stationTel,
t1.match_cars as matchCars,
t1.station_lng as stationLng,
t1.station_lat as stationLat,
t1.construction,
t1.business_hours as businessHours,
t3.organization_code as organizationCode,
t1.public_flag as publicFlag,
t1.open_flag as openFlag
FROM
pile_station_info t1
left JOIN pile_basic_info t2 ON t1.id = t2.station_id and t2.del_flag = '0'
left JOIN pile_merchant_info t3 ON t3.id = t1.merchant_id and t3.del_flag = '0'
where
t1.del_flag = '0'
<if test="stationDTO.stationName != null and stationDTO.stationName != ''">
and t1.station_name LIKE '%${stationDTO.stationName}%'
</if>
<if test="stationDTO.publicFlag != null and stationDTO.publicFlag != ''">
and t1.public_flag = #{stationDTO.publicFlag,jdbcType=VARCHAR}
</if>
<!-- 数据范围过滤 -->
${stationDTO.params.dataScope}
GROUP BY
t1.id,
t1.station_name,
t1.area_code,
t1.address,
t1.station_type,
t1.station_status,
t1.create_time,
t1.pictures,
t2.merchant_id,
t3.merchant_name,
t3.manager_name,
t1.station_tel,
t1.match_cars,
t1.station_lng,
t1.station_lat,
t1.construction,
t1.business_hours,
t3.organization_code,
t1.public_flag,
t1.open_flag
</select>
<select id="selectStationListByMerchantId" resultMap="PileStationInfoResult">
<include refid="selectPileStationInfoVo"/>
where merchant_id = #{merchantId}
and del_flag = '0'
</select>
</mapper>

View File

@@ -0,0 +1,263 @@
<?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.jsowell.pile.mapper.WxpayCallbackRecordMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.WxpayCallbackRecord">
<!--@mbg.generated-->
<!--@Table wxpay_callback_record-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="pay_scenario" jdbcType="VARCHAR" property="payScenario" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="out_trade_no" jdbcType="VARCHAR" property="outTradeNo" />
<result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
<result column="mch_id" jdbcType="VARCHAR" property="mchId" />
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="trade_type" jdbcType="VARCHAR" property="tradeType" />
<result column="trade_state" jdbcType="VARCHAR" property="tradeState" />
<result column="trade_state_desc" jdbcType="VARCHAR" property="tradeStateDesc" />
<result column="bank_type" jdbcType="VARCHAR" property="bankType" />
<result column="attach" jdbcType="VARCHAR" property="attach" />
<result column="success_time" jdbcType="TIMESTAMP" property="successTime" />
<result column="payer_open_id" jdbcType="VARCHAR" property="payerOpenId" />
<result column="payer_total" jdbcType="VARCHAR" property="payerTotal" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, pay_scenario, member_id, order_code, out_trade_no, transaction_id, mch_id, app_id, trade_type,
trade_state, trade_state_desc, bank_type, attach, success_time, payer_open_id, payer_total,
create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from wxpay_callback_record
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from wxpay_callback_record
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.WxpayCallbackRecord" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into wxpay_callback_record (pay_scenario, member_id, order_code, out_trade_no,
transaction_id, mch_id, app_id,
trade_type, trade_state, trade_state_desc,
bank_type, attach, success_time,
payer_open_id, payer_total, create_time
)
values (#{payScenario,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR}, #{outTradeNo,jdbcType=VARCHAR},
#{transactionId,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR},
#{tradeType,jdbcType=VARCHAR}, #{tradeState,jdbcType=VARCHAR}, #{tradeStateDesc,jdbcType=VARCHAR},
#{bankType,jdbcType=VARCHAR}, #{attach,jdbcType=VARCHAR}, #{successTime,jdbcType=TIMESTAMP},
#{payerOpenId,jdbcType=VARCHAR}, #{payerTotal,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.WxpayCallbackRecord" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into wxpay_callback_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="payScenario != null">
pay_scenario,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="orderCode != null and orderCode != ''">
order_code,
</if>
<if test="outTradeNo != null and outTradeNo != ''">
out_trade_no,
</if>
<if test="transactionId != null">
transaction_id,
</if>
<if test="mchId != null">
mch_id,
</if>
<if test="appId != null">
app_id,
</if>
<if test="tradeType != null and tradeType != ''">
trade_type,
</if>
<if test="tradeState != null and tradeState != ''">
trade_state,
</if>
<if test="tradeStateDesc != null and tradeStateDesc != ''">
trade_state_desc,
</if>
<if test="bankType != null and bankType != ''">
bank_type,
</if>
<if test="attach != null and attach != ''">
attach,
</if>
<if test="successTime != null">
success_time,
</if>
<if test="payerOpenId != null and payerOpenId != ''">
payer_open_id,
</if>
<if test="payerTotal != null and payerTotal != ''">
payer_total,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="payScenario != null">
#{payScenario,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="orderCode != null and orderCode != ''">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="outTradeNo != null and outTradeNo != ''">
#{outTradeNo,jdbcType=VARCHAR},
</if>
<if test="transactionId != null">
#{transactionId,jdbcType=VARCHAR},
</if>
<if test="mchId != null">
#{mchId,jdbcType=VARCHAR},
</if>
<if test="appId != null">
#{appId,jdbcType=VARCHAR},
</if>
<if test="tradeType != null and tradeType != ''">
#{tradeType,jdbcType=VARCHAR},
</if>
<if test="tradeState != null and tradeState != ''">
#{tradeState,jdbcType=VARCHAR},
</if>
<if test="tradeStateDesc != null and tradeStateDesc != ''">
#{tradeStateDesc,jdbcType=VARCHAR},
</if>
<if test="bankType != null and bankType != ''">
#{bankType,jdbcType=VARCHAR},
</if>
<if test="attach != null and attach != ''">
#{attach,jdbcType=VARCHAR},
</if>
<if test="successTime != null">
#{successTime,jdbcType=TIMESTAMP},
</if>
<if test="payerOpenId != null and payerOpenId != ''">
#{payerOpenId,jdbcType=VARCHAR},
</if>
<if test="payerTotal != null and payerTotal != ''">
#{payerTotal,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.WxpayCallbackRecord">
<!--@mbg.generated-->
update wxpay_callback_record
<set>
<if test="payScenario != null">
pay_scenario = #{payScenario,jdbcType=VARCHAR},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="orderCode != null and orderCode != ''">
order_code = #{orderCode,jdbcType=VARCHAR},
</if>
<if test="outTradeNo != null and outTradeNo != ''">
out_trade_no = #{outTradeNo,jdbcType=VARCHAR},
</if>
<if test="transactionId != null">
transaction_id = #{transactionId,jdbcType=VARCHAR},
</if>
<if test="mchId != null">
mch_id = #{mchId,jdbcType=VARCHAR},
</if>
<if test="appId != null">
app_id = #{appId,jdbcType=VARCHAR},
</if>
<if test="tradeType != null and tradeType != ''">
trade_type = #{tradeType,jdbcType=VARCHAR},
</if>
<if test="tradeState != null and tradeState != ''">
trade_state = #{tradeState,jdbcType=VARCHAR},
</if>
<if test="tradeStateDesc != null and tradeStateDesc != ''">
trade_state_desc = #{tradeStateDesc,jdbcType=VARCHAR},
</if>
<if test="bankType != null and bankType != ''">
bank_type = #{bankType,jdbcType=VARCHAR},
</if>
<if test="attach != null and attach != ''">
attach = #{attach,jdbcType=VARCHAR},
</if>
<if test="successTime != null">
success_time = #{successTime,jdbcType=TIMESTAMP},
</if>
<if test="payerOpenId != null and payerOpenId != ''">
payer_open_id = #{payerOpenId,jdbcType=VARCHAR},
</if>
<if test="payerTotal != null and payerTotal != ''">
payer_total = #{payerTotal,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.WxpayCallbackRecord">
<!--@mbg.generated-->
update wxpay_callback_record
set
pay_scenario = #{payScenario,jdbcType=VARCHAR},
member_id = #{memberId,jdbcType=VARCHAR},
order_code = #{orderCode,jdbcType=VARCHAR},
out_trade_no = #{outTradeNo,jdbcType=VARCHAR},
transaction_id = #{transactionId,jdbcType=VARCHAR},
mch_id = #{mchId,jdbcType=VARCHAR},
app_id = #{appId,jdbcType=VARCHAR},
trade_type = #{tradeType,jdbcType=VARCHAR},
trade_state = #{tradeState,jdbcType=VARCHAR},
trade_state_desc = #{tradeStateDesc,jdbcType=VARCHAR},
bank_type = #{bankType,jdbcType=VARCHAR},
attach = #{attach,jdbcType=VARCHAR},
success_time = #{successTime,jdbcType=TIMESTAMP},
payer_open_id = #{payerOpenId,jdbcType=VARCHAR},
payer_total = #{payerTotal,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByOrderCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from wxpay_callback_record
where del_flag = '0' and order_code = #{orderCode,jdbcType=VARCHAR}
</select>
<select id="selectBalanceRechargeRecord" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from wxpay_callback_record
where pay_scenario = 'balance'
and member_id = #{memberId,jdbcType=VARCHAR}
and success_time >= #{date,jdbcType=TIMESTAMP}
order by success_time DESC
</select>
<select id="selectByOutTradeNo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from wxpay_callback_record
where out_trade_no = #{outTradeNo,jdbcType=VARCHAR}
</select>
</mapper>

View File

@@ -0,0 +1,227 @@
<?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.jsowell.pile.mapper.WxpayRefundCallbackMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.WxpayRefundCallback">
<!--@mbg.generated-->
<!--@Table wxpay_refund_callback-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="order_code" jdbcType="VARCHAR" property="orderCode" />
<result column="out_trade_no" jdbcType="VARCHAR" property="outTradeNo" />
<result column="out_refund_no" jdbcType="VARCHAR" property="outRefundNo" />
<result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
<result column="mch_id" jdbcType="VARCHAR" property="mchId" />
<result column="refund_id" jdbcType="VARCHAR" property="refundId" />
<result column="refund_status" jdbcType="VARCHAR" property="refundStatus" />
<result column="success_time" jdbcType="VARCHAR" property="successTime" />
<result column="user_received_account" jdbcType="VARCHAR" property="userReceivedAccount" />
<result column="payer_total" jdbcType="VARCHAR" property="payerTotal" />
<result column="payer_refund" jdbcType="VARCHAR" property="payerRefund" />
<result column="amount_total" jdbcType="VARCHAR" property="amountTotal" />
<result column="amount_refund" jdbcType="VARCHAR" property="amountRefund" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, member_id, order_code, out_trade_no, out_refund_no, transaction_id, mch_id, refund_id,
refund_status, success_time, user_received_account, payer_total, payer_refund, amount_total,
amount_refund, create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from wxpay_refund_callback
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from wxpay_refund_callback
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.WxpayRefundCallback" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into wxpay_refund_callback (member_id, order_code, out_trade_no,
out_refund_no, transaction_id, mch_id,
refund_id, refund_status, success_time,
user_received_account, payer_total, payer_refund,
amount_total, amount_refund, create_time
)
values (#{memberId,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR}, #{outTradeNo,jdbcType=VARCHAR},
#{outRefundNo,jdbcType=VARCHAR}, #{transactionId,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR},
#{refundId,jdbcType=VARCHAR}, #{refundStatus,jdbcType=VARCHAR}, #{successTime,jdbcType=VARCHAR},
#{userReceivedAccount,jdbcType=VARCHAR}, #{payerTotal,jdbcType=VARCHAR}, #{payerRefund,jdbcType=VARCHAR},
#{amountTotal,jdbcType=VARCHAR}, #{amountRefund,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.WxpayRefundCallback" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into wxpay_refund_callback
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="memberId != null and memberId != ''">
member_id,
</if>
<if test="orderCode != null and orderCode != ''">
order_code,
</if>
<if test="outTradeNo != null and outTradeNo != ''">
out_trade_no,
</if>
<if test="outRefundNo != null and outRefundNo != ''">
out_refund_no,
</if>
<if test="transactionId != null and transactionId != ''">
transaction_id,
</if>
<if test="mchId != null and mchId != ''">
mch_id,
</if>
<if test="refundId != null and refundId != ''">
refund_id,
</if>
<if test="refundStatus != null and refundStatus != ''">
refund_status,
</if>
<if test="successTime != null and successTime != ''">
success_time,
</if>
<if test="userReceivedAccount != null and userReceivedAccount != ''">
user_received_account,
</if>
<if test="payerTotal != null and payerTotal != ''">
payer_total,
</if>
<if test="payerRefund != null and payerRefund != ''">
payer_refund,
</if>
<if test="amountTotal != null and amountTotal != ''">
amount_total,
</if>
<if test="amountRefund != null and amountRefund != ''">
amount_refund,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="memberId != null and memberId != ''">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="orderCode != null and orderCode != ''">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="outTradeNo != null and outTradeNo != ''">
#{outTradeNo,jdbcType=VARCHAR},
</if>
<if test="outRefundNo != null and outRefundNo != ''">
#{outRefundNo,jdbcType=VARCHAR},
</if>
<if test="transactionId != null and transactionId != ''">
#{transactionId,jdbcType=VARCHAR},
</if>
<if test="mchId != null and mchId != ''">
#{mchId,jdbcType=VARCHAR},
</if>
<if test="refundId != null and refundId != ''">
#{refundId,jdbcType=VARCHAR},
</if>
<if test="refundStatus != null and refundStatus != ''">
#{refundStatus,jdbcType=VARCHAR},
</if>
<if test="successTime != null and successTime != ''">
#{successTime,jdbcType=VARCHAR},
</if>
<if test="userReceivedAccount != null and userReceivedAccount != ''">
#{userReceivedAccount,jdbcType=VARCHAR},
</if>
<if test="payerTotal != null and payerTotal != ''">
#{payerTotal,jdbcType=VARCHAR},
</if>
<if test="payerRefund != null and payerRefund != ''">
#{payerRefund,jdbcType=VARCHAR},
</if>
<if test="amountTotal != null and amountTotal != ''">
#{amountTotal,jdbcType=VARCHAR},
</if>
<if test="amountRefund != null and amountRefund != ''">
#{amountRefund,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.WxpayRefundCallback">
<!--@mbg.generated-->
update wxpay_refund_callback
<set>
<if test="memberId != null and memberId != ''">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="orderCode != null and orderCode != ''">
order_code = #{orderCode,jdbcType=VARCHAR},
</if>
<if test="outTradeNo != null and outTradeNo != ''">
out_trade_no = #{outTradeNo,jdbcType=VARCHAR},
</if>
<if test="outRefundNo != null and outRefundNo != ''">
out_refund_no = #{outRefundNo,jdbcType=VARCHAR},
</if>
<if test="transactionId != null and transactionId != ''">
transaction_id = #{transactionId,jdbcType=VARCHAR},
</if>
<if test="mchId != null and mchId != ''">
mch_id = #{mchId,jdbcType=VARCHAR},
</if>
<if test="refundId != null and refundId != ''">
refund_id = #{refundId,jdbcType=VARCHAR},
</if>
<if test="refundStatus != null and refundStatus != ''">
refund_status = #{refundStatus,jdbcType=VARCHAR},
</if>
<if test="successTime != null and successTime != ''">
success_time = #{successTime,jdbcType=VARCHAR},
</if>
<if test="userReceivedAccount != null and userReceivedAccount != ''">
user_received_account = #{userReceivedAccount,jdbcType=VARCHAR},
</if>
<if test="payerTotal != null and payerTotal != ''">
payer_total = #{payerTotal,jdbcType=VARCHAR},
</if>
<if test="payerRefund != null and payerRefund != ''">
payer_refund = #{payerRefund,jdbcType=VARCHAR},
</if>
<if test="amountTotal != null and amountTotal != ''">
amount_total = #{amountTotal,jdbcType=VARCHAR},
</if>
<if test="amountRefund != null and amountRefund != ''">
amount_refund = #{amountRefund,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.WxpayRefundCallback">
<!--@mbg.generated-->
update wxpay_refund_callback
set member_id = #{memberId,jdbcType=VARCHAR},
order_code = #{orderCode,jdbcType=VARCHAR},
out_trade_no = #{outTradeNo,jdbcType=VARCHAR},
out_refund_no = #{outRefundNo,jdbcType=VARCHAR},
transaction_id = #{transactionId,jdbcType=VARCHAR},
mch_id = #{mchId,jdbcType=VARCHAR},
refund_id = #{refundId,jdbcType=VARCHAR},
refund_status = #{refundStatus,jdbcType=VARCHAR},
success_time = #{successTime,jdbcType=VARCHAR},
user_received_account = #{userReceivedAccount,jdbcType=VARCHAR},
payer_total = #{payerTotal,jdbcType=VARCHAR},
payer_refund = #{payerRefund,jdbcType=VARCHAR},
amount_total = #{amountTotal,jdbcType=VARCHAR},
amount_refund = #{amountRefund,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>