Browse Source

网格作业修改

hotfix/yujt_opt
yujt 5 years ago
parent
commit
091a088666
  1. 208
      epdc-cloud-property/doc/kettle/screen-yushan/screen_ys_grid_rank_month_update.ktr
  2. 166
      epdc-cloud-property/doc/kettle/screen-yushan/screen_ys_grid_rank_month_update_year.ktr
  3. 60
      epdc-cloud-property/src/main/resources/mapper/activity/ActivityInfoDao.xml

208
epdc-cloud-property/doc/kettle/screen-yushan/screen_ys_grid_rank_month_update.ktr

@ -513,58 +513,6 @@
</connection>
<order>
</order>
<step>
<name>网格排名表</name>
<type>ExecSQL</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target_yushan</connection>
<execute_each_row>N</execute_each_row>
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>INSERT INTO ys_grid_rank (
cal_date,
name,
grid_id,
comm_id,
comm_name,
topic_num,
project_num,
create_time,
update_time
)
VALUES
(
DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m'), '${communityGrid}', ${gridId}, ${commId}, '${commName}', ${topic_num}, ${project_num}, NOW(), null
)</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
<delete_field/>
<read_field/>
<arguments>
</arguments>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>464</xloc>
<yloc>256</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>网格排名表年度数据清空</name>
<type>ExecSQL</type>
@ -581,7 +529,8 @@ VALUES
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>delete from ys_grid_rank where grid_id = ${gridId} and cal_date like YEAR (NOW());</sql>
<sql>delete from ys_grid_rank where grid_id = ${gridId} and cal_date like YEAR (NOW());
delete from ys_grid_rank where grid_id = ${gridId} and cal_date = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m');</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
@ -603,59 +552,6 @@ VALUES
<draw>Y</draw>
</GUI>
</step>
<step>
<name>网格治理排行表-月</name>
<type>ExecSQL</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target_yushan</connection>
<execute_each_row>N</execute_each_row>
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>INSERT INTO ys_grid_gov_rank (
comm_id,
comm_name,
cal_date,
grid_name,
grid_id,
project_num,
project_finish_num,
finish_rate,
create_time,
update_time
)
VALUES
(
${commId}, '${commName}', DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m'), '${communityGrid}', ${gridId}, ${project_num}, ${finish_project_num}, IFNULL(${finish_project_num} / ${project_num}, 0), NOW(), null
)</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
<delete_field/>
<read_field/>
<arguments>
</arguments>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>464</xloc>
<yloc>480</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>网格治理排行表清空-年</name>
<type>ExecSQL</type>
@ -672,7 +568,9 @@ VALUES
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>delete from ys_grid_gov_rank where grid_id = ${gridId} and cal_date like YEAR (NOW());</sql>
<sql>delete from ys_grid_gov_rank where grid_id = ${gridId} and cal_date like YEAR (NOW());
delete from ys_grid_gov_rank where grid_id = ${gridId} and cal_date = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m');
</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
@ -689,60 +587,7 @@ VALUES
</output>
</remotesteps>
<GUI>
<xloc>624</xloc>
<yloc>480</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>网格注册信息表</name>
<type>ExecSQL</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target_yushan</connection>
<execute_each_row>N</execute_each_row>
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>INSERT INTO ys_grid_reg (
comm_id,
comm_name,
cal_date,
name,
grid_id,
reg_user_num,
reg_party_num,
reg_group_num,
create_time,
update_time
)
VALUES
(
${commId}, '${commName}', DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m'), '${communityGrid}', ${gridId}, ${reg_user_num}, ${reg_party_num}, ${reg_group_num}, NOW(), null
)</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
<delete_field/>
<read_field/>
<arguments>
</arguments>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>464</xloc>
<xloc>800</xloc>
<yloc>368</yloc>
<draw>Y</draw>
</GUI>
@ -763,7 +608,8 @@ VALUES
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>delete from ys_grid_reg where grid_id = ${gridId} and cal_date like YEAR (NOW());</sql>
<sql>delete from ys_grid_reg where grid_id = ${gridId} and cal_date like YEAR (NOW());
delete from ys_grid_reg where grid_id = ${gridId} and cal_date = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m');</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
@ -785,44 +631,6 @@ VALUES
<draw>Y</draw>
</GUI>
</step>
<step>
<name>清空网格治理排行表</name>
<type>ExecSQL</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target_yushan</connection>
<execute_each_row>N</execute_each_row>
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>delete from ys_grid_gov_rank where grid_id = ${gridId} and cal_date like YEAR (NOW())</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
<delete_field/>
<read_field/>
<arguments>
</arguments>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>800</xloc>
<yloc>256</yloc>
<draw>Y</draw>
</GUI>
</step>
<step_error_handling>
</step_error_handling>
<slave-step-copy-partition-distribution>

166
epdc-cloud-property/doc/kettle/screen-yushan/screen_ys_grid_rank_month_update_year.ktr

@ -565,6 +565,59 @@ VALUES
<draw>Y</draw>
</GUI>
</step>
<step>
<name>网格治理排行表-年</name>
<type>ExecSQL</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target_yushan</connection>
<execute_each_row>N</execute_each_row>
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>INSERT INTO ys_grid_gov_rank (
comm_id,
comm_name,
cal_date,
grid_name,
grid_id,
project_num,
project_finish_num,
finish_rate,
create_time,
update_time
)
VALUES
(
${commId}, '${commName}', DATE_FORMAT(CURDATE(), '%Y'), '${communityGrid}', ${gridId}, ${project_num_year}, ${finish_project_num_year}, IFNULL(${finish_project_num_year} / ${project_num_year}, 0), NOW(), null
)</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
<delete_field/>
<read_field/>
<arguments>
</arguments>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>464</xloc>
<yloc>448</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>网格注册信息表</name>
<type>ExecSQL</type>
@ -619,7 +672,59 @@ VALUES
</GUI>
</step>
<step>
<name>网格治理排行表-年</name>
<name>网格排名表 2</name>
<type>ExecSQL</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target_yushan</connection>
<execute_each_row>N</execute_each_row>
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>INSERT INTO ys_grid_rank (
cal_date,
name,
grid_id,
comm_id,
comm_name,
topic_num,
project_num,
create_time,
update_time
)
VALUES
(
DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m'), '${communityGrid}', ${gridId}, ${commId}, '${commName}', ${topic_num}, ${project_num}, NOW(), null
)</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
<delete_field/>
<read_field/>
<arguments>
</arguments>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>608</xloc>
<yloc>256</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>网格治理排行表-月</name>
<type>ExecSQL</type>
<description/>
<distribute>Y</distribute>
@ -648,7 +753,7 @@ VALUES
)
VALUES
(
${commId}, '${commName}', DATE_FORMAT(CURDATE(), '%Y'), '${communityGrid}', ${gridId}, ${project_num_year}, ${finish_project_num_year}, IFNULL(${finish_project_num_year} / ${project_num_year}, 0), NOW(), null
${commId}, '${commName}', DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m'), '${communityGrid}', ${gridId}, ${project_num}, ${finish_project_num}, IFNULL(${finish_project_num} / ${project_num}, 0), NOW(), null
)</sql>
<set_params>N</set_params>
<insert_field/>
@ -666,8 +771,61 @@ VALUES
</output>
</remotesteps>
<GUI>
<xloc>464</xloc>
<yloc>448</yloc>
<xloc>608</xloc>
<yloc>480</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>网格注册信息表 2</name>
<type>ExecSQL</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>target_yushan</connection>
<execute_each_row>N</execute_each_row>
<single_statement>N</single_statement>
<replace_variables>Y</replace_variables>
<quoteString>N</quoteString>
<sql>INSERT INTO ys_grid_reg (
comm_id,
comm_name,
cal_date,
name,
grid_id,
reg_user_num,
reg_party_num,
reg_group_num,
create_time,
update_time
)
VALUES
(
${commId}, '${commName}', DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m'), '${communityGrid}', ${gridId}, ${reg_user_num}, ${reg_party_num}, ${reg_group_num}, NOW(), null
)</sql>
<set_params>N</set_params>
<insert_field/>
<update_field/>
<delete_field/>
<read_field/>
<arguments>
</arguments>
<attributes/>
<cluster_schema/>
<remotesteps>
<input>
</input>
<output>
</output>
</remotesteps>
<GUI>
<xloc>608</xloc>
<yloc>368</yloc>
<draw>Y</draw>
</GUI>
</step>

60
epdc-cloud-property/src/main/resources/mapper/activity/ActivityInfoDao.xml

@ -67,42 +67,34 @@
</select>
<select id="listActivity" resultType="com.elink.esua.epdc.dto.activity.result.ActivityInfoResultDTO">
SELECT
a.ID,
a.TITLE,
a.HEAD_PIC,
s.FRONT_STYLE,
s.NAME AS CATEGORY_NAME,
a.ACT_START_TIME,
a.ACT_END_TIME,
a.ACT_QUOTA_FLAG,
a.ACT_QUOTA,
a.SIGN_UP_NUM,
(
CASE
WHEN p.id IS NULL THEN
'1'
ELSE
'0'
END
) AS SIGN_UP_FLAG
a.ID,
a.TITLE,
a.HEAD_PIC,
s.FRONT_STYLE,
s.NAME AS CATEGORY_NAME,
a.ACT_START_TIME,
a.ACT_END_TIME,
a.ACT_QUOTA_FLAG,
a.ACT_QUOTA,
a.SIGN_UP_NUM,
( CASE WHEN p.id IS NULL THEN '1' ELSE '0' END ) AS SIGN_UP_FLAG
FROM
epdc_activity_info a
LEFT JOIN epdc_section_category s ON a.CATEGORY_CODE = s. CODE
LEFT JOIN epdc_activity_participant p ON a.ID = p.ACT_ID
AND p.USER_ID = #{userId}
epdc_activity_info a
LEFT JOIN epdc_section_category s ON a.CATEGORY_CODE = s. CODE
LEFT JOIN epdc_activity_participant p ON a.ID = p.ACT_ID
AND p.USER_ID = #{userId}
WHERE
a.DEL_FLAG = '0'
AND a.ACT_STATUS = '1'
<if test="activityState == '0' or activityState == 0">
AND a.SIGN_UP_START_TIME &lt;= NOW()
AND a.ACT_END_TIME &gt;= NOW()
AND a.PUBLISH_TIME &lt;= NOW()
</if>
<if test="activityState == '1' or activityState == 1">
AND a.ACT_END_TIME &lt;= NOW()
</if>
GROUP BY
a.id
a.DEL_FLAG = '0' AND a.ACT_STATUS = '1'
<if test="activityState == '0' or activityState == 0">
AND a.SIGN_UP_START_TIME &lt;= NOW()
AND a.ACT_END_TIME &gt;= NOW()
AND a.PUBLISH_TIME &lt;= NOW()
</if>
<if test="activityState == '1' or activityState == 1">
AND a.ACT_END_TIME &lt;= NOW()
</if>
AND a.CREATED_TIME &lt;= STR_TO_DATE( #{timestamp}, '%Y-%m-%d %H:%i:%s' )
GROUP BY a.id
ORDER BY a.CREATED_TIME DESC
LIMIT #{pageIndex}, #{pageSize};
</select>

Loading…
Cancel
Save