|
@@ -35,6 +35,39 @@
|
|
a.end_date AS "endDate",
|
|
a.end_date AS "endDate",
|
|
a.contract_name as "contractName"
|
|
a.contract_name as "contractName"
|
|
</sql>
|
|
</sql>
|
|
|
|
+ <sql id="newWorkContentContractinfoColumns">
|
|
|
|
+ cc.id AS "id",
|
|
|
|
+ cc.create_by AS "createBy.id",
|
|
|
|
+ cc.create_date AS "createDate",
|
|
|
|
+ cc.update_by AS "updateBy.id",
|
|
|
|
+ cc.update_date AS "updateDate",
|
|
|
|
+ cc.remarks AS "remarks",
|
|
|
|
+ cc.del_flag AS "delFlag",
|
|
|
|
+ cc.project_id AS "projectId",
|
|
|
|
+ cc.content_id AS "contentId",
|
|
|
|
+ cc.program_id AS "program.id",
|
|
|
|
+ cc.cnumber AS "cnumber",
|
|
|
|
+ cc.cont_cate AS "contCate",
|
|
|
|
+ cc.cont_attr AS "contAttr",
|
|
|
|
+ cc.letting_agent AS "lettingAgent",
|
|
|
|
+ cc.contractor AS "contractor",
|
|
|
|
+ cc.scope AS "scope",
|
|
|
|
+ cc.sign_date AS "signDate",
|
|
|
|
+ cc.effect_date AS "effectDate",
|
|
|
|
+ cc.titular_amt AS "titularAmt",
|
|
|
|
+ cc.true_amt AS "trueAmt",
|
|
|
|
+ cc.pledge_percent AS "pledgePercent",
|
|
|
|
+ cc.start_work_date AS "startWorkDate",
|
|
|
|
+ cc.end_work_date AS "endWorkDate",
|
|
|
|
+ cc.stop_percent AS "stopPercent",
|
|
|
|
+ cc.stop_amt AS "stopAmt",
|
|
|
|
+ cc.status AS "status",
|
|
|
|
+ cc.pay_type AS "payType",
|
|
|
|
+ cc.pay_amt AS "payAmt",
|
|
|
|
+ cc.start_date AS "startDate",
|
|
|
|
+ cc.end_date AS "endDate",
|
|
|
|
+ cc.contract_name as "contractName"
|
|
|
|
+ </sql>
|
|
|
|
|
|
|
|
|
|
<select id="get" resultType="com.jeeplus.modules.projectConstruction.entity.ConstructionContract" >
|
|
<select id="get" resultType="com.jeeplus.modules.projectConstruction.entity.ConstructionContract" >
|
|
@@ -162,27 +195,35 @@
|
|
|
|
|
|
<select id="findList" resultType="com.jeeplus.modules.projectConstruction.entity.ConstructionContract" >
|
|
<select id="findList" resultType="com.jeeplus.modules.projectConstruction.entity.ConstructionContract" >
|
|
SELECT
|
|
SELECT
|
|
- pr.project_name as 'projectName',
|
|
|
|
|
|
+ DISTINCT a.project_name as 'projectName',
|
|
sd.label as 'contCate',
|
|
sd.label as 'contCate',
|
|
- <include refid="workContentContractinfoColumns"/>
|
|
|
|
- FROM construction_contract a
|
|
|
|
- left join sys_dict sd on sd.value = a.cont_cate
|
|
|
|
- left join project_records pr on pr.id = a.project_id
|
|
|
|
|
|
+ <include refid="newWorkContentContractinfoColumns"/>
|
|
|
|
+ FROM rural_project_records a
|
|
|
|
+ left join construction_contract cc on cc.project_id = a.id
|
|
|
|
+ left join sys_dict sd on sd.value = cc.cont_cate
|
|
|
|
+ LEFT JOIN work_project_user w1 ON a.id = w1.project_id
|
|
<where>
|
|
<where>
|
|
- a.del_flag = 0
|
|
|
|
|
|
+ cc.del_flag = 0 AND a.project_type = '3' and a.status = 5
|
|
<if test="contractName != null and contractName !=''">
|
|
<if test="contractName != null and contractName !=''">
|
|
- AND a.contract_name LIKE concat('%',#{contractName},'%')
|
|
|
|
|
|
+ AND cc.contract_name LIKE concat('%',#{contractName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="projectName != null and projectName !=''">
|
|
|
|
+ AND a.project_name LIKE concat('%',#{projectName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
|
|
|
|
+ AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id} ))
|
|
</if>
|
|
</if>
|
|
<if test="cnumber != null and cnumber != ''">
|
|
<if test="cnumber != null and cnumber != ''">
|
|
- AND a.cnumber like concat('%',#{cnumber},'%')
|
|
|
|
|
|
+ AND cc.cnumber like concat('%',#{cnumber},'%')
|
|
</if>
|
|
</if>
|
|
<if test="startDate !=null">
|
|
<if test="startDate !=null">
|
|
- AND a.create_date >= #{startDate}
|
|
|
|
|
|
+ AND cc.create_date >= #{startDate}
|
|
</if>
|
|
</if>
|
|
<if test="endDate !=null">
|
|
<if test="endDate !=null">
|
|
- AND a.create_date < #{endDate}
|
|
|
|
|
|
+ AND cc.create_date < #{endDate}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
|
|
+ group by a.id
|
|
<choose>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy}
|
|
ORDER BY ${page.orderBy}
|
|
@@ -218,21 +259,30 @@
|
|
|
|
|
|
<select id="queryCount" resultType="int" >
|
|
<select id="queryCount" resultType="int" >
|
|
SELECT
|
|
SELECT
|
|
- count(1)
|
|
|
|
- FROM construction_contract a
|
|
|
|
|
|
+ DISTINCT count(DISTINCT a.id)
|
|
|
|
+ FROM rural_project_records a
|
|
|
|
+ left join construction_contract cc on cc.project_id = a.id
|
|
|
|
+ left join sys_dict sd on sd.value = cc.cont_cate
|
|
|
|
+ LEFT JOIN work_project_user w1 ON a.id = w1.project_id
|
|
<where>
|
|
<where>
|
|
- a.del_flag = 0
|
|
|
|
|
|
+ a.del_flag = 0 AND a.project_type = '3' and a.status = 5
|
|
<if test="contractName != null and contractName !=''">
|
|
<if test="contractName != null and contractName !=''">
|
|
- AND a.contract_name LIKE concat('%',#{contractName},'%')
|
|
|
|
|
|
+ AND cc.contract_name LIKE concat('%',#{contractName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="projectName != null and projectName !=''">
|
|
|
|
+ AND a.project_name LIKE concat('%',#{projectName},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
|
|
|
|
+ AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id} ))
|
|
</if>
|
|
</if>
|
|
<if test="cnumber != null and cnumber != ''">
|
|
<if test="cnumber != null and cnumber != ''">
|
|
- AND a.cnumber like concat('%',#{cnumber},'%')
|
|
|
|
|
|
+ AND cc.cnumber like concat('%',#{cnumber},'%')
|
|
</if>
|
|
</if>
|
|
<if test="startDate !=null">
|
|
<if test="startDate !=null">
|
|
- AND a.create_date >= #{startDate}
|
|
|
|
|
|
+ AND cc.create_date >= #{startDate}
|
|
</if>
|
|
</if>
|
|
<if test="endDate !=null">
|
|
<if test="endDate !=null">
|
|
- AND a.create_date < #{endDate}
|
|
|
|
|
|
+ AND cc.create_date < #{endDate}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|