代码实战:
--村委会成员信息的奖惩 分别同步到奖励情况表和惩罚情况表
--该表奖惩信息一共多少 24奖励 惩罚
select "id",fk,name,adm_code,reward_date,reward_type,reward_description,punish_date,
punish_type,punish_description
from tb_village_committee_member where del_flag='0'
and ("length"(reward_type)!=0 or "length"(punish_type)!=0 )and fk!='2753mndfc4gfsrr57r4o2targj';
select * from tb_village_committee_member where del_flag='0' and "length"(punish_type)!=0 and fk!='2753mndfc4gfsrr57r4o2targj';
--同步到惩罚情况表
insert into tb_village_committee_member_punish(id,fk,adm_code,punish_date,punish_type,punish_description)
SELECT nextval('upms_log_id_seq'),"id",adm_code,punish_date,punish_type,punish_description FROM tb_village_committee_member
where del_flag='0' and "length"(punish_type)!=0 and fk!='2753mndfc4gfsrr57r4o2targj'
--同步奖励表
insert into tb_village_committee_member_rewards(id,fk,adm_code,reward_date,reward_type,reward_description)
SELECT nextval('upms_log_id_seq'),"id",adm_code,reward_date,reward_type,reward_description
FROM tb_village_committee_member
where del_flag='0' and "length"(reward_type)!=0 and fk!='2753mndfc4gfsrr57r4o2targj'