更新批量修改的SQL

This commit is contained in:
panshuling321 2022-04-26 17:25:28 +08:00
parent 0243c7f7e5
commit af8fc76bb9
2 changed files with 25 additions and 25 deletions

View File

@ -143,36 +143,36 @@
<select id="findOneBySerialNumber" resultType="com.xhpc.activity.domain.XhpcHistoryOrderDomain">
select
o.*,
<include refid="Base_Column_List" />,
s.name as 'charging_station_name'
from
xhpc_history_order o
left join xhpc_charging_station s on o.charging_station_id=s.charging_station_id
where serial_number=#{serialNumber}
xhpc_history_order ho
left join xhpc_charging_station s on ho.charging_station_id=s.charging_station_id
where ho.serial_number=#{serialNumber}
</select>
<select id="findOneByInternetSerialNumber" resultType="com.xhpc.activity.domain.XhpcHistoryOrderDomain">
select
o.*,
<include refid="Base_Column_List" />,
s.name as 'charging_station_name',
c.charging_degree as 'charging_degree',
c.charging_time as 'charging_time'
from xhpc_history_order o
left join xhpc_charging_station s on o.charging_station_id=s.charging_station_id
left join xhpc_charge_order c on o.charge_order_id=c.charge_order_id
where o.internet_serial_number=#{internetSerialNumber}
from xhpc_history_order ho
left join xhpc_charging_station s on ho.charging_station_id=s.charging_station_id
left join xhpc_charge_order c on ho.charge_order_id=c.charge_order_id
where ho.internet_serial_number=#{internetSerialNumber}
</select>
<select id="findListByInternetSerialNumbers" resultType="com.xhpc.activity.domain.XhpcHistoryOrderDomain">
select
o.*,
<include refid="Base_Column_List" />,
s.name as 'charging_station_name',
c.charging_degree as 'charging_degree',
c.charging_time as 'charging_time'
from xhpc_history_order o
left join xhpc_charging_station s on o.charging_station_id=s.charging_station_id
left join xhpc_charge_order c on o.charge_order_id=c.charge_order_id
where o.internet_serial_number in
from xhpc_history_order ho
left join xhpc_charging_station s on ho.charging_station_id=s.charging_station_id
left join xhpc_charge_order c on ho.charge_order_id=c.charge_order_id
where ho.internet_serial_number in
<foreach collection="orderNumbers" item="orderNumber" open="(" close=")" separator=",">
#{orderNumber}
</foreach>
@ -180,19 +180,19 @@
<select id="findListByTimeBetween" resultType="com.xhpc.activity.domain.XhpcHistoryOrderDomain">
select
o.*,
<include refid="Base_Column_List" />,
s.name as 'charging_station_name',
c.charging_degree as 'charging_degree',
c.charging_time as 'charging_time'
from xhpc_history_order o
left join xhpc_charging_station s on o.charging_station_id=s.charging_station_id
left join xhpc_charge_order c on o.charge_order_id=c.charge_order_id
where o.tenant_id=#{tenantId}
from xhpc_history_order ho
left join xhpc_charging_station s on ho.charging_station_id=s.charging_station_id
left join xhpc_charge_order c on ho.charge_order_id=c.charge_order_id
where ho.tenant_id=#{tenantId}
<if test="startTime!=null and startTime != ''">
and o.create_time <![CDATA[ >= ]]> #{startTime}
and ho.create_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime !=''">
and o.create_time <![CDATA[ <= ]]> #{endTime}
and ho.create_time <![CDATA[ <= ]]> #{endTime}
</if>
</select>
</mapper>

View File

@ -56,8 +56,8 @@
<update id="updateBatchCusUser" parameterType="list">
<foreach collection="domainList" index="index" item="domain" separator=";">
update xhpc_community_personnel set red_packet=#{domain.redPacket}, surplus_money=#{domain.surplusMoney}
where xhpc_customers_personnel=#{domain.customersPersonnelId}
update xhpc_customers_personnel set red_packet=#{domain.redPacket}, surplus_money=#{domain.surplusMoney}
where customers_personnel_id=#{domain.customersPersonnelId}
</foreach>
</update>
@ -75,8 +75,8 @@
<update id="updateCusUser">
update xhpc_community_personnel set red_packet=#{domain.redPacket}, surplus_money=#{domain.surplusMoney}
where xhpc_customers_personnel=#{domain.customersPersonnelId}
update xhpc_customers_personnel set red_packet=#{domain.redPacket}, surplus_money=#{domain.surplusMoney}
where customers_personnel_id=#{domain.customersPersonnelId}
</update>