|
@@ -4,48 +4,22 @@
|
|
|
|
|
|
<sql id="infoColumns">
|
|
|
a.id AS "id",
|
|
|
- a.create_by,
|
|
|
- a.create_date ,
|
|
|
- a.update_by ,
|
|
|
- a.update_date ,
|
|
|
- a.remarks ,
|
|
|
- a.del_flag,
|
|
|
- a.project_name,
|
|
|
- a.number ,
|
|
|
- b.name ,
|
|
|
- d.item_name ,
|
|
|
- d.unit,
|
|
|
- d.type,
|
|
|
- d.project_id,
|
|
|
- d.create_date AS "d.create_date"
|
|
|
+ a.create_by AS "createBy.id",
|
|
|
+ a.create_date AS "createDate",
|
|
|
+ a.update_by AS "updateBy.id",
|
|
|
+ a.update_date AS "updateDate",
|
|
|
+ a.remarks AS "remarks",
|
|
|
+ a.del_flag AS "delFlag",
|
|
|
+ a.project_name AS "projectName",
|
|
|
+ a.number,
|
|
|
+ b.name AS "userName"
|
|
|
</sql>
|
|
|
|
|
|
- <resultMap id="projectResult" type="WbsProject">
|
|
|
- <id property="id" column="id"/>
|
|
|
- <result property="createBy.id" column="create_by"/>
|
|
|
- <result property="createDate" column="create_date"/>
|
|
|
- <result property="updateBy.id" column="update_by"/>
|
|
|
- <result property="updateDate" column="update_date"/>
|
|
|
- <result property="remarks" column="remarks"/>
|
|
|
- <result property="delFlag" column="del_flag"/>
|
|
|
- <result property="projectName" column="project_name"/>
|
|
|
- <result property="number" column="number"/>
|
|
|
- <result property="userName" column="name"/>
|
|
|
- <collection property="wbsItems" ofType="com.jeeplus.modules.sg.project.entity.WbsItem">
|
|
|
- <result property="itemName" column="item_name"/>
|
|
|
- <result property="unit" column="unit"/>
|
|
|
- <result property="type" column="type"/>
|
|
|
- <result property="projectId" column="project_id"/>
|
|
|
- <result property="createDate" column="d.create_date"/>
|
|
|
- </collection>
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <select id="get" resultMap="projectResult" >
|
|
|
+ <select id="get" resultType="WbsProject" >
|
|
|
SELECT
|
|
|
<include refid="infoColumns"/>
|
|
|
FROM sg_wbs_project a
|
|
|
left join sys_user b on a.create_by = b.id
|
|
|
- left join sg_wbs_item d on a.id = d.project_id
|
|
|
WHERE a.id = #{id}
|
|
|
</select>
|
|
|
|
|
@@ -67,12 +41,11 @@
|
|
|
order by a.create_date DESC
|
|
|
</select>
|
|
|
|
|
|
- <select id="getList" resultMap="projectResult" parameterType="com.jeeplus.modules.sg.project.entity.WbsSelection" >
|
|
|
- SELECT
|
|
|
+ <select id="findList" resultType="WbsProject">
|
|
|
+ SELECT
|
|
|
<include refid="infoColumns"/>
|
|
|
FROM sg_wbs_project a
|
|
|
left join sys_user b on a.create_by = b.id
|
|
|
- left join sg_wbs_item d on a.id = d.project_id
|
|
|
<where>
|
|
|
<if test="projectId !=null and projectId != ''">
|
|
|
a.id = #{projectId} AND
|
|
@@ -80,8 +53,8 @@
|
|
|
<if test="projectName != null and projectName != ''">
|
|
|
a.project_name LIKE CONCAT(CONCAT('%',#{projectName},'%')) AND
|
|
|
</if>
|
|
|
- <if test="createBy != null and createBy != ''">
|
|
|
- b.name LIKE CONCAT(CONCAT('%',#{createBy},'%')) AND
|
|
|
+ <if test="creator != null and creator != ''">
|
|
|
+ b.name LIKE CONCAT(CONCAT('%',#{creator},'%')) AND
|
|
|
</if>
|
|
|
<if test="projectStartDate != null and projectEndDate != ''">
|
|
|
a.create_date >= #{projectStartDate} AND
|
|
@@ -89,21 +62,6 @@
|
|
|
<if test="projectEndDate != null and projectEndDate != ''">
|
|
|
a.create_date <= #{projectEndDate} AND
|
|
|
</if>
|
|
|
- <if test="itemName != null and itemName != ''">
|
|
|
- d.item_name LIKE CONCAT(CONCAT('%',#{itemName},'%')) AND
|
|
|
- </if>
|
|
|
- <if test="type != null and type != ''">
|
|
|
- d.type LIKE CONCAT(CONCAT('%',#{type},'%')) AND
|
|
|
- </if>
|
|
|
- <if test="unit != null and unit != ''">
|
|
|
- d.unit LIKE CONCAT(CONCAT('%',#{unit},'%')) AND
|
|
|
- </if>
|
|
|
- <if test="itemStartDate != null and itemEndDate != ''">
|
|
|
- d.create_date >= #{itemStartDate} AND
|
|
|
- </if>
|
|
|
- <if test="itemEndDate != null and itemEndDate != ''">
|
|
|
- d.create_date <= #{itemEndDate} AND
|
|
|
- </if>
|
|
|
1 = 1
|
|
|
</where>
|
|
|
ORDER BY a.update_date DESC
|
|
@@ -173,10 +131,10 @@
|
|
|
|
|
|
|
|
|
<!--物理删除-->
|
|
|
- <update id="delete">
|
|
|
+ <delete id="delete">
|
|
|
DELETE FROM sg_wbs_project
|
|
|
WHERE id = #{id}
|
|
|
- </update>
|
|
|
+ </delete>
|
|
|
|
|
|
<!--逻辑删除-->
|
|
|
<update id="deleteByLogic">
|
|
@@ -192,7 +150,7 @@
|
|
|
</select>
|
|
|
|
|
|
<!-- 根据工程id查找项目 -->
|
|
|
- <select id="findItem" parameterType="String" resultMap="WbsProject">
|
|
|
+ <select id="findItem" parameterType="String" resultType="WbsProject">
|
|
|
select * From sg_wbs_item where project_id = #{id}
|
|
|
</select>
|
|
|
|