123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <?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.ruoyi.oa.mapper.CmcTechnicalMapper">
-
- <resultMap type="CmcTechnical" id="CmcTechnicalResult">
- <result property="technicalId" column="technical_id" />
- <result property="projectId" column="project_id" />
- <result property="technicalDirector" column="technical_director" />
- <result property="technicalDesigner" column="technical_designer" />
- <result property="technicalPlanner" column="technical_planner" />
- <result property="planComment" column="plan_comment" />
- <result property="qualityInspector" column="quality_inspector" />
- <result property="technicalTime" column="technical_time" />
- <result property="technicalDocument" column="technical_document" />
- <result property="modifyDocument" column="modify_document" />
- <result property="finalDocument" column="final_document" />
- <result property="designDescription" column="design_description" />
- <result property="technicalComment" column="technical_comment" />
- <result property="manageComment" column="manage_comment" />
- <result property="technicalUploadTime" column="technical_upload_time" />
- <result property="techApprovalTime" column="tech_approval_time" />
- <result property="manageApprovalTime" column="manage_approval_time" />
- <association property="directUser" javaType="SysUser" resultMap="DirectUserResult" />
- <association property="planUser" javaType="SysUser" resultMap="PlanUserResult" />
- <association property="designUser" javaType="SysUser" resultMap="DesignUserResult" />
- <association property="managerUser" javaType="SysUser" resultMap="ManagerUserResult" />
- <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
- </resultMap>
-
- <resultMap type="SysUser" id="DirectUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="direct_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="PlanUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="plan_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="DesignUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="design_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="ManagerUserResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="manager_nick_name" />
- </resultMap>
-
- <resultMap type="CmcProject" id="CmcProjectResult">
- <result property="projectId" column="project_id" />
- <result property="projectNumber" column="project_number" />
- <result property="projectName" column="project_name" />
- </resultMap>
-
- <sql id="selectCmcTechnicalVo">
- select t.technical_id, t.project_id, p.project_number, p.project_name, t.technical_director, u.nick_name as direct_nick_name, t.technical_designer, u1.nick_name as design_nick_name,
- t.technical_planner, u2.nick_name as plan_nick_name, t.plan_comment, t.quality_inspector, t.technical_time, t.technical_document, t.modify_document, t.final_document,
- t.design_description, t.technical_comment, t.manager_user_id, u3.nick_name as manager_nick_name, t.manage_comment, t.technical_upload_time, t.tech_approval_time, t.manage_approval_time from cmc_technical as t
- left join sys_user as u on u.user_id = t.technical_director
- left join sys_user as u1 on u1.user_id = t.technical_designer
- left join sys_user as u2 on u2.user_id = t.technical_planner
- left join sys_user as u3 on u3.user_id = t.manager_user_id
- left join cmc_project as p on p.project_id = t.project_id
- </sql>
-
- <select id="selectCmcTechnicalList" parameterType="CmcTechnical" resultMap="CmcTechnicalResult">
- <include refid="selectCmcTechnicalVo"/>
- <where>
- <if test="projectId != null and projectId != ''"> and t.project_id = #{projectId}</if>
- <if test="technicalDirector != null "> and t.technical_director = #{technicalDirector}</if>
- <if test="technicalDesigner != null "> and t.technical_designer = #{technicalDesigner}</if>
- <if test="technicalPlanner != null "> and t.technical_planner = #{technicalPlanner}</if>
- <if test="planComment != null and planComment != ''"> and t.plan_comment = #{planComment}</if>
- <if test="qualityInspector != null and qualityInspector != ''"> and t.quality_inspector = #{qualityInspector}</if>
- <if test="technicalTime != null "> and t.technical_time = #{technicalTime}</if>
- <if test="technicalDocument != null and technicalDocument != ''"> and t.technical_document = #{technicalDocument}</if>
- <if test="designDescription != null and designDescription != ''"> and t.design_description = #{designDescription}</if>
- <if test="technicalComment != null and technicalComment != ''"> and t.technical_comment = #{technicalComment}</if>
- <if test="managerUserId != null "> and t.manager_user_id = #{managerUserId}</if>
- <if test="manageComment != null and manageComment != ''"> and t.manage_comment = #{manageComment}</if>
- <if test="technicalUploadTime != null "> and t.technical_upload_time = #{technicalUploadTime}</if>
- <if test="techApprovalTime != null "> and t.tech_approval_time = #{techApprovalTime}</if>
- <if test="manageApprovalTime != null "> and t.manage_approval_time = #{manageApprovalTime}</if>
- </where>
- order by technical_time desc
- </select>
-
- <select id="selectCmcTechnicalByTechnicalId" parameterType="String" resultMap="CmcTechnicalResult">
- <include refid="selectCmcTechnicalVo"/>
- where t.technical_id = #{technicalId}
- </select>
-
- <insert id="insertCmcTechnical" parameterType="CmcTechnical">
- insert into cmc_technical
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="technicalId != null">technical_id,</if>
- <if test="projectId != null">project_id,</if>
- <if test="technicalDirector != null">technical_director,</if>
- <if test="technicalDesigner != null">technical_designer,</if>
- <if test="technicalPlanner != null">technical_planner,</if>
- <if test="planComment != null">plan_comment,</if>
- <if test="qualityInspector != null">quality_inspector,</if>
- <if test="technicalTime != null">technical_time,</if>
- <if test="technicalDocument != null">technical_document,</if>
- <if test="modifyDocument != null">modify_document,</if>
- <if test="finalDocument != null">final_document,</if>
- <if test="designDescription != null">design_description,</if>
- <if test="technicalComment != null">technical_comment,</if>
- <if test="managerUserId != null">manager_user_id,</if>
- <if test="manageComment != null">manage_comment,</if>
- <if test="technicalUploadTime != null">technical_upload_time,</if>
- <if test="techApprovalTime != null">tech_approval_time,</if>
- <if test="manageApprovalTime != null">manage_approval_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="technicalId != null">#{technicalId},</if>
- <if test="projectId != null">#{projectId},</if>
- <if test="technicalDirector != null">#{technicalDirector},</if>
- <if test="technicalDesigner != null">#{technicalDesigner},</if>
- <if test="technicalPlanner != null">#{technicalPlanner},</if>
- <if test="planComment != null">#{planComment},</if>
- <if test="qualityInspector != null">#{qualityInspector},</if>
- <if test="technicalTime != null">#{technicalTime},</if>
- <if test="technicalDocument != null">#{technicalDocument},</if>
- <if test="modifyDocument != null">#{modifyDocument},</if>
- <if test="finalDocument != null">#{finalDocument},</if>
- <if test="designDescription != null">#{designDescription},</if>
- <if test="technicalComment != null">#{technicalComment},</if>
- <if test="managerUserId != null">#{managerUserId},</if>
- <if test="manageComment != null">#{manageComment},</if>
- <if test="technicalUploadTime != null">#{technicalUploadTime},</if>
- <if test="techApprovalTime != null">#{techApprovalTime},</if>
- <if test="manageApprovalTime != null">#{manageApprovalTime},</if>
- </trim>
- </insert>
-
- <update id="updateCmcTechnical" parameterType="CmcTechnical">
- update cmc_technical
- <trim prefix="SET" suffixOverrides=",">
- <if test="projectId != null">project_id = #{projectId},</if>
- <if test="technicalDirector != null">technical_director = #{technicalDirector},</if>
- <if test="technicalDesigner != null">technical_designer = #{technicalDesigner},</if>
- <if test="technicalPlanner != null">technical_planner = #{technicalPlanner},</if>
- <if test="planComment != null">plan_comment = #{planComment},</if>
- <if test="qualityInspector != null">quality_inspector = #{qualityInspector},</if>
- <if test="technicalTime != null">technical_time = #{technicalTime},</if>
- <if test="technicalDocument != null">technical_document = #{technicalDocument},</if>
- <if test="modifyDocument != null">modify_document = #{modifyDocument},</if>
- <if test="finalDocument != null">final_document = #{finalDocument},</if>
- <if test="designDescription != null">design_description = #{designDescription},</if>
- <if test="technicalComment != null">technical_comment = #{technicalComment},</if>
- <if test="managerUserId != null">manager_user_id = #{managerUserId},</if>
- <if test="manageComment != null">manage_comment = #{manageComment},</if>
- <if test="technicalUploadTime != null">technical_upload_time = #{technicalUploadTime},</if>
- <if test="techApprovalTime != null">tech_approval_time = #{techApprovalTime},</if>
- <if test="manageApprovalTime != null">manage_approval_time = #{manageApprovalTime},</if>
- </trim>
- where technical_id = #{technicalId}
- </update>
-
- <delete id="deleteCmcTechnicalByTechnicalId" parameterType="String">
- delete from cmc_technical where technical_id = #{technicalId}
- </delete>
-
- <delete id="deleteCmcTechnicalByTechnicalIds" parameterType="String">
- delete from cmc_technical where technical_id in
- <foreach item="technicalId" collection="array" open="(" separator="," close=")">
- #{technicalId}
- </foreach>
- </delete>
- </mapper>
|