|
@@ -0,0 +1,136 @@
|
|
|
+<?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.jeeplus.test.cw.projectRecords.mapper.CwProjectRecordsMapper">
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO">
|
|
|
+ <id property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
|
|
|
+ <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
|
|
|
+
|
|
|
+ <result property="projectNumber" column="project_number" jdbcType="VARCHAR"/>
|
|
|
+ <result property="projectName" column="project_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="officeDTO.id" column="office_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="projectMoney" column="project_money" jdbcType="VARCHAR"/>
|
|
|
+ <result property="auditYear" column="audit_year" jdbcType="VARCHAR"/>
|
|
|
+ <result property="planStartDate" column="plan_start_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="planEndDate" column="plan_end_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="projectMaster.id" column="project_master_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="projectLeader.id" column="project_leader_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="procInsId" column="proc_ins_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="processDefinitionId" column="process_definition_id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="status" column="status" jdbcType="VARCHAR"/>
|
|
|
+ <collection property="cwProjectClientInfoDTOList" ofType="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientInfoDTO" column="id" select="getProjectClient"></collection>
|
|
|
+ <collection property="workAttachmentDtoList" ofType="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto" column="id" select="getFileList"></collection>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="AttachmentMap" type="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto">
|
|
|
+ <id property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createBy.name" column="create_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
|
|
|
+ <result property="url" column="url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="name" column="attachment_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="size" column="file_size" jdbcType="VARCHAR"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ a.id,
|
|
|
+ a.create_by,
|
|
|
+ a.create_date,
|
|
|
+ a.update_by,
|
|
|
+ a.update_date,
|
|
|
+ a.del_flag,
|
|
|
+ a.remarks,
|
|
|
+ a.project_number,
|
|
|
+ a.project_name,
|
|
|
+ a.office_id,
|
|
|
+ a.project_money,
|
|
|
+ a.audit_year,
|
|
|
+ a.plan_start_date,
|
|
|
+ a.plan_end_date,
|
|
|
+ a.project_master_id,
|
|
|
+ a.project_leader_id,
|
|
|
+ a.proc_ins_id,
|
|
|
+ a.status,
|
|
|
+ a.process_definition_id
|
|
|
+ </sql>
|
|
|
+ <sql id="File_Column_List">
|
|
|
+ wa.id,
|
|
|
+ wa.create_by,
|
|
|
+ wa.create_date,
|
|
|
+ wa.update_by,
|
|
|
+ wa.update_date,
|
|
|
+ wa.remarks,
|
|
|
+ wa.del_flag,
|
|
|
+ wa.url,
|
|
|
+ wa.type,
|
|
|
+ wa.attachment_id,
|
|
|
+ wa.attachment_name,
|
|
|
+ wa.attachment_flag,
|
|
|
+ wa.module_type,
|
|
|
+ wa.attachment_type,
|
|
|
+ wa.file_size,
|
|
|
+ wa.sort,
|
|
|
+ wa.description
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="Project_Client_List">
|
|
|
+ cw_pci.project_id,
|
|
|
+ cw_pci.client_id,
|
|
|
+ cw_wcb.no as "clientNumber",
|
|
|
+ cw_wcb.name as "clientName",
|
|
|
+ cw_wcb.company_level as "companyLevel",
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getProjectClient" resultType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientTypeDTO">
|
|
|
+ select
|
|
|
+ <include refid="Project_Client_List"></include>
|
|
|
+ from cw_project_client_info cw_pci
|
|
|
+ left join cw_work_client_base cw_wcb on cw_wcb.id = cw_pci.client_id
|
|
|
+ where cw_wct.del_flag = '0' and cw_pci.project_id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getFileList" resultMap="AttachmentMap">
|
|
|
+ select
|
|
|
+ <include refid="File_Column_List"></include>,
|
|
|
+ su.name as create_name
|
|
|
+ from work_attachment wa
|
|
|
+ left join sys_user su on su.id = wa.create_by and su.del_flag = '0'
|
|
|
+ where wa.del_flag = '0' and wa.attachment_id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findList" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"></include>
|
|
|
+ from cw_work_client_base a
|
|
|
+ ${ew.customSqlSegment}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryById" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"></include>
|
|
|
+ from cw_work_client_base a
|
|
|
+ where a.del_flag = '0' and a.id = ${id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <delete id="deleteProjectClientInfoByProjectId">
|
|
|
+ delete from cw_project_client_info from project_id = #{projectId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <insert id="insertProjectClientInfoList">
|
|
|
+ <foreach collection="cwProjectClientInfoList" item="item" separator=";">
|
|
|
+ insert into cw_project_client_info(project_id,client_id) values(#{item.projectId},#{item.clientId})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+</mapper>
|