去掉Mapper.xml中多余的代码

This commit is contained in:
wen 2022-01-04 09:58:26 +08:00
parent 3d195c041b
commit 1137c1782e
2 changed files with 0 additions and 1176 deletions

View File

@ -63,860 +63,9 @@
from xhpc_charging_station
</sql>
<select id="selectXhpcChargingStationList" resultType="java.util.Map">
select
cs.charging_station_id as chargingStationId,
cs.name as name,
ope.name as operatorName,
cs.address as address,
(select url from xhpc_img where img_id = cs.img_id and del_flag =0 limit 1) as url,
cs.client_visible as clientVisible,
cs.status as status
from xhpc_charging_station as cs
left join xhpc_operator as ope on cs.operator_id = ope.operator_id
where cs.del_flag =0
<if test="name !=null and name !=''">
and cs.name like CONCAT('%',#{name},'%')
</if>
<if test="operatorName !=null and operatorName !=''">
and ope.name like CONCAT('%',#{operatorName},'%')
</if>
<if test="type ==1">
and cs.charging_station_id in(select charging_station_id from xhpc_charging_station where
operator_id=#{operatorId})
</if>
<if test="type ==2">
and cs.charging_station_id in(select charging_station_id from xhpc_user_privilege where
user_id=#{operatorId})
</if>
</select>
<select id="selectXhpcChargingStationById" resultMap="BaseResultMap">
<include refid="selectXhpcChargingStationVo"/>
where charging_station_id = #{chargingStationId}
</select>
<select id="selectXhpcChargingStationByName" resultMap="BaseResultMap">
<include refid="selectXhpcChargingStationVo"/>
where name = #{chargingStationName}
</select>
<insert id="insertXhpcChargingStation" parameterType="com.xhpc.common.domain.XhpcChargingStation">
insert into xhpc_charging_station
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="chargingStationId != null">charging_station_id,</if>
<if test="name != null">name,</if>
<if test="operatorId != null">operator_id,</if>
<if test="type != null">type,</if>
<if test="constructionSite != null">construction_site,</if>
<if test="serviceFacilities != null">service_facilities,</if>
<if test="peripheryFacilities != null">periphery_facilities,</if>
<if test="areaCode != null">area_code,</if>
<if test="address != null">address,</if>
<if test="detailedAddress != null">detailed_address,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="parkingInstructions != null">parking_instructions,</if>
<if test="serialNumber != null">serial_number,</if>
<if test="clientVisible != null">client_visible,</if>
<if test="status != null">status,</if>
<if test="delFlag != null">del_flag,</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>
<if test="remark != null">remark,</if>
<if test="rateModelId != null">rate_model_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="chargingStationId != null">#{chargingStationId},</if>
<if test="name != null">#{name},</if>
<if test="operatorId != null">#{operatorId},</if>
<if test="type != null">#{type},</if>
<if test="constructionSite != null">#{constructionSite},</if>
<if test="serviceFacilities != null">#{serviceFacilities},</if>
<if test="peripheryFacilities != null">#{peripheryFacilities},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="address != null">#{address},</if>
<if test="detailedAddress != null">#{detailedAddress},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="parkingInstructions != null">#{parkingInstructions},</if>
<if test="serialNumber != null">#{serialNumber},</if>
<if test="clientVisible != null">#{clientVisible},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null">#{delFlag},</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>
<if test="remark != null">#{remark},</if>
<if test="rateModelId != null">#{rateModelId},</if>
</trim>
</insert>
<update id="updateXhpcChargingStation" parameterType="com.xhpc.common.domain.XhpcChargingStation">
update xhpc_charging_station
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="operatorId != null">operator_id = #{operatorId},</if>
<if test="type != null">type = #{type},</if>
<if test="constructionSite != null">construction_site = #{constructionSite},</if>
<if test="serviceFacilities != null">service_facilities = #{serviceFacilities},</if>
<if test="peripheryFacilities != null">periphery_facilities = #{peripheryFacilities},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="address != null">address = #{address},</if>
<if test="detailedAddress != null">detailed_address = #{detailedAddress},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="parkingInstructions != null">parking_instructions = #{parkingInstructions},</if>
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
<if test="clientVisible != null">client_visible = #{clientVisible},</if>
<if test="status != null">status = #{status},</if>
<if test="delFlag != null">del_flag = #{delFlag},</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="remark != null">remark = #{remark},</if>
<if test="rateModelId != null">rate_model_id = #{rateModelId},</if>
<if test="businessInstructions != null">business_instructions = #{businessInstructions},</if>
<if test="reminderInstructions != null">reminder_instructions = #{reminderInstructions},</if>
<if test="imgId != null">img_id = #{imgId},</if>
<if test="stationType != null">station_type = #{stationType},</if>
<if test="operatorIdEvcs != null">operator_id_evcs = #{operatorIdEvcs},</if>
<if test="serviceTel != null">service_tel = #{serviceTel},</if>
<if test="parkNums != null">park_nums = #{parkNums}</if>
</trim>
where charging_station_id = #{chargingStationId}
</update>
<update id="updateXhpcChargingStationById" parameterType="Long">
update xhpc_charging_station
set del_flag =1
where charging_station_id = #{chargingStationId}
</update>
<update id="updateXhpcChargingStationByIds" parameterType="java.lang.String">
update xhpc_charging_station set del_flag =1 where charging_station_id in
<foreach item="chargingStationId" collection="array" open="(" separator="," close=")">
#{chargingStationId}
</foreach>
</update>
<update id="status">
update xhpc_charging_station
set status =#{status}
where charging_station_id = #{chargingStationId}
and del_flag = 0
</update>
<update id="clientVisible">
update xhpc_charging_station
set client_visible =#{clientVisible}
where charging_station_id = #{chargingStationId}
and del_flag = 0
</update>
<select id="stationInternetBlackList" resultType="java.util.Map">
select name
from xhpc_internet_user
where del_flag = 0
and internet_user_id not in (select internet_user_id
from xhpc_station_internet_blacklist
where charging_station_id = #{chargingStationId})
</select>
<select id="getXhpcChargingStationMessage" resultType="java.util.Map">
select ct.charging_station_id as chargingStationId,
ct.name as name,
ct.operator_id as operatorId,
ct.operator_id_evcs as operatorIdEvcs,
ct.station_type as stationType,
op.name as operatorName,
ct.type as type,
(select dict_value
from xhpc_dict_biz
where code = 'charging_station_type'
and dict_key = ct.station_type) as stationTypeName,
ct.serial_number as serialNumber,
ct.construction_site as constructionSite,
(select dict_value
from xhpc_dict_biz
where code = 'charging_construction_site'
and dict_key = ct.construction_site) as constructionSiteName,
ct.address as address,
ct.remark as remark,
ct.detailed_address as detailedAddress,
ct.periphery_facilities as peripheryFacilities,
ct.service_facilities as serviceFacilities,
ct.parking_instructions as parkingInstructions,
ct.business_instructions as businessInstructions,
ct.reminder_instructions as reminderInstructions,
ct.client_visible as clientVisible,
ct.img_id as imgId,
ct.service_tel as serviceTel,
ct.park_nums as parkNums,
GROUP_CONCAT(DISTINCT xdbs.dict_value ORDER BY xdbs.create_time ASC separator ',' ) serviceFacilitiesName,
GROUP_CONCAT(DISTINCT xdbp.dict_value ORDER BY xdbp.create_time ASC separator ',' ) peripheryFacilitiesName
from xhpc_charging_station as ct
left join xhpc_operator as op on op.operator_id = ct.operator_id
left JOIN xhpc_dict_biz as xdbs on xdbs.code = 'service_facilities' and xdbs.dict_key !=-1 and xdbs.del_flag=0
left JOIN xhpc_dict_biz as xdbp
on xdbp.code='charging_periphery_facilities' and xdbp.dict_key !=-1 and xdbp.del_flag=0
where ct.charging_station_id = #{chargingStationId}
and ct.del_flag = 0
</select>
<select id="getWXList" resultType="map">
select
cs.charging_station_id as chargingStationId,
cs.name as name,
cs.longitude as longitude,
cs.latitude as latitude,
cs.parking_instructions as parkingInstructions,
cs.detailed_address as detailedAddress,
cs.service_facilities as serviceFacilities,
(select count(terminal_id) from xhpc_terminal where status=0 and del_flag =0 and
charging_station_id=cs.charging_station_id) as common,
(select GROUP_CONCAT(serial_number) from xhpc_terminal where status=0 and del_flag =0 and
charging_station_id=cs.charging_station_id) as serialNumbers,
(select (ra.power_fee+ra.service_fee) as serviceFee
from xhpc_rate as ra
where ra.status = 0
and ra.del_flag = 0
and ra.rate_id = (
select rate_id from xhpc_rate_time
where charging_station_id = cs.charging_station_id
and cs.rate_model_id = rate_model_id
and start_time &lt;= #{date}
and replace(end_time, '00:00:00', '24:00:00') &gt;= #{date}
and status = 0
and del_flag = 0)) money,
(select GROUP_CONCAT(dict_value) from xhpc_dict_biz where FIND_IN_SET(dict_key,cs.service_facilities ) and code
= 'service_facilities' and parent_id > 0 and del_flag = 0) as serviceFacilitiesName,
ROUND(ACOS(SIN((#{latitude} * 3.141593) / 180 ) *SIN((cs.latitude * 3.141593) / 180 ) +
COS((#{latitude} * 3.141593) / 180 ) * COS((cs.latitude * 3.141593) / 180 ) *
COS((#{longitude} * 3.141593) / 180 - (cs.longitude * 3.141593) / 180 ) ) * 6370.9968,2)AS distance
from xhpc_charging_station as cs
where cs.del_flag =0 and cs.status =0
and FIND_IN_SET(#{clientVisible},cs.client_visible)>0
<if test="name !=null and name !=''">
and cs.name like CONCAT('%',#{name},'%')
</if>
<if test="serviceFacilities !=null and serviceFacilities.size()>0 ">
and
<foreach collection="serviceFacilities" item="item" index="index" open="(" close=")" separator="or">
cs.service_facilities like CONCAT('%',#{item},'%')
</foreach>
</if>
<if test="code !=null and code !=''">
and cs.area_code in (select code from xhpc_area where pcode=#{code}) or cs.area_code=#{code}
</if>
ORDER BY distance asc
</select>
<select id="getCode" resultType="java.util.Map">
select code, dict_key, dict_value
from xhpc_dict_biz
where code = #{code} and parent_id > 0 and del_flag = 0
<if test="serviceFacilities !=null and serviceFacilities.size()>0 ">
and
<foreach collection="serviceFacilities" item="item" index="index" open="(" close=")" separator="or">
dict_biz_id like CONCAT('%',#{item},'%')
</foreach>
</if>
</select>
<select id="getWXXhpcChargingStationMessage" resultType="java.util.Map">
select charging_station_id as chargingStationId,
longitude,
latitude,
(select type
from xhpc_charging_pile
where charging_station_id = charging_station_id
and del_flag = 0
and status = 0 limit 1) as type,
(select count(terminal_id) from xhpc_terminal where status=0 and del_flag =0 and charging_station_id=#{chargingStationId}) as common,
(select GROUP_CONCAT(serial_number) from xhpc_terminal where status=0 and del_flag =0 and charging_station_id=charging_station_id) as serialNumbers,
(select GROUP_CONCAT(dict_value) from xhpc_dict_biz where FIND_IN_SET(dict_key, service_facilities ) and code= 'service_facilities' and parent_id > 0 and del_flag = 0) as serviceFacilitiesName,
name as name,
reminder_instructions as reminderInstructions,
detailed_address as detailedAddress,
parking_instructions as parkingInstructions,
business_instructions as businessInstructions,
service_facilities as serviceFacilities,
img_id as imgId,
remark as remark,
ROUND(ACOS(SIN((
#{latitude} * 3.141593) / 180) * SIN((latitude * 3.141593) / 180) + COS((#{latitude} * 3.141593) / 180) * COS((latitude * 3.141593) / 180) * COS((#{longitude} * 3.141593) / 180 - (longitude * 3.141593) / 180)) * 6370.9968,
2) AS distance
from xhpc_charging_station
where charging_station_id = #{chargingStationId}
and del_flag = 0
and status = 0
</select>
<select id="getImageList" resultType="java.util.Map">
select
img_id as imgId,
url as url
from xhpc_img where del_flag=0 and status=0
<if test="imgIds !=null and imgIds.size()>0 ">
and img_id in
<foreach collection="imgIds" item="chargingStationId" open="(" separator="," close=")">
#{chargingStationId}
</foreach>
</if>
</select>
<select id="getWXXhpcRateTimeMassage" resultType="java.util.Map">
select xrt.start_time as startTime,
xrt.end_time as endTime,
xr.power_fee as powerFee,
xr.service_fee as serviceFee
from xhpc_rate_time as xrt
left join xhpc_rate as xr on xr.rate_id = xrt.rate_id
where xrt.charging_station_id = #{chargingStationId}
and xrt.status = 0
and xrt.del_flag = 0
order by xrt.sort asc
</select>
<select id="getWXXhpcTerminalMassage" resultType="java.util.Map">
select te.name as name,
cp.power as power,
cp.auxiliary_power_supply as auxiliaryPowerSupply,
te.serial_number as serialNumber,
cp.input_voltage as inputVoltage
from xhpc_terminal as te
left join xhpc_charging_pile as cp on cp.charging_pile_id = te.charging_pile_id
where te.charging_station_id = #{chargingStationId}
and te.status = 0
and te.del_flag = 0
</select>
<insert id="addXhpcRateModel" parameterType="com.xhpc.common.domain.XhpcRateModel" useGeneratedKeys="true"
keyProperty="rateModelId">
insert into xhpc_rate_model
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != status ">
status,
</if>
<if test="null != delFlag ">
del_flag,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != remark and '' != remark">
remark
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != status ">
#{status},
</if>
<if test="null != delFlag ">
#{delFlag},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark}
</if>
</trim>
</insert>
<insert id="addXhpcChargingStation" parameterType="com.xhpc.common.domain.XhpcChargingStation"
useGeneratedKeys="true" keyProperty="chargingStationId">
insert into xhpc_charging_station
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != name and '' != name">
name,
</if>
<if test="null != operatorId ">
operator_id,
</if>
<if test="null != type ">
type,
</if>
<if test="null != constructionSite and '' != constructionSite">
construction_site,
</if>
<if test="null != serviceFacilities and '' != serviceFacilities">
service_facilities,
</if>
<if test="null != peripheryFacilities and '' != peripheryFacilities">
periphery_facilities,
</if>
<if test="null != areaCode ">
area_code,
</if>
<if test="null != address and '' != address">
address,
</if>
<if test="null != detailedAddress and '' != detailedAddress">
detailed_address,
</if>
<if test="null != longitude and '' != longitude">
longitude,
</if>
<if test="null != latitude and '' != latitude">
latitude,
</if>
<if test="null != parkingInstructions and '' != parkingInstructions">
parking_instructions,
</if>
<if test="null != serialNumber and '' != serialNumber">
serial_number,
</if>
<if test="null != clientVisible and '' != clientVisible">
client_visible,
</if>
<if test="null != rateModelId and '' != rateModelId">
rate_model_id,
</if>
<if test="null != imgId and '' != imgId">
img_id,
</if>
<if test="null != businessInstructions and '' != businessInstructions">
business_instructions,
</if>
<if test="null != reminderInstructions and '' != reminderInstructions">
reminder_instructions,
</if>
<if test="null != status ">
status,
</if>
<if test="null != delFlag ">
del_flag,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != remark and '' != remark">
remark,
</if>
<if test="null != stationType">
station_type,
</if>
<if test="null != operatorIdEvcs and '' != operatorIdEvcs">
operator_id_evcs,
</if>
<if test="null != serviceTel and '' != serviceTel">
service_tel,
</if>
<if test="null != parkNums and '' != parkNums">
park_nums
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != name and '' != name">
#{name},
</if>
<if test="null != operatorId ">
#{operatorId},
</if>
<if test="null != type ">
#{type},
</if>
<if test="null != constructionSite and '' != constructionSite">
#{constructionSite},
</if>
<if test="null != serviceFacilities and '' != serviceFacilities">
#{serviceFacilities},
</if>
<if test="null != peripheryFacilities and '' != peripheryFacilities">
#{peripheryFacilities},
</if>
<if test="null != areaCode ">
#{areaCode},
</if>
<if test="null != address and '' != address">
#{address},
</if>
<if test="null != detailedAddress and '' != detailedAddress">
#{detailedAddress},
</if>
<if test="null != longitude and '' != longitude">
#{longitude},
</if>
<if test="null != latitude and '' != latitude">
#{latitude},
</if>
<if test="null != parkingInstructions and '' != parkingInstructions">
#{parkingInstructions},
</if>
<if test="null != serialNumber and '' != serialNumber">
#{serialNumber},
</if>
<if test="null != clientVisible and '' != clientVisible">
#{clientVisible},
</if>
<if test="null != rateModelId and '' != rateModelId">
#{rateModelId},
</if>
<if test="null != imgId and '' != imgId">
#{imgId},
</if>
<if test="null != businessInstructions and '' != businessInstructions">
#{businessInstructions},
</if>
<if test="null != reminderInstructions and '' != reminderInstructions">
#{reminderInstructions},
</if>
<if test="null != status ">
#{status},
</if>
<if test="null != delFlag ">
#{delFlag},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark},
</if>
<if test="null != stationType">
#{stationType},
</if>
<if test="null != operatorIdEvcs and '' != operatorIdEvcs">
#{operatorIdEvcs},
</if>
<if test="null != serviceTel and '' != serviceTel">
#{serviceTel},
</if>
<if test="null != parkNums and '' != parkNums">
#{parkNums}
</if>
</trim>
</insert>
<insert id="addXhpcRate" parameterType="com.xhpc.common.domain.XhpcRate" useGeneratedKeys="true"
keyProperty="rateId">
insert into xhpc_rate
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != chargingStationId ">
charging_station_id,
</if>
<if test="null != powerFee ">
power_fee,
</if>
<if test="null != serviceFee ">
service_fee,
</if>
<if test="null != name and '' != name">
name,
</if>
<if test="null != delFlag ">
del_flag,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != remark and '' != remark">
remark,
</if>
<if test="null != rateValue">
rate_value,
</if>
<if test="null != rateModelId">
rate_model_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != chargingStationId ">
#{chargingStationId},
</if>
<if test="null != powerFee ">
#{powerFee},
</if>
<if test="null != serviceFee ">
#{serviceFee},
</if>
<if test="null != name and '' != name">
#{name},
</if>
<if test="null != status ">
#{status},
</if>
<if test="null != delFlag ">
#{delFlag},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark},
</if>
<if test="null != rateValue">
#{rateValue},
</if>
<if test="null != rateModelId">
#{rateModelId}
</if>
</trim>
</insert>
<insert id="addXhpcRateTime" parameterType="com.xhpc.common.domain.XhpcRateTime" useGeneratedKeys="true"
keyProperty="rateId">
insert into xhpc_rate_time
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != chargingStationId ">
charging_station_id,
</if>
<if test="null != rateId ">
rate_id,
</if>
<if test="null != startTime ">
start_time,
</if>
<if test="null != endTime ">
end_time,
</if>
<if test="null != rateModelId ">
rate_model_id,
</if>
<if test="null != sort ">
sort,
</if>
<if test="null != status ">
status,
</if>
<if test="null != delFlag ">
del_flag,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != remark and '' != remark">
remark,
</if>
<if test="null != type ">
type,
</if>
<if test="null != rateValue ">
rate_value
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != chargingStationId ">
#{chargingStationId},
</if>
<if test="null != rateId ">
#{rateId},
</if>
<if test="null != startTime ">
#{startTime},
</if>
<if test="null != endTime ">
#{endTime},
</if>
<if test="null != rateModelId ">
#{rateModelId},
</if>
<if test="null != sort ">
#{sort},
</if>
<if test="null != status ">
#{status},
</if>
<if test="null != delFlag ">
#{delFlag},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark},
</if>
<if test="null != type ">
#{type},
</if>
<if test="null != rateValue ">
#{rateValue}
</if>
</trim>
</insert>
<select id="getXhpcRateList" resultType="java.util.Map">
select power_fee as powerFee,
service_fee as serviceFee,
name as name,
rate_value as id
from xhpc_rate
where charging_station_id = #{chargingStationId}
and del_flag = 0
GROUP BY rate_value
</select>
<select id="getXhpcRateTimeTypeList" resultType="java.util.Map">
select rt.start_time as startTime,
replace(rt.end_time, '00:00:00', '24:00:00') AS endTime,
rt.rate_id as rateId,
rt.rate_value as id,
ra.name as rateName,
ra.power_fee as powerFee,
ra.service_fee as serviceFee
from xhpc_rate_time as rt
left join xhpc_rate as ra on ra.rate_id = rt.rate_id
where rt.charging_station_id = #{chargingStationId}
and rt.del_flag = 0
</select>
<select id="getXhpcRateTimeOrderStatistics" resultType="java.util.Map">
select IF(SUM(total_power) IS NULL, 0, SUM(total_power)) as chargingDegreeSum,
COUNT(history_order_id) as realTimeOrderIdCount,
COUNT(DISTINCT user_id) as userIdCount
from xhpc_history_order
where charging_station_id = #{chargingStationId}
and create_time &gt;= #{createTime}
</select>
<update id="updateXhpcRate">
update xhpc_rate
set del_flag =1
where charging_station_id = #{chargingStationId}
and del_flag = 0
</update>
<update id="updateXhpcRateTime">
update xhpc_rate_time
set del_flag =1
where charging_station_id = #{chargingStationId}
and del_flag = 0
</update>
<select id="getXchargingPileList" resultType="java.lang.String">
select serial_number as pileNo
from xhpc_charging_pile
where charging_station_id = #{chargingStationId}
and del_flag = 0
and status = 0
</select>
<select id="getXhpcRateTimeNumber" resultType="java.util.Map">
SELECT CAST(((UNIX_TIMESTAMP(end_time) - UNIX_TIMESTAMP(start_time)) / 1800) AS SIGNED) as number,
rate_value as rateValue
FROM xhpc_rate_time
where charging_station_id = #{chargingStationId}
order by sort
</select>
<update id="updateXhpcChargingPile">
update xhpc_charging_pile
set rate_model_id=#{rateModelId}
WHERE charging_station_id = #{chargingStationId}
</update>
<update id="updateXhpcTerminal">
update xhpc_terminal
set rate_model_id=#{rateModelId}
WHERE charging_station_id = #{chargingStationId}
</update>
<select id="getLandUser" resultType="map">
select user_id as userId, user_type as userType, operator_id as operatorId
from sys_user
where user_id = #{userId}
</select>
<insert id="addXhpcUserPrivilege">
insert into xhpc_user_privilege(
<if test="null != userId and '' != userId">
user_id,
</if>
<if test="null != chargingStationId and '' != chargingStationId">
charging_station_id
</if>
)values(
<if test="null != userId and '' != userId">
#{userId},
</if>
<if test="null != chargingStationId and '' != chargingStationId">
#{chargingStationId}
</if>
)
</insert>
</mapper>

View File

@ -51,236 +51,6 @@
xo.create_by createBy, xo.update_time updateTime, xo.update_by updateBy, xo.remark,
</sql>
<insert id="insert" parameterType="com.xhpc.invoice.pojo.XhpcOperator" useGeneratedKeys="true"
keyProperty="operatorId">
insert into xhpc_operator
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != name and '' != name">
name,
</if>
<if test="null != contactName and '' != contactName">
contact_name,
</if>
<if test="null != contactPhone and '' != contactPhone">
contact_phone,
</if>
<if test="null != phone and '' != phone">
phone,
</if>
<if test="null != attribute and '' != attribute">
attribute,
</if>
<if test="null != dutyParagraph and '' != dutyParagraph">
duty_paragraph,
</if>
<if test="null != detailedAddress and '' != detailedAddress">
detailed_address,
</if>
<if test="null != openBank and '' != openBank">
open_bank,
</if>
<if test="null != cardNumber and '' != cardNumber">
card_number,
</if>
<if test="null != areaCode and '' != areaCode">
area_code,
</if>
<if test="null != address and '' != address">
address,
</if>
<if test="null != longitude and '' != longitude">
longitude,
</if>
<if test="null != latitude and '' != latitude">
latitude,
</if>
<if test="null != email and '' != email">
email,
</if>
<if test="null != commissionType and '' != commissionType">
commission_type,
</if>
<if test="null != platformCommissionRate and '' != platformCommissionRate">
platform_commission_rate,
</if>
<if test="null != maintenanceCommissionRate and '' != maintenanceCommissionRate">
maintenance_commission_rate,
</if>
<if test="null != businessLicenseId and '' != businessLicenseId">
business_license_id,
</if>
<if test="null != withdrawalTime and '' != withdrawalTime">
withdrawal_time,
</if>
<if test="null != soc and '' != soc">
soc,
</if>
<if test="null != status and '' != status">
status,
</if>
<if test="null != delFlag and '' != delFlag">
del_flag,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != remark and '' != remark">
remark,
</if>
<if test="null != operatorIdEvcs and '' != operatorIdEvcs">
operator_id_evcs
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != name and '' != name">
#{name},
</if>
<if test="null != contactName and '' != contactName">
#{contactName},
</if>
<if test="null != contactPhone and '' != contactPhone">
#{contactPhone},
</if>
<if test="null != phone and '' != phone">
#{phone},
</if>
<if test="null != attribute and '' != attribute">
#{attribute},
</if>
<if test="null != dutyParagraph and '' != dutyParagraph">
#{dutyParagraph},
</if>
<if test="null != detailedAddress and '' != detailedAddress">
#{detailedAddress},
</if>
<if test="null != openBank and '' != openBank">
#{openBank},
</if>
<if test="null != cardNumber and '' != cardNumber">
#{cardNumber},
</if>
<if test="null != areaCode and '' != areaCode">
#{areaCode},
</if>
<if test="null != address and '' != address">
#{address},
</if>
<if test="null != longitude and '' != longitude">
#{longitude},
</if>
<if test="null != latitude and '' != latitude">
#{latitude},
</if>
<if test="null != email and '' != email">
#{email},
</if>
<if test="null != commissionType and '' != commissionType">
#{commissionType},
</if>
<if test="null != platformCommissionRate and '' != platformCommissionRate">
#{platformCommissionRate},
</if>
<if test="null != maintenanceCommissionRate and '' != maintenanceCommissionRate">
#{maintenanceCommissionRate},
</if>
<if test="null != businessLicenseId and '' != businessLicenseId">
#{businessLicenseId},
</if>
<if test="null != withdrawalTime and '' != withdrawalTime">
#{withdrawalTime},
</if>
<if test="null != soc and '' != soc">
#{soc},
</if>
<if test="null != status and '' != status">
#{status},
</if>
<if test="null != delFlag and '' != delFlag">
#{delFlag},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark},
</if>
<if test="null != operatorIdEvcs and '' != operatorIdEvcs">
#{operatorIdEvcs}
</if>
</trim>
</insert>
<update id="update" parameterType="com.xhpc.invoice.pojo.XhpcOperator">
UPDATE xhpc_operator
<set>
<if test="null != operatorId and '' != operatorId">operator_id = #{operatorId},</if>
<if test="null != name and '' != name">name = #{name},</if>
<if test="null != contactName and '' != contactName">contact_name = #{contactName},</if>
<if test="null != contactPhone and '' != contactPhone">contact_phone = #{contactPhone},</if>
<if test="null != phone and '' != phone">phone = #{phone},</if>
<if test="null != attribute ">attribute = #{attribute},</if>
<if test="null != openBank and '' != openBank">open_bank = #{openBank},</if>
<if test="null != cardNumber">card_number = #{cardNumber},</if>
<if test="null != areaCode and '' != areaCode">area_code = #{areaCode},</if>
<if test="null != address and '' != address">address = #{address},</if>
<if test="null != longitude and '' != longitude">longitude = #{longitude},</if>
<if test="null != latitude and '' != latitude">latitude = #{latitude},</if>
<if test="null != email and '' != email">email = #{email},</if>
<if test="null != commissionType ">commission_type = #{commissionType},</if>
<if test="null != platformCommissionRate">platform_commission_rate =
#{platformCommissionRate},
</if>
<if test="null != maintenanceCommissionRate">maintenance_commission_rate
= #{maintenanceCommissionRate},
</if>
<if test="null != businessLicenseId and '' != businessLicenseId">business_license_id =
#{businessLicenseId},
</if>
<if test="null != withdrawalTime and '' != withdrawalTime">withdrawal_time = #{withdrawalTime},</if>
<if test="null != soc and '' != soc">soc = #{soc},</if>
<if test="null != status">status = #{status},</if>
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>
<if test="null != createTime ">create_time = #{createTime},</if>
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
<if test="null != updateTime">update_time = #{updateTime},</if>
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
<if test="null != remark and '' != remark">remark = #{remark},</if>
<if test="null != operatorIdEvcs and '' != operatorIdEvcs">operator_id_evcs = #{operatorIdEvcs}</if>
</set>
WHERE operator_id = #{operatorId}
</update>
<delete id="deleteByIds" parameterType="java.lang.String">
delete from xhpc_operator where operator_id in
<foreach collection="array" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
</delete>
<select id="checkAccountUnique" parameterType="java.lang.String" resultMap="XhpcOperatorResult">
select *
from xhpc_operator
where phone = #{phone} limit 1
</select>
<select id="info" parameterType="java.lang.Long" resultType="java.util.Map">
select
<include refid="Base_Column_List"/>
@ -294,99 +64,4 @@
where xo.del_flag = 0 and xo.operator_id = #{operatorId}
</select>
<select id="selectOperatorList" parameterType="java.lang.Long" resultType="java.util.Map">
select xo.operator_id operatorId, xo.name, xo.contact_name contactName, xo.duty_paragraph dutyParagraph,
xo.contact_phone contactPhone, xo.phone, xo.attribute,`xo`.create_time createTime,`xo`.status,
CASE WHEN xo.`status` = 0 THEN '正常' else '禁用' end statusName,su.user_id userId,
xdb.dict_value attributenName
from xhpc_operator xo
LEFT JOIN sys_user su on su.operator_id = xo.operator_id
LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'operator_attribute' and xdb.dict_key = xo.attribute
where xo.del_flag = 0
<if test="name != null and name != ''">
and xo.name like concat('%', #{name}, '%')
</if>
<if test="contactName != null and contactName != ''">
and xo.contact_name like concat('%', #{contactName}, '%')
</if>
<if test="contactPhone != null and contactPhone != ''">
and xo.contact_phone like concat('%', #{contactPhone}, '%')
</if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xo.create_time &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''"><!-- 结束时间检索 -->
AND xo.create_time &lt;= #{createTimeEnd}
</if>
group by xo.operator_id
ORDER BY xo.update_time DESC
</select>
<delete id="deleteUserRoleByUserId" parameterType="java.lang.Long">
delete
from sys_user_role
where user_id = #{userId}
</delete>
<delete id="deleteUserPostByUserId" parameterType="java.lang.Long">
delete
from sys_user_post
where user_id = #{userId}
</delete>
<update id="deleteUserById" parameterType="com.xhpc.system.api.domain.SysUser">
update sys_user
set del_flag = #{delFlag}
where user_id = #{userId}
</update>
<select id="getUserByOperatorId" parameterType="java.lang.Long" resultType="com.xhpc.system.api.domain.SysUser">
select user_id userId,
dept_id deptid,
user_name userName,
nick_name nickName,
user_type userType,
email,
phonenumber,
operator_id operatorId,
internet_user_id internetUserId,
sex,
avatar,
password,
data_power_type dataPowerType,
status,
del_flag delFlag,
login_ip loginIp,
login_date loginDate,
create_by createBy,
create_time createTime,
update_by updateBy,
update_time updateTime,
remark
from sys_user
where del_flag = 0
and operator_id = #{operatorId}
</select>
<select id="getOperatorId" resultType="java.util.Map">
select xo.operator_id operatorId,
xo.name,
xo.contact_name contactName,
xo.contact_phone contactPhone,
xo.phone,
xo.attribute,
xo.duty_paragraph dutyParagraph,
xdb.dict_value attributenName
from xhpc_operator `xo`
LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'operator_attribute' and xdb.dict_key = xo.attribute
where xo.del_flag = 0
ORDER BY xo.create_time DESC
</select>
<delete id="deleteRoleByName" parameterType="java.lang.String">
delete
from sys_role
where role_name = #{roleName}
</delete>
</mapper>