|
@@ -0,0 +1,159 @@
|
|
|
+<?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.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionCarMapper">
|
|
|
+
|
|
|
+ <resultMap type="CenterdataTHousingconstructionCar" id="CenterdataTHousingconstructionCarResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createName" column="create_name" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateName" column="update_name" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="deptId" column="dept_id" />
|
|
|
+ <result property="deptName" column="dept_name" />
|
|
|
+ <result property="enterpriseId" column="enterprise_id" />
|
|
|
+ <result property="enterpriseName" column="enterprise_name" />
|
|
|
+ <result property="carNumber" column="car_number" />
|
|
|
+ <result property="managerId" column="manager_id" />
|
|
|
+ <result property="managerName" column="manager_name" />
|
|
|
+ <result property="driverId" column="driver_id" />
|
|
|
+ <result property="driverName" column="driver_name" />
|
|
|
+ <result property="escortId" column="escort_id" />
|
|
|
+ <result property="escortName" column="escort_name" />
|
|
|
+ <result property="emergencyEquipment" column="emergency_equipment" />
|
|
|
+ <result property="protection" column="protection" />
|
|
|
+ <result property="speed" column="speed" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCenterdataTHousingconstructionCarVo">
|
|
|
+ select a.id, a.create_by, a.create_name, a.create_time, a.update_by, a.update_name, a.update_time, a.dept_id, a.dept_name, a.enterprise_id,
|
|
|
+ a.enterprise_name, a.car_number, a.manager_id, a.manager_name, a.driver_id, a.driver_name, a.escort_id, a.escort_name, a.emergency_equipment,
|
|
|
+ a.protection, a.speed from centerdata_t_housingconstruction_car a
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCenterdataTHousingconstructionCarList" parameterType="CenterdataTHousingconstructionCar" resultMap="CenterdataTHousingconstructionCarResult">
|
|
|
+ <include refid="selectCenterdataTHousingconstructionCarVo"/>
|
|
|
+ left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
|
|
|
+ <where>
|
|
|
+ <if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
|
|
|
+ <if test="updateName != null and updateName != ''"> and update_name like concat('%', #{updateName}, '%')</if>
|
|
|
+ <if test="enterpriseId != null and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
|
|
|
+ <if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
|
|
|
+ <if test="carNumber != null and carNumber != ''"> and car_number like concat('%', #{carNumber}, '%')</if>
|
|
|
+ <if test="managerId != null and managerId != ''"> and manager_id = #{managerId}</if>
|
|
|
+ <if test="managerName != null and managerName != ''"> and manager_name like concat('%', #{managerName}, '%')</if>
|
|
|
+ <if test="driverId != null and driverId != ''"> and driver_id = #{driverId}</if>
|
|
|
+ <if test="driverName != null and driverName != ''"> and driver_name like concat('%', #{driverName}, '%')</if>
|
|
|
+ <if test="escortId != null and escortId != ''"> and escort_id = #{escortId}</if>
|
|
|
+ <if test="escortName != null and escortName != ''"> and escort_name like concat('%', #{escortName}, '%')</if>
|
|
|
+ <if test="emergencyEquipment != null and emergencyEquipment != ''"> and emergency_equipment = #{emergencyEquipment}</if>
|
|
|
+ <if test="protection != null and protection != ''"> and protection = #{protection}</if>
|
|
|
+ <if test="speed != null and speed != ''"> and speed = #{speed}</if>
|
|
|
+ <if test="deptId != null">
|
|
|
+ <choose>
|
|
|
+ <when test="deptName != null and deptName == 0">
|
|
|
+ and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
|
|
|
+ </when>
|
|
|
+ <otherwise>and d.dept_id = #{deptId}</otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ ${params.dataScope}
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCenterdataTHousingconstructionCarById" parameterType="String" resultMap="CenterdataTHousingconstructionCarResult">
|
|
|
+ <include refid="selectCenterdataTHousingconstructionCarVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCenterdataTHousingconstructionCar" parameterType="CenterdataTHousingconstructionCar">
|
|
|
+ insert into centerdata_t_housingconstruction_car
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null and id != ''">id,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createName != null">create_name,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateName != null">update_name,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
+ <if test="deptName != null">dept_name,</if>
|
|
|
+ <if test="enterpriseId != null">enterprise_id,</if>
|
|
|
+ <if test="enterpriseName != null">enterprise_name,</if>
|
|
|
+ <if test="carNumber != null">car_number,</if>
|
|
|
+ <if test="managerId != null">manager_id,</if>
|
|
|
+ <if test="managerName != null">manager_name,</if>
|
|
|
+ <if test="driverId != null">driver_id,</if>
|
|
|
+ <if test="driverName != null">driver_name,</if>
|
|
|
+ <if test="escortId != null">escort_id,</if>
|
|
|
+ <if test="escortName != null">escort_name,</if>
|
|
|
+ <if test="emergencyEquipment != null">emergency_equipment,</if>
|
|
|
+ <if test="protection != null">protection,</if>
|
|
|
+ <if test="speed != null">speed,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null and id != ''">#{id},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createName != null">#{createName},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateName != null">#{updateName},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
+ <if test="deptName != null">#{deptName},</if>
|
|
|
+ <if test="enterpriseId != null">#{enterpriseId},</if>
|
|
|
+ <if test="enterpriseName != null">#{enterpriseName},</if>
|
|
|
+ <if test="carNumber != null">#{carNumber},</if>
|
|
|
+ <if test="managerId != null">#{managerId},</if>
|
|
|
+ <if test="managerName != null">#{managerName},</if>
|
|
|
+ <if test="driverId != null">#{driverId},</if>
|
|
|
+ <if test="driverName != null">#{driverName},</if>
|
|
|
+ <if test="escortId != null">#{escortId},</if>
|
|
|
+ <if test="escortName != null">#{escortName},</if>
|
|
|
+ <if test="emergencyEquipment != null">#{emergencyEquipment},</if>
|
|
|
+ <if test="protection != null">#{protection},</if>
|
|
|
+ <if test="speed != null">#{speed},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCenterdataTHousingconstructionCar" parameterType="CenterdataTHousingconstructionCar">
|
|
|
+ update centerdata_t_housingconstruction_car
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createName != null">create_name = #{createName},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateName != null">update_name = #{updateName},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
+ <if test="deptName != null">dept_name = #{deptName},</if>
|
|
|
+ <if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
|
|
|
+ <if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
|
|
|
+ <if test="carNumber != null">car_number = #{carNumber},</if>
|
|
|
+ <if test="managerId != null">manager_id = #{managerId},</if>
|
|
|
+ <if test="managerName != null">manager_name = #{managerName},</if>
|
|
|
+ <if test="driverId != null">driver_id = #{driverId},</if>
|
|
|
+ <if test="driverName != null">driver_name = #{driverName},</if>
|
|
|
+ <if test="escortId != null">escort_id = #{escortId},</if>
|
|
|
+ <if test="escortName != null">escort_name = #{escortName},</if>
|
|
|
+ <if test="emergencyEquipment != null">emergency_equipment = #{emergencyEquipment},</if>
|
|
|
+ <if test="protection != null">protection = #{protection},</if>
|
|
|
+ <if test="speed != null">speed = #{speed},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCenterdataTHousingconstructionCarById" parameterType="String">
|
|
|
+ delete from centerdata_t_housingconstruction_car where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCenterdataTHousingconstructionCarByIds" parameterType="String">
|
|
|
+ delete from centerdata_t_housingconstruction_car where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|