|
@@ -4,22 +4,48 @@
|
|
|
|
|
|
<sql id="infoColumns">
|
|
<sql id="infoColumns">
|
|
a.id AS "id",
|
|
a.id AS "id",
|
|
- 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 AS "number",
|
|
|
|
- a.parent_node AS "parentNode",
|
|
|
|
- b.name AS "userName"
|
|
|
|
|
|
+ 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"
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
- <select id="get" resultType="WbsProject" >
|
|
|
|
|
|
+ <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
|
|
SELECT
|
|
<include refid="infoColumns"/>
|
|
<include refid="infoColumns"/>
|
|
- FROM sg_wbs_project a left join sys_user b on a.create_by = b.id
|
|
|
|
|
|
+ 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}
|
|
WHERE a.id = #{id}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -41,10 +67,12 @@
|
|
order by a.create_date DESC
|
|
order by a.create_date DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="getList" resultType="WbsProject" parameterType="com.jeeplus.modules.sg.project.entity.WbsSelection" >
|
|
|
|
|
|
+ <select id="getList" resultMap="projectResult" parameterType="com.jeeplus.modules.sg.project.entity.WbsSelection" >
|
|
SELECT
|
|
SELECT
|
|
<include refid="infoColumns"/>
|
|
<include refid="infoColumns"/>
|
|
- FROM sg_wbs_project a left join sys_user b on a.create_by = b.id
|
|
|
|
|
|
+ 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>
|
|
<where>
|
|
<if test="projectId !=null and projectId != ''">
|
|
<if test="projectId !=null and projectId != ''">
|
|
a.id = #{projectId} AND
|
|
a.id = #{projectId} AND
|
|
@@ -61,6 +89,21 @@
|
|
<if test="projectEndDate != null and projectEndDate != ''">
|
|
<if test="projectEndDate != null and projectEndDate != ''">
|
|
a.create_date <= #{projectEndDate} AND
|
|
a.create_date <= #{projectEndDate} AND
|
|
</if>
|
|
</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
|
|
1 = 1
|
|
</where>
|
|
</where>
|
|
ORDER BY a.update_date DESC
|
|
ORDER BY a.update_date DESC
|