|
@@ -2,86 +2,59 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
<mapper namespace="com.bosshand.virgo.api.dao.ProjectDao">
|
|
|
|
|
|
- <resultMap type="com.bosshand.virgo.api.model.Project" id="projectResult">
|
|
|
+ <resultMap type="com.bosshand.virgo.api.model.Project" id="result">
|
|
|
<id column="id" property="id"/>
|
|
|
- <result column="projectName" property="projectName"/>
|
|
|
- <result column="description" property="description"/>
|
|
|
+ <result column="name" property="name"/>
|
|
|
<result column="createDate" property="createDate"/>
|
|
|
- <result column="status" property="status"/>
|
|
|
- <result column="typeId" property="typeId"/>
|
|
|
- <result column="projectMetaData" property="projectMetaData"/>
|
|
|
<result column="organizationId" property="organizationId"/>
|
|
|
- <result column="operateOrganizationId" property="operateOrganizationId"/>
|
|
|
- <result column="enableFlow" property="enableFlow"/>
|
|
|
- <result column="isLead" property="isLead"/>
|
|
|
- <result column="isUseFace" property="isUseFace"/>
|
|
|
- <result column="isUseChain" property="isUseChain"/>
|
|
|
- <result column="isUseBim" property="isUseBim"/>
|
|
|
- <result column="leadUrl" property="leadUrl"/>
|
|
|
- <result column="yuiProjectId" property="yuiProjectId"/>
|
|
|
- <result column="generateWeeklyDate" property="generateWeeklyDate"/>
|
|
|
- <result column="version" property="version"/>
|
|
|
- <collection property="projectItemList" ofType="com.bosshand.virgo.api.model.ProjectItem" resultMap="com.bosshand.virgo.api.dao.ProjectItemDao.projectItemResult" columnPrefix="projectItem_"/>
|
|
|
+ <result column="address" property="address"/>
|
|
|
+ <result column="picture" property="picture"/>
|
|
|
+ <result column="tagId" property="tagId"/>
|
|
|
+ <result column="comment" property="comment"/>
|
|
|
+ <result column="data" property="data"/>
|
|
|
</resultMap>
|
|
|
-
|
|
|
- <resultMap type="com.bosshand.virgo.api.model.Project" id="projectByOnlyResult">
|
|
|
+
|
|
|
+ <resultMap type="com.bosshand.virgo.api.model.Project" id="projectResult">
|
|
|
<id column="id" property="id"/>
|
|
|
- <result column="projectName" property="projectName"/>
|
|
|
- <result column="description" property="description"/>
|
|
|
+ <result column="name" property="name"/>
|
|
|
<result column="createDate" property="createDate"/>
|
|
|
- <result column="status" property="status"/>
|
|
|
- <result column="typeId" property="typeId"/>
|
|
|
- <result column="projectMetaData" property="projectMetaData"/>
|
|
|
<result column="organizationId" property="organizationId"/>
|
|
|
- <result column="operateOrganizationId" property="operateOrganizationId"/>
|
|
|
- <result column="enableFlow" property="enableFlow"/>
|
|
|
- <result column="isLead" property="isLead"/>
|
|
|
- <result column="isUseFace" property="isUseFace"/>
|
|
|
- <result column="isUseChain" property="isUseChain"/>
|
|
|
- <result column="isUseBim" property="isUseBim"/>
|
|
|
- <result column="leadUrl" property="leadUrl"/>
|
|
|
- <result column="yuiProjectId" property="yuiProjectId"/>
|
|
|
- <result column="version" property="version"/>
|
|
|
+ <result column="address" property="address"/>
|
|
|
+ <result column="picture" property="picture"/>
|
|
|
+ <result column="tagId" property="tagId"/>
|
|
|
+ <result column="comment" property="comment"/>
|
|
|
+ <result column="data" property="data"/>
|
|
|
+ <collection property="projectItemList" ofType="com.bosshand.virgo.api.model.ProjectItem" resultMap="com.bosshand.virgo.api.dao.ProjectItemDao.projectItemResult" columnPrefix="projectItem_"/>
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<sql id="ProjectQuery">
|
|
|
SELECT
|
|
|
p.*,
|
|
|
pi.id as projectItem_id,
|
|
|
pi.name as projectItem_name,
|
|
|
pi.createDate as projectItem_createDate,
|
|
|
- pi.organizationMap as projectItem_organizationMap,
|
|
|
- pi.status as projectItem_status,
|
|
|
- pi.yuiProjectItemId as projectItem_yuiProjectItemId,
|
|
|
- pi.yuiProjectItemTargets as projectItem_yuiProjectItemTargets,
|
|
|
- pi.type as projectItem_type,
|
|
|
- pi.bim as projectItem_bim,
|
|
|
- pi.bimIntegrateId as projectItem_bimIntegrateId,
|
|
|
- pi.number as projectItem_number,
|
|
|
- pi.bimIntegrateNumber as projectItem_bimIntegrateNumber
|
|
|
+ pi.area as projectItem_area,
|
|
|
+ pi.address as projectItem_address,
|
|
|
+ pi.picture as projectItem_picture,
|
|
|
+ pi.propertyCertificateNumber as projectItem_propertyCertificateNumber,
|
|
|
+ pi.tagId as projectItem_tagId,
|
|
|
+ pi.data as projectItem_data
|
|
|
FROM project p
|
|
|
left join project_item pi on p.id = pi.projectId
|
|
|
</sql>
|
|
|
-
|
|
|
- <sql id="ProjectQueryByOnly">
|
|
|
- SELECT * FROM project
|
|
|
- </sql>
|
|
|
-
|
|
|
- <sql id="ProjectTotalCount">
|
|
|
- SELECT count(*) FROM project
|
|
|
- </sql>
|
|
|
-
|
|
|
+
|
|
|
<select id="get" resultMap="projectResult">
|
|
|
<include refid="ProjectQuery"/>
|
|
|
where p.id=#{id}
|
|
|
</select>
|
|
|
-
|
|
|
- <select id="getByYuiProjectId" resultMap="projectResult">
|
|
|
- SELECT * FROM project where yuiProjectId = #{yuiProjectId} and status != 1
|
|
|
+
|
|
|
+ <select id="getProjectByOrganizationId" resultMap="result">
|
|
|
+ select * from project where organizationId = #{organizationId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insert" parameterType="com.bosshand.virgo.api.model.Project" useGeneratedKeys="true" keyProperty="id">
|
|
|
- INSERT INTO project(projectName, description, createDate, status, typeId, projectMetaData, organizationId, operateOrganizationId, isLead, isUseFace, isUseChain, isUseBim, leadUrl, yuiProjectId, generateWeeklyDate, version) VALUES (#{projectName}, #{description}, now(), #{status}, #{typeId}, #{projectMetaData}, #{organizationId}, #{operateOrganizationId}, #{isLead}, #{isUseFace}, #{isUseChain}, #{isUseBim}, #{leadUrl}, #{yuiProjectId}, #{generateWeeklyDate}, #{version})
|
|
|
+ INSERT INTO project(`name`, `createDate`, `organizationId`, `address`, `picture`, `tagId`, `comment`, `data`)
|
|
|
+ VALUES (#{name}, now(), #{organizationId}, #{address}, #{picture}, #{tagId}, #{comment}, #{data})
|
|
|
</insert>
|
|
|
|
|
|
<delete id="delete">
|
|
@@ -91,70 +64,37 @@
|
|
|
<update id="update" parameterType="com.bosshand.virgo.api.model.Project">
|
|
|
UPDATE project
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
- <if test="projectName!=null">projectName=#{projectName},</if>
|
|
|
- <if test="description!=null">description=#{description},</if>
|
|
|
+ <if test="name!=null">name=#{name},</if>
|
|
|
<if test="createDate!=null">createDate=#{createDate},</if>
|
|
|
- <if test="status!=0">status=#{status},</if>
|
|
|
- <if test="typeId!=null">typeId=#{typeId},</if>
|
|
|
<if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
|
- <if test="operateOrganizationId!=0">operateOrganizationId=#{operateOrganizationId},</if>
|
|
|
- <if test="projectMetaData!=null">projectMetaData=#{projectMetaData},</if>
|
|
|
- <if test="enableFlow!=null">enableFlow=#{enableFlow},</if>
|
|
|
- <if test="yuiProjectId!=0">yuiProjectId=#{yuiProjectId},</if>
|
|
|
- <if test="isUseFace!=-1">isUseFace=#{isUseFace},</if>
|
|
|
- <if test="version!=null">version=#{version},</if>
|
|
|
+ <if test="address!=null">address=#{address},</if>
|
|
|
+ <if test="picture!=null">picture=#{picture},</if>
|
|
|
+ <if test="tagId!=0">tagId=#{tagId},</if>
|
|
|
+ <if test="comment!=null">comment=#{comment},</if>
|
|
|
+ <if test="data!=null">data=#{data},</if>
|
|
|
</trim>
|
|
|
WHERE id=#{id}
|
|
|
</update>
|
|
|
-
|
|
|
- <select id="listByOrganizationId" parameterType="map" resultMap="projectResult">
|
|
|
- <include refid="ProjectQuery"/>
|
|
|
- where p.organizationId = #{organizationId} and p.status != 1
|
|
|
- </select>
|
|
|
|
|
|
- <select id="getOperateOrganizationId" parameterType="map" resultMap="projectResult">
|
|
|
- <include refid="ProjectQuery"/>
|
|
|
- where p.operateOrganizationId = #{operateOrganizationId} and p.status != 1
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getByList" parameterType="map" resultMap="projectResult">
|
|
|
- <include refid="ProjectQuery"/>
|
|
|
- where operateOrganizationId == 0 and p.status != 1
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getList" parameterType="map" resultMap="projectByOnlyResult">
|
|
|
- <include refid="ProjectQueryByOnly"/>
|
|
|
- <trim prefix="WHERE" prefixOverrides="AND|OR">
|
|
|
- <if test="organizationId != null">and organizationId = #{organizationId}</if>
|
|
|
- <if test="operateOrganizationId != null">and operateOrganizationId = #{operateOrganizationId}</if>
|
|
|
- <if test="projectName != null and projectName !=''">and projectName = #{projectName}</if>
|
|
|
+ <select id="getTotalCount" parameterType="com.bosshand.virgo.api.model.Project" resultType="Integer">
|
|
|
+ SELECT count(*) FROM project
|
|
|
+ <where>
|
|
|
+ <if test="organizationId != 0">and organizationId = #{organizationId}</if>
|
|
|
+ <if test="tagId != 0">and tagId = #{tagId}</if>
|
|
|
+ <if test="name != null and name !=''">and name = #{name}</if>
|
|
|
<if test="createDate != null and createDate !=''">and createDate = #{createDate}</if>
|
|
|
- and status != 1
|
|
|
- </trim>
|
|
|
- limit #{currIndex} , #{pageSize}
|
|
|
+ </where>
|
|
|
</select>
|
|
|
-
|
|
|
- <select id="getTotalCount" parameterType="map" resultType="Integer">
|
|
|
- <include refid="ProjectTotalCount"/>
|
|
|
- <trim prefix="WHERE" prefixOverrides="AND|OR">
|
|
|
- <if test="organizationId != null">and organizationId = #{organizationId}</if>
|
|
|
- <if test="operateOrganizationId != null">and operateOrganizationId = #{operateOrganizationId}</if>
|
|
|
- <if test="projectName != null and projectName !=''">and projectName = #{projectName}</if>
|
|
|
- <if test="createDate != null and createDate !=''">and createDate = #{createDate}</if>
|
|
|
- and status != 1
|
|
|
- </trim>
|
|
|
+
|
|
|
+ <select id="getLimit" resultMap="result">
|
|
|
+ SELECT * FROM operate_device
|
|
|
+ <where>
|
|
|
+ <if test="p.organizationId!=0">and id=#{od.organizationId}</if>
|
|
|
+ <if test="p.tagId != 0">and tagId = #{p.tagId}</if>
|
|
|
+ <if test="p.name!=null">and name=#{p.name}</if>
|
|
|
+ <if test="p.createDate!=null">and createDate in (${p.createDate})</if>
|
|
|
+ </where>
|
|
|
+ limit #{currIndex} , #{pageSize}
|
|
|
</select>
|
|
|
-
|
|
|
- <select id="getProjectIds" parameterType="list" resultType="com.bosshand.virgo.api.model.Project">
|
|
|
- select * from project where id in (
|
|
|
- <trim>
|
|
|
- <if test="list.size > 0">
|
|
|
- <foreach collection="list" item="item" index="index" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- ) and status != 1
|
|
|
- </select>
|
|
|
|
|
|
</mapper>
|