123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- <?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.generalbusiness.mapper.CenterdataTKeyProjectsMapper">
- <resultMap type="CenterdataTKeyProjects" id="CenterdataTKeyProjectsResult">
- <result property="id" column="id"/>
- <result property="projectName" column="project_name"/>
- <result property="projectTarget" column="project_target"/>
- <result property="projectType" column="project_type"/>
- <result property="projectLevel" column="project_level"/>
- <result property="constructionUnit" column="construction_unit"/>
- <result property="principal" column="principal"/>
- <result property="phone" column="phone"/>
- <result property="constructionSite" column="construction_site"/>
- <result property="constructionArea" column="construction_area"/>
- <result property="longitude" column="longitude"/>
- <result property="latitude" column="latitude"/>
- <result property="createTime" column="create_time"/>
- <result property="photoId" column="photo_id"/>
- <result property="cameraSystem" column="camera_system"/>
- <result property="deptId" column="dept_id"/>
- <result property="deptName" column="dept_name"/>
- <result property="orderNum" column="order_num"/>
- <result property="introduction" column="introduction"/>
- <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="territoriality" column="territoriality"/>
- <result property="park" column="park"/>
- <result property="parkLongitude" column="park_longitude"/>
- <result property="parkLatitude" column="park_latitude"/>
- <result property="environment" column="environment"/>
- <result property="legalUnit" column="legal_unit"/>
- <result property="startTime" column="start_time"/>
- <result property="endTime" column="end_time"/>
- <result property="nature" column="nature"/>
- <result property="totalInvest" column="total_invest"/>
- <result property="yearInvest" column="year_invest"/>
- <result property="industryType" column="industry_type"/>
- <result property="secretary" column="secretary"/>
- <result property="secretaryDuties" column="secretary_duties"/>
- <result property="secretaryPhone" column="secretary_phone"/>
- <result property="parkLabel" column="parkLabel"/>
- <result property="projectId" column="project_id"/>
- </resultMap>
- <sql id="selectCenterdataTKeyProjectsVo">
- select id, project_name, project_target, project_type, project_level, construction_unit, principal, phone, construction_site, construction_area, longitude, latitude, camera_system, dept_id, dept_name, order_num, introduction,
- photo_id, create_time, create_by, create_name, update_time, update_by, update_name, territoriality, park, park_longitude, park_latitude, environment, legal_unit, start_time, end_time, nature, total_invest, year_invest, industry_type,
- secretary, secretary_duties, secretary_phone,project_id from centerdata_t_key_projects
- </sql>
- <select id="selectCenterdataTKeyProjectsList" parameterType="CenterdataTKeyProjects"
- resultMap="CenterdataTKeyProjectsResult">
- select a.* ,
- dd.dept_name as parkLabel
- from centerdata_t_key_projects a
- left join ${database_system}.sys_dept d ON d.dept_id = a.dept_id
- LEFT JOIN ${database_system}.sys_dept dd on dd.dept_id = a.park
- <where>
- <if test="projectName != null and projectName != ''">and project_name like concat('%', #{projectName},
- '%')
- </if>
- <if test="projectTarget != null and projectTarget != ''">and project_target = #{projectTarget}</if>
- <if test="projectType != null and projectType != ''">and project_type = #{projectType}</if>
- <if test="projectLevel != null and projectLevel != ''">and project_level = #{projectLevel}</if>
- <if test="constructionUnit != null and constructionUnit != ''">and construction_unit like concat('%', #{constructionUnit},'%')</if>
- <if test="principal != null and principal != ''">and principal = #{principal}</if>
- <if test="phone != null and phone != ''">and phone = #{phone}</if>
- <if test="constructionSite != null and constructionSite != ''">and construction_site =
- #{constructionSite}
- </if>
- <if test="constructionArea != null and constructionArea != ''">and construction_area =
- #{constructionArea}
- </if>
- <if test="longitude != null and longitude != ''">and longitude = #{longitude}</if>
- <if test="latitude != null and latitude != ''">and latitude = #{latitude}</if>
- <if test="cameraSystem != null and cameraSystem != ''">and camera_system = #{cameraSystem}</if>
- <if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
- <if test="introduction != null and introduction != ''">and introduction = #{introduction}</if>
- <if test="territoriality != null and territoriality != ''">and territoriality = #{territoriality}</if>
- <if test="park != null and park != ''">and park = #{park}</if>
- ${params.dataScope}
- </where>
- order by a.order_num,a.create_time desc
- </select>
- <select id="selectCenterdataTKeyProjectsById" parameterType="String" resultMap="CenterdataTKeyProjectsResult">
- <include refid="selectCenterdataTKeyProjectsVo"/>
- where id = #{id}
- </select>
- <insert id="insertCenterdataTKeyProjects" parameterType="CenterdataTKeyProjects">
- insert into centerdata_t_key_projects
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="projectName != null">project_name,</if>
- <if test="projectTarget != null">project_target,</if>
- <if test="projectType != null">project_type,</if>
- <if test="projectLevel != null">project_level,</if>
- <if test="constructionUnit != null">construction_unit,</if>
- <if test="principal != null">principal,</if>
- <if test="phone != null">phone,</if>
- <if test="constructionSite != null">construction_site,</if>
- <if test="constructionArea != null">construction_area,</if>
- <if test="longitude != null">longitude,</if>
- <if test="latitude != null">latitude,</if>
- <if test="cameraSystem != null">camera_system,</if>
- <if test="deptId != null and deptId != ''">dept_id,</if>
- <if test="deptName != null and deptName != ''">dept_name,</if>
- <if test="orderNum != null">order_num,</if>
- <if test="introduction != null">introduction,</if>
- <if test="photoId != null">photo_id,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createName != null">create_name,</if>
- <if test="updateName != null">update_name,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="territoriality != null">territoriality,</if>
- <if test="park != null">park,</if>
- <if test="parkLongitude != null">park_longitude,</if>
- <if test="parkLatitude != null">park_latitude,</if>
- <if test="environment != null">environment,</if>
- <if test="legalUnit != null">legal_unit,</if>
- <if test="startTime != null">start_time,</if>
- <if test="endTime != null">end_time,</if>
- <if test="nature != null">nature,</if>
- <if test="totalInvest != null">total_invest,</if>
- <if test="yearInvest != null">year_invest,</if>
- <if test="industryType != null">industry_type,</if>
- <if test="secretary != null">secretary,</if>
- <if test="secretaryDuties != null">secretary_duties,</if>
- <if test="secretaryPhone != null">secretary_phone,</if>
- <if test="message != null">message,</if>
- <if test="projectId != null">project_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="projectName != null">#{projectName},</if>
- <if test="projectTarget != null">#{projectTarget},</if>
- <if test="projectType != null">#{projectType},</if>
- <if test="projectLevel != null">#{projectLevel},</if>
- <if test="constructionUnit != null">#{constructionUnit},</if>
- <if test="principal != null">#{principal},</if>
- <if test="phone != null">#{phone},</if>
- <if test="constructionSite != null">#{constructionSite},</if>
- <if test="constructionArea != null">#{constructionArea},</if>
- <if test="longitude != null">#{longitude},</if>
- <if test="latitude != null">#{latitude},</if>
- <if test="cameraSystem != null">#{cameraSystem},</if>
- <if test="deptId != null and deptId != ''">#{deptId},</if>
- <if test="deptName != null and deptName != ''">#{deptName},</if>
- <if test="orderNum != null">#{orderNum},</if>
- <if test="introduction != null">#{introduction},</if>
- <if test="photoId != null">#{photoId},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createName != null">#{createName},</if>
- <if test="updateName != null">#{updateName},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="territoriality != null">#{territoriality},</if>
- <if test="park != null">#{park},</if>
- <if test="parkLongitude != null">#{parkLongitude},</if>
- <if test="parkLatitude != null">#{parkLatitude},</if>
- <if test="environment != null">#{environment},</if>
- <if test="legalUnit != null">#{legalUnit},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="endTime != null">#{endTime},</if>
- <if test="nature != null">#{nature},</if>
- <if test="totalInvest != null">#{totalInvest},</if>
- <if test="yearInvest != null">#{yearInvest},</if>
- <if test="industryType != null">#{industryType},</if>
- <if test="secretary != null">#{secretary},</if>
- <if test="secretaryDuties != null">#{secretaryDuties},</if>
- <if test="secretaryPhone != null">#{secretaryPhone},</if>
- <if test="message != null">#{message},</if>
- <if test="projectId != null">#{projectId},</if>
- </trim>
- </insert>
- <update id="updateCenterdataTKeyProjects" parameterType="CenterdataTKeyProjects">
- update centerdata_t_key_projects
- <trim prefix="SET" suffixOverrides=",">
- <if test="projectName != null">project_name = #{projectName},</if>
- <if test="projectTarget != null">project_target = #{projectTarget},</if>
- <if test="projectType != null">project_type = #{projectType},</if>
- <if test="projectLevel != null">project_level = #{projectLevel},</if>
- <if test="constructionUnit != null">construction_unit = #{constructionUnit},</if>
- <if test="principal != null">principal = #{principal},</if>
- <if test="phone != null">phone = #{phone},</if>
- <if test="constructionSite != null">construction_site = #{constructionSite},</if>
- <if test="constructionArea != null">construction_area = #{constructionArea},</if>
- <if test="longitude != null">longitude = #{longitude},</if>
- <if test="latitude != null">latitude = #{latitude},</if>
- <if test="cameraSystem != null">camera_system = #{cameraSystem},</if>
- <if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
- <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
- <if test="photoId != null">photo_id = #{photoId},</if>
- <if test="orderNum != null">order_num = #{orderNum},</if>
- <if test="introduction != null">introduction = #{introduction},</if>
- <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="territoriality != null">territoriality = #{territoriality},</if>
- <if test="park != null">park = #{park},</if>
- <if test="parkLongitude != null">park_longitude = #{parkLongitude},</if>
- <if test="parkLatitude != null">park_latitude = #{parkLatitude},</if>
- <if test="environment != null">environment = #{environment},</if>
- <if test="legalUnit != null">legal_unit = #{legalUnit},</if>
- <if test="startTime != null">start_time = #{startTime},</if>
- <if test="endTime != null">end_time = #{endTime},</if>
- <if test="nature != null">nature = #{nature},</if>
- <if test="totalInvest != null">total_invest = #{totalInvest},</if>
- <if test="yearInvest != null">year_invest = #{yearInvest},</if>
- <if test="industryType != null">industry_type = #{industryType},</if>
- <if test="secretary != null">secretary = #{secretary},</if>
- <if test="secretaryDuties != null">secretary_duties = #{secretaryDuties},</if>
- <if test="secretaryPhone != null">secretary_phone = #{secretaryPhone},</if>
- <if test="message != null">message = #{message},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteCenterdataTKeyProjectsByIds" parameterType="String">
- delete from centerdata_t_key_projects where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="getSelectScheduleById" parameterType="String" resultType="java.lang.String">
- SELECT
- GROUP_CONCAT( a.schedule_pictures ) schedulePictures
- FROM
- centerdata_t_key_projects_schedule a
- WHERE
- a.key_projects_id = #{id}
- GROUP BY
- a.schedule_time
- ORDER BY
- a.schedule_time DESC
- LIMIT 1
- </select>
- </mapper>
|