first commit
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
<?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.dcsoft.system.vehicle.mapper.CarChargeItemMapper">
|
||||
|
||||
<resultMap type="CarChargeItem" id="CarChargeItemResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="chargeId" column="charge_id" />
|
||||
<result property="startLong" column="start_long" />
|
||||
<result property="endLong" column="end_long" />
|
||||
<result property="chargeMoney" column="charge_money" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCarChargeItemVo">
|
||||
select id, charge_id, start_long, end_long, charge_money from car_charge_item
|
||||
</sql>
|
||||
|
||||
<select id="selectCarChargeItemList" parameterType="CarChargeItem" resultMap="CarChargeItemResult">
|
||||
<include refid="selectCarChargeItemVo"/>
|
||||
<where>
|
||||
<if test="chargeId != null "> and charge_id = #{chargeId}</if>
|
||||
<if test="startLong != null "> and start_long = #{startLong}</if>
|
||||
<if test="endLong != null "> and end_long = #{endLong}</if>
|
||||
<if test="chargeMoney != null "> and charge_money = #{chargeMoney}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCarChargeItemById" parameterType="Long" resultMap="CarChargeItemResult">
|
||||
<include refid="selectCarChargeItemVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCarChargeItem" parameterType="CarChargeItem" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into car_charge_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="chargeId != null">charge_id,</if>
|
||||
<if test="startLong != null">start_long,</if>
|
||||
<if test="endLong != null">end_long,</if>
|
||||
<if test="chargeMoney != null">charge_money,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="chargeId != null">#{chargeId},</if>
|
||||
<if test="startLong != null">#{startLong},</if>
|
||||
<if test="endLong != null">#{endLong},</if>
|
||||
<if test="chargeMoney != null">#{chargeMoney},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCarChargeItem" parameterType="CarChargeItem">
|
||||
update car_charge_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="chargeId != null">charge_id = #{chargeId},</if>
|
||||
<if test="startLong != null">start_long = #{startLong},</if>
|
||||
<if test="endLong != null">end_long = #{endLong},</if>
|
||||
<if test="chargeMoney != null">charge_money = #{chargeMoney},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCarChargeItemById" parameterType="Long">
|
||||
delete from car_charge_item where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCarChargeItemByIds" parameterType="String">
|
||||
delete from car_charge_item where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteChargeItemByChargeId" parameterType="Long">
|
||||
delete from car_charge_item where charge_id = #{id}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?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.dcsoft.system.vehicle.mapper.CarChargeMapper">
|
||||
|
||||
<resultMap type="CarCharge" id="CarChargeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="parkId" column="park_id" />
|
||||
<result property="parkName" column="park_name" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="timeLong" column="time_long" />
|
||||
<result property="chargeMoney" column="charge_money" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCarChargeVo">
|
||||
select cc.id, cc.park_id, cc.name, cc.type, cc.time_long, cc.charge_money, cc.status, cc.remark, cc.create_by,
|
||||
cc.create_time, cc.update_by, cc.update_time ,cp.name park_name
|
||||
from car_charge cc
|
||||
left join car_park cp on cc.park_id=cp.id
|
||||
</sql>
|
||||
|
||||
<select id="selectCarChargeList" parameterType="CarCharge" resultMap="CarChargeResult">
|
||||
<include refid="selectCarChargeVo"/>
|
||||
<where>
|
||||
<if test="parkId != null "> and cc.park_id = #{parkId}</if>
|
||||
<if test="name != null and name != ''"> and cc.name like concat('%', #{name}, '%')</if>
|
||||
<if test="status != null and status != ''"> and cc.status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCarChargeById" parameterType="Long" resultMap="CarChargeResult">
|
||||
<include refid="selectCarChargeVo"/>
|
||||
where cc.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCarCharge" parameterType="CarCharge" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into car_charge
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parkId != null">park_id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="timeLong != null">time_long,</if>
|
||||
<if test="chargeMoney != null">charge_money,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parkId != null">#{parkId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="timeLong != null">#{timeLong},</if>
|
||||
<if test="chargeMoney != null">#{chargeMoney},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCarCharge" parameterType="CarCharge">
|
||||
update car_charge
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parkId != null">park_id = #{parkId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="timeLong != null">time_long = #{timeLong},</if>
|
||||
<if test="chargeMoney != null">charge_money = #{chargeMoney},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCarChargeById" parameterType="Long">
|
||||
delete from car_charge where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCarChargeByIds" parameterType="String">
|
||||
delete from car_charge where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,166 @@
|
||||
<?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.dcsoft.system.vehicle.mapper.CarInfoMapper">
|
||||
|
||||
<resultMap type="CarInfo" id="CarInfoResult">
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="enableTime" column="enable_time" />
|
||||
<result property="overdueTime" column="overdue_time" />
|
||||
<result property="enable" column="enable" />
|
||||
<result property="plate" column="plate" />
|
||||
<result property="timeSegEnable" column="time_seg_enable" />
|
||||
<result property="segTime" column="seg_time" />
|
||||
<result property="needAlarm" column="need_alarm" />
|
||||
<result property="vehicleCode" column="vehicle_code" />
|
||||
<result property="vehicleComment" column="vehicle_comment" />
|
||||
<result property="peopleId" column="people_id" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="sync" column="sync" />
|
||||
<result property="remark" column="remark" />
|
||||
<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="parkId" column="park_id" />
|
||||
<result property="peopleName" column="people_name" />
|
||||
<result property="parkName" column="park_name" />
|
||||
<result property="num" column="num" />
|
||||
<result property="carType" column="car_type" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="phone" column="phone" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCarInfoVo">
|
||||
select ci.customer_id, ci.enable_time, ci.overdue_time, ci.enable, ci.plate, ci.time_seg_enable, ci.seg_time, ci.need_alarm,
|
||||
ci.vehicle_code, ci.vehicle_comment, ci.people_id, ci.del_flag, ci.sync, ci.remark,
|
||||
ci.create_by, ci.create_time, ci.update_by, ci.update_time,ci.park_id, cp.name park_name,p.name people_name,
|
||||
ci.num,ci.car_type,ci.unit,ci.phone
|
||||
from car_info ci
|
||||
left join car_park cp on ci.park_id=cp.id
|
||||
left join sys_people p on ci.people_id=p.id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectCarInfoList" parameterType="CarInfo" resultMap="CarInfoResult">
|
||||
<include refid="selectCarInfoVo"/>
|
||||
<where>
|
||||
1=1 and ci.del_flag=0
|
||||
<if test="enableTime != null "> and ci.enable_time = #{enableTime}</if>
|
||||
<if test="overdueTime != null "> and ci.overdue_time = #{overdueTime}</if>
|
||||
<if test="enable != null and enable != ''"> and ci.enable = #{enable}</if>
|
||||
<if test="plate != null and plate != ''"> and ci.plate like concat('%', #{plate}, '%') </if>
|
||||
<if test="peopleId != null "> and ci.people_id = #{peopleId}</if>
|
||||
<if test="peopleName != null "> and p.name = #{peopleName}</if>
|
||||
<if test="unit != null "> and ci.unit = #{unit}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCarInfoByCustomerId" parameterType="Long" resultMap="CarInfoResult">
|
||||
<include refid="selectCarInfoVo"/>
|
||||
where ci.customer_id = #{customerId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCarInfo" parameterType="CarInfo" useGeneratedKeys="true" keyProperty="customerId">
|
||||
insert into car_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="enableTime != null">enable_time,</if>
|
||||
<if test="overdueTime != null">overdue_time,</if>
|
||||
<if test="enable != null">enable,</if>
|
||||
<if test="plate != null and plate != ''">plate,</if>
|
||||
<if test="timeSegEnable != null and timeSegEnable != ''">time_seg_enable,</if>
|
||||
<if test="segTime != null">seg_time,</if>
|
||||
<if test="needAlarm != null">need_alarm,</if>
|
||||
<if test="vehicleCode != null">vehicle_code,</if>
|
||||
<if test="vehicleComment != null">vehicle_comment,</if>
|
||||
<if test="peopleId != null">people_id,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="sync != null">sync,</if>
|
||||
<if test="remark != null">remark,</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="parkId != null">park_id,</if>
|
||||
<if test="num != null">num,</if>
|
||||
<if test="carType != null">car_type,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="customerId != null">#{customerId},</if>
|
||||
<if test="enableTime != null">#{enableTime},</if>
|
||||
<if test="overdueTime != null">#{overdueTime},</if>
|
||||
<if test="enable != null">#{enable},</if>
|
||||
<if test="plate != null and plate != ''">#{plate},</if>
|
||||
<if test="timeSegEnable != null and timeSegEnable != ''">#{timeSegEnable},</if>
|
||||
<if test="segTime != null">#{segTime},</if>
|
||||
<if test="needAlarm != null">#{needAlarm},</if>
|
||||
<if test="vehicleCode != null">#{vehicleCode},</if>
|
||||
<if test="vehicleComment != null">#{vehicleComment},</if>
|
||||
<if test="peopleId != null">#{peopleId},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="sync != null">#{sync},</if>
|
||||
<if test="remark != null">#{remark},</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="parkId != null">#{parkId},</if>
|
||||
<if test="num != null">#{num},</if>
|
||||
<if test="carType != null">#{carType},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCarInfo" parameterType="CarInfo">
|
||||
update car_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="enableTime != null">enable_time = #{enableTime},</if>
|
||||
<if test="overdueTime != null">overdue_time = #{overdueTime},</if>
|
||||
<if test="enable != null">enable = #{enable},</if>
|
||||
<if test="plate != null and plate != ''">plate = #{plate},</if>
|
||||
<if test="timeSegEnable != null and timeSegEnable != ''">time_seg_enable = #{timeSegEnable},</if>
|
||||
<if test="segTime != null">seg_time = #{segTime},</if>
|
||||
<if test="needAlarm != null">need_alarm = #{needAlarm},</if>
|
||||
<if test="vehicleCode != null">vehicle_code = #{vehicleCode},</if>
|
||||
<if test="vehicleComment != null">vehicle_comment = #{vehicleComment},</if>
|
||||
<if test="peopleId != null">people_id = #{peopleId},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="sync != null">sync = #{sync},</if>
|
||||
<if test="remark != null">remark = #{remark},</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="parkId != null">park_id = #{parkId},</if>
|
||||
<if test="num != null">num = #{num},</if>
|
||||
<if test="carType != null">car_type = #{carType},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
|
||||
</trim>
|
||||
where customer_id = #{customerId}
|
||||
</update>
|
||||
|
||||
<update id="deleteCarInfoByCustomerId" parameterType="Long">
|
||||
update car_info set del_flag=2 where customer_id = #{customerId}
|
||||
</update>
|
||||
|
||||
<update id="deleteCarInfoByCustomerIds" parameterType="String">
|
||||
update car_info set del_flag=2 where customer_id in
|
||||
<foreach item="customerId" collection="array" open="(" separator="," close=")">
|
||||
#{customerId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectCarInfoByCarNo" parameterType="String" resultMap="CarInfoResult">
|
||||
<include refid="selectCarInfoVo"/>
|
||||
where ci.plate = #{plate} and ci.del_flag=0
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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.dcsoft.system.vehicle.mapper.CarParkItemMapper">
|
||||
|
||||
<resultMap type="CarParkItem" id="CarParkItemResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="equipmentId" column="equipment_id" />
|
||||
<result property="parkId" column="park_id" />
|
||||
<result property="way" column="way" />
|
||||
<result property="area" column="area" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCarParkItemVo">
|
||||
select id, equipment_id, park_id, way,area from car_park_item
|
||||
</sql>
|
||||
|
||||
<select id="selectCarParkItemList" parameterType="CarParkItem" resultMap="CarParkItemResult">
|
||||
<include refid="selectCarParkItemVo"/>
|
||||
<where>
|
||||
<if test="equipmentId != null "> and equipment_id = #{equipmentId}</if>
|
||||
<if test="parkId != null "> and park_id = #{parkId}</if>
|
||||
<if test="way != null and way != ''"> and way = #{way}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCarParkItemById" parameterType="Long" resultMap="CarParkItemResult">
|
||||
<include refid="selectCarParkItemVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCarParkItem" parameterType="CarParkItem">
|
||||
insert into car_park_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="equipmentId != null">equipment_id,</if>
|
||||
<if test="parkId != null">park_id,</if>
|
||||
<if test="way != null">way,</if>
|
||||
<if test="area != null">area,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="equipmentId != null">#{equipmentId},</if>
|
||||
<if test="parkId != null">#{parkId},</if>
|
||||
<if test="way != null">#{way},</if>
|
||||
<if test="area != null">#{area},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCarParkItem" parameterType="CarParkItem">
|
||||
update car_park_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="equipmentId != null">equipment_id = #{equipmentId},</if>
|
||||
<if test="parkId != null">park_id = #{parkId},</if>
|
||||
<if test="way != null">way = #{way},</if>
|
||||
<if test="area != null">area = #{area},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCarParkItemById" parameterType="Long">
|
||||
delete from car_park_item where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCarParkItemByIds" parameterType="String">
|
||||
delete from car_park_item where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteParkItemByParkId" parameterType="Long">
|
||||
delete from car_park_item where park_id = #{parkId}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,125 @@
|
||||
<?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.dcsoft.system.vehicle.mapper.CarParkMapper">
|
||||
|
||||
<resultMap type="CarPark" id="CarParkResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="spaceId" column="space_id" />
|
||||
<result property="carsNum" column="cars_num" />
|
||||
<result property="surplusNum" column="surplus_num" />
|
||||
<result property="remark" column="remark" />
|
||||
<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="spaceName" column="space_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCarParkVo">
|
||||
select cp.id, cp.name, cp.space_id, cp.cars_num, cp.surplus_num, cp.remark, cp.create_by, cp.create_time,
|
||||
cp.update_by, cp.update_time,ss.name space_name
|
||||
from car_park cp
|
||||
left join sys_space ss on cp.space_id=ss.id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectCarParkList" parameterType="CarPark" resultMap="CarParkResult">
|
||||
<include refid="selectCarParkVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and cp.name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCarParkById" parameterType="Long" resultMap="CarParkResult">
|
||||
<include refid="selectCarParkVo"/>
|
||||
where cp.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCarPark" parameterType="CarPark" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into car_park
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="spaceId != null">space_id,</if>
|
||||
<if test="carsNum != null">cars_num,</if>
|
||||
<if test="surplusNum != null">surplus_num,</if>
|
||||
<if test="remark != null">remark,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="spaceId != null">#{spaceId},</if>
|
||||
<if test="carsNum != null">#{carsNum},</if>
|
||||
<if test="surplusNum != null">#{surplusNum},</if>
|
||||
<if test="remark != null">#{remark},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCarPark" parameterType="CarPark">
|
||||
update car_park
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="spaceId != null">space_id = #{spaceId},</if>
|
||||
<if test="carsNum != null">cars_num = #{carsNum},</if>
|
||||
<if test="surplusNum != null">surplus_num = #{surplusNum},</if>
|
||||
<if test="remark != null">remark = #{remark},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCarParkById" parameterType="Long">
|
||||
delete from car_park where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCarParkByIds" parameterType="String">
|
||||
delete from car_park where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectItemTreeList" parameterType="Long" resultType="java.util.Map">
|
||||
select dict_value id,dict_label name from sys_dict_data
|
||||
where dict_type ='car_park_area'
|
||||
and dict_value in (select DISTINCT area from car_park_item where park_id=#{id})
|
||||
</select>
|
||||
|
||||
<select id="carPlay" parameterType="Long" resultType="java.util.Map">
|
||||
select back_url url,id from sys_equipment where id in (select equipment_id from car_park_item where area=#{id})
|
||||
</select>
|
||||
<select id="carPlayRecord" parameterType="Long" resultType="java.util.Map">
|
||||
select cpr.url,cpi.way,cpr.pass_time passTime from car_pass_record cpr left join sys_equipment se on cpr.sn=se.sequence
|
||||
left join car_park_item cpi on cpi.equipment_id=se.id
|
||||
where se.id in (select equipment_id from car_park_item where area=#{id})
|
||||
ORDER BY cpr.pass_time desc limit 12
|
||||
</select>
|
||||
|
||||
<delete id="deleteSelectCarInfo" parameterType="Long">
|
||||
delete from car_equipment_open where equipment_id = #{id}
|
||||
</delete>
|
||||
|
||||
<insert id="selectCarInfo" >
|
||||
insert into car_equipment_open (equipment_id,io) values(#{id},#{flag})
|
||||
</insert>
|
||||
|
||||
<select id="selectCarParkByName" parameterType="String" resultMap="CarParkResult">
|
||||
<include refid="selectCarParkVo"/>
|
||||
where cp.name = #{name}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?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.dcsoft.system.vehicle.mapper.CarParkRecordMapper">
|
||||
|
||||
<resultMap type="CarParkRecord" id="CarParkRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="equipmentId" column="equipment_id" />
|
||||
<result property="parkId" column="park_id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="sync" column="sync" />
|
||||
<result property="equipmentName" column="equipment_name" />
|
||||
<result property="parkName" column="park_name" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCarParkRecordVo">
|
||||
select cpr.id, cpr.equipment_id, cpr.park_id, cpr.customer_id, cpr.sync,
|
||||
se.name equipment_name,cp.name park_name,ci.plate customer_name
|
||||
from car_park_record cpr
|
||||
left join sys_equipment se on cpr.equipment_id=se.id
|
||||
left join car_park cp on cpr.park_id=cp.id
|
||||
left join car_info ci on cpr.customer_id=ci.customer_id
|
||||
</sql>
|
||||
|
||||
<select id="selectCarParkRecordList" parameterType="CarParkRecord" resultMap="CarParkRecordResult">
|
||||
<include refid="selectCarParkRecordVo"/>
|
||||
<where>
|
||||
<if test="equipmentId != null "> and cpr.equipment_id = #{equipmentId}</if>
|
||||
<if test="parkId != null "> and cpr.park_id = #{parkId}</if>
|
||||
<if test="customerId != null "> and cpr.customer_id = #{customerId}</if>
|
||||
<if test="customerName != null ">and ci.plate like concat('%', #{customerName}, '%') </if>
|
||||
<if test="sync != null and sync != ''"> and cpr.sync = #{sync}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCarParkRecordById" parameterType="Long" resultMap="CarParkRecordResult">
|
||||
<include refid="selectCarParkRecordVo"/>
|
||||
where cpr.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCarParkRecord" parameterType="CarParkRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into car_park_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="equipmentId != null">equipment_id,</if>
|
||||
<if test="parkId != null">park_id,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="sync != null">sync,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="equipmentId != null">#{equipmentId},</if>
|
||||
<if test="parkId != null">#{parkId},</if>
|
||||
<if test="customerId != null">#{customerId},</if>
|
||||
<if test="sync != null">#{sync},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCarParkRecord" parameterType="CarParkRecord">
|
||||
update car_park_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="equipmentId != null">equipment_id = #{equipmentId},</if>
|
||||
<if test="parkId != null">park_id = #{parkId},</if>
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="sync != null">sync = #{sync},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCarParkRecordById" parameterType="Long">
|
||||
delete from car_park_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCarParkRecordByIds" parameterType="String">
|
||||
delete from car_park_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCarParkRecordByParkId" parameterType="Long">
|
||||
delete from car_park_record where park_id = #{parkId}
|
||||
</delete>
|
||||
|
||||
|
||||
<update id="deleteCarParkRecordByCustomerIds" parameterType="String">
|
||||
update car_park_record set sync=0 where customer_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteCarParkRecordByCustomerId" parameterType="Long">
|
||||
delete from car_park_record where customer_id = #{customerId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?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.dcsoft.system.vehicle.mapper.CarPassGatherMapper">
|
||||
|
||||
<resultMap type="CarPassGather" id="CarPassGatherResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="parkId" column="park_id" />
|
||||
<result property="parkName" column="park_name" />
|
||||
<result property="area" column="area" />
|
||||
<result property="license" column="license" />
|
||||
<result property="joinTime" column="join_time" />
|
||||
<result property="sn" column="sn" />
|
||||
<result property="equipmentName" column="equipment_name" />
|
||||
<result property="timeLong" column="time_long" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCarPassGatherVo">
|
||||
select cpg.id, cpg.park_id, cpg.area, cpg.license, cpg.join_time, cpg.sn,cp.name park_name,se.name equipment_name,HOUR(TIMEDIFF(NOW(),cpg.join_time)) AS time_long
|
||||
from car_pass_gather cpg
|
||||
left join car_park cp on cp.id=cpg.park_id
|
||||
left join sys_equipment se on se.sequence=cpg.sn
|
||||
</sql>
|
||||
|
||||
<select id="selectCarPassGatherList" parameterType="CarPassGather" resultMap="CarPassGatherResult">
|
||||
<include refid="selectCarPassGatherVo"/>
|
||||
<where>
|
||||
<if test="parkId != null and parkId != ''"> and cpg.park_id = #{parkId}</if>
|
||||
<if test="area != null and area != ''"> and cpg.area = #{area}</if>
|
||||
<if test="license != null and license != ''"> and cpg.license like concat('%', #{license}, '%') </if>
|
||||
<if test="joinTime != null "> and date_format(cpg.join_time, '%Y-%m-%d') = date_format(#{joinTime}, '%Y-%m-%d') </if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCarPassGatherById" parameterType="Long" resultMap="CarPassGatherResult">
|
||||
<include refid="selectCarPassGatherVo"/>
|
||||
where cpg.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCarPassGather" parameterType="CarPassGather" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into car_pass_gather
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parkId != null">park_id,</if>
|
||||
<if test="area != null">area,</if>
|
||||
<if test="license != null">license,</if>
|
||||
<if test="joinTime != null">join_time,</if>
|
||||
<if test="sn != null">sn,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parkId != null">#{parkId},</if>
|
||||
<if test="area != null">#{area},</if>
|
||||
<if test="license != null">#{license},</if>
|
||||
<if test="joinTime != null">#{joinTime},</if>
|
||||
<if test="sn != null">#{sn},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCarPassGather" parameterType="CarPassGather">
|
||||
update car_pass_gather
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parkId != null">park_id = #{parkId},</if>
|
||||
<if test="area != null">area = #{area},</if>
|
||||
<if test="license != null">license = #{license},</if>
|
||||
<if test="joinTime != null">join_time = #{joinTime},</if>
|
||||
<if test="sn != null">sn = #{sn},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCarPassGatherById" parameterType="Long">
|
||||
delete from car_pass_gather where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCarPassGatherByIds" parameterType="String">
|
||||
delete from car_pass_gather where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="parkTop" parameterType="Long" resultType="java.util.Map">
|
||||
select cars_num num from car_park
|
||||
where id = #{parkId}
|
||||
UNION ALL
|
||||
select count(1) num from car_pass_gather
|
||||
where park_id=#{parkId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,115 @@
|
||||
<?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.dcsoft.system.vehicle.mapper.CarPassRecordMapper">
|
||||
|
||||
<resultMap type="CarPassRecord" id="CarPassRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="parkId" column="park_id" />
|
||||
<result property="uniqueNo" column="unique_no" />
|
||||
<result property="direction" column="direction" />
|
||||
<result property="license" column="license" />
|
||||
<result property="passTime" column="pass_time" />
|
||||
<result property="triggerType" column="trigger_type" />
|
||||
<result property="colorType" column="color_type" />
|
||||
<result property="carColor" column="car_color" />
|
||||
<result property="url" column="url" />
|
||||
<result property="dataType" column="data_type" />
|
||||
<result property="sn" column="sn" />
|
||||
<result property="way" column="way" />
|
||||
<result property="parkName" column="park_name" />
|
||||
<result property="equipmentName" column="equipment_name" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="type" column="type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCarPassRecordVo">
|
||||
select cpr.id, cpr.park_id, cpr.unique_no, cpr.direction, cpr.license, cpr.pass_time, cpr.trigger_type, cpr.color_type,
|
||||
cpr.car_color, cpr.url, cpr.data_type, cpr.sn,cpi.way,cp.name park_name,se.name equipment_name,ci.unit,cpr.type
|
||||
from car_pass_record cpr
|
||||
left join sys_equipment se on cpr.sn=se.sequence
|
||||
left join car_park_item cpi on cpi.equipment_id=se.id
|
||||
left join car_park cp on cp.id=cpi.park_id
|
||||
left join car_info ci on cpr.license=ci.plate
|
||||
</sql>
|
||||
|
||||
<select id="selectCarPassRecordList" parameterType="CarPassRecord" resultMap="CarPassRecordResult">
|
||||
<include refid="selectCarPassRecordVo"/>
|
||||
<where>
|
||||
<if test="direction != null and direction != ''"> and direction = #{direction}</if>
|
||||
<if test="license != null and license != ''"> and license = #{license}</if>
|
||||
<if test="passTime != null "> and date_format(pass_time, '%Y-%m-%d') = date_format(#{passTime}, '%Y-%m-%d')</if>
|
||||
<if test="triggerType != null and triggerType != ''"> and trigger_type = #{triggerType}</if>
|
||||
<if test="colorType != null and colorType != ''"> and color_type = #{colorType}</if>
|
||||
<if test="carColor != null and carColor != ''"> and car_color = #{carColor}</if>
|
||||
</where>
|
||||
order by cpr.pass_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCarPassRecordById" parameterType="Long" resultMap="CarPassRecordResult">
|
||||
<include refid="selectCarPassRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCarPassRecord" parameterType="CarPassRecord">
|
||||
insert into car_pass_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="parkId != null and parkId != ''">park_id,</if>
|
||||
<if test="uniqueNo != null and uniqueNo != ''">unique_no,</if>
|
||||
<if test="direction != null">direction,</if>
|
||||
<if test="license != null and license != ''">license,</if>
|
||||
<if test="passTime != null">pass_time,</if>
|
||||
<if test="triggerType != null and triggerType != ''">trigger_type,</if>
|
||||
<if test="colorType != null and colorType != ''">color_type,</if>
|
||||
<if test="carColor != null">car_color,</if>
|
||||
<if test="url != null">url,</if>
|
||||
<if test="dataType != null">data_type,</if>
|
||||
<if test="sn != null and sn != ''">sn,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="parkId != null and parkId != ''">#{parkId},</if>
|
||||
<if test="uniqueNo != null and uniqueNo != ''">#{uniqueNo},</if>
|
||||
<if test="direction != null">#{direction},</if>
|
||||
<if test="license != null and license != ''">#{license},</if>
|
||||
<if test="passTime != null">#{passTime},</if>
|
||||
<if test="triggerType != null and triggerType != ''">#{triggerType},</if>
|
||||
<if test="colorType != null and colorType != ''">#{colorType},</if>
|
||||
<if test="carColor != null">#{carColor},</if>
|
||||
<if test="url != null">#{url},</if>
|
||||
<if test="dataType != null">#{dataType},</if>
|
||||
<if test="sn != null and sn != ''">#{sn},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCarPassRecord" parameterType="CarPassRecord">
|
||||
update car_pass_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parkId != null and parkId != ''">park_id = #{parkId},</if>
|
||||
<if test="uniqueNo != null and uniqueNo != ''">unique_no = #{uniqueNo},</if>
|
||||
<if test="direction != null">direction = #{direction},</if>
|
||||
<if test="license != null and license != ''">license = #{license},</if>
|
||||
<if test="passTime != null">pass_time = #{passTime},</if>
|
||||
<if test="triggerType != null and triggerType != ''">trigger_type = #{triggerType},</if>
|
||||
<if test="colorType != null and colorType != ''">color_type = #{colorType},</if>
|
||||
<if test="carColor != null">car_color = #{carColor},</if>
|
||||
<if test="url != null">url = #{url},</if>
|
||||
<if test="dataType != null">data_type = #{dataType},</if>
|
||||
<if test="sn != null and sn != ''">sn = #{sn},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCarPassRecordById" parameterType="Long">
|
||||
delete from car_pass_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCarPassRecordByIds" parameterType="String">
|
||||
delete from car_pass_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user