病害虫分類及び害虫グループ付き m_byochu

このトピックの投稿一覧へ

なし 病害虫分類及び害虫グループ付き m_byochu

msg# 1.3.2.2
depth:
3
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 .2 | 投稿日時 2010.11.03 17:12 | 最終変更
OhYeah!  管理人   投稿数: 983 オンライン
さらに、alias フィールドを追加して、既知の害虫グループについては別名として害虫グループ名を入れるようにしました。ただし、害虫グループの分類がちゃんとできているかどうかは検証していません。
害虫グループの登録に関しては、思ったより時間がかかりませんでした。

なお、害虫名では「イネアオムシ」、「ワタヘリクロノメイガ」を別名として追加しています。病害名では、晩腐病のみ別名を登録しています。雑草の地方名なども別名に追加すると良いかもしれません。

--/d
drop table if exists t_byochu;
create temp table t_byochu as select distinct byochu from m_tekiyo order by byochu;
drop table if exists m_byochu;
create table m_byochu (idbyochu integer primary key autoincrement, byochu varchar unique, cid integer, alias varchar);
begin transaction;
insert into m_byochu (byochu, cid) select byochu, 0 from t_byochu where ifnullstr(byochu, '-') != '-';
--分類処理
update m_byochu set cid = 4 where byochu in (select distinct byochu from m_tekiyo where mokuteki = '忌避' or bango in (select bango from m_kihon where koka like '%忌避%'));
update m_byochu set cid = 3 where byochu in (select distinct byochu from m_tekiyo where mokuteki in ('誘引', '交尾阻害') or bango in (select bango from m_kihon where yoto like '殺虫%' or koka like '%誘引' or koka like '%殺虫%'));
update m_byochu set cid = 1 where byochu like '%雑草%' or byochu in (select distinct byochu from m_tekiyo where bango in (select bango from m_kihon where yoto = '除草剤'));
update m_byochu set cid = 2 where byochu like '%病%' or byochu like'%症%' or byochu like '%菌%' or byochu like '%腐%' or byochu like '%タケ';
update m_byochu set cid = 0 where byochu like '活性化%' or byochu like '%覚醒%';
--分類例外処理
update m_byochu set cid = 3 where byochu like '%ナメクジ';
update m_byochu set cid = 4 where byochu in ('イノシシ', 'カモシカ', 'ニホンジカ', 'モグラ', '野ウサギ', '野ソ', '害獣');
--害虫G優先処理1
update m_byochu set alias = 'アリG' where cid = 3 and byochu like '%アリ%';
update m_byochu set alias = 'ケラG' where cid = 3 and byochu like '%ケラ%';
update m_byochu set alias = 'コガG' where cid = 3 and byochu like '%コガ%';
update m_byochu set alias = 'セミG' where cid = 3 and byochu like '%ゼミ%';
update m_byochu set alias = 'ダニG' where cid = 3 and byochu like '%ダニ%';
update m_byochu set alias = 'ヤガG' where cid = 3 and byochu like '%ヤガ%';
--害虫G優先処理2
update m_byochu set alias = 'スズメガG' where cid = 3 and byochu like '%スズメ%';
update m_byochu set alias = 'アゲハG' where byochu like '%アゲハ%';
update m_byochu set alias = 'ケムシG' where byochu like '%ケムシ%';
update m_byochu set alias = 'イラガG' where byochu like '%イラガ%';
update m_byochu set alias = 'ウスバG' where byochu like '%ウスバ%';
update m_byochu set alias = 'ウンカG' where byochu like '%ウンカ%';
update m_byochu set alias = 'カレハガG' where byochu like '%カレハ%';
update m_byochu set alias = 'キバチG' where byochu like '%キバチ%';
update m_byochu set alias = 'シジミチョウG' where byochu like '%シジミ%';
update m_byochu set alias = 'シャクガG' where byochu like '%シャク%';
update m_byochu set alias = 'チビガG' where byochu like '%チビガ%';
update m_byochu set alias = 'トラガG' where byochu like '%トラガ%';
update m_byochu set alias = 'トリバガG' where byochu like '%トリバ%';
update m_byochu set alias = 'ネダニG' where byochu like '%ネダニ%';
update m_byochu set alias = 'ハダニG' where byochu like '%ハダニ%';
update m_byochu set alias = 'ハバチG' where byochu like '%ハバチ%';
update m_byochu set alias = 'ハムシG' where byochu like '%ハムシ%';
update m_byochu set alias = 'ヒトリガG' where byochu like '%ヒトリ%';
update m_byochu set alias = 'ミバエG' where byochu like '%ミバエ%';
update m_byochu set alias = 'ヨトウG' where byochu like '%ヨトウ%';
update m_byochu set alias = 'イナゴ・バッタG' where byochu like '%イナゴ%' or byochu like '%バッタ%';
update m_byochu set alias = 'ウワバG' where byochu like '%ウワバ%' or byochu like '%シタバ%' or byochu like '%キノカワガ' or byochu like '%ツメクサガ';
update m_byochu set alias = 'コガネムシ・ブイブイG' where byochu like '%コガネ%' or byochu like '%ドウガネ%' or byochu like 'ハナムグリ' or byochu like '%ブイブイ%';
update m_byochu set alias = 'コナガ・スガG' where byochu like '%コナガ%' or byochu like '%スムシ%' ;
update m_byochu set alias = 'ミノガ・ミノムシG' where byochu like '%ミノガ%' or byochu like '%ミノムシ%' ;
update m_byochu set alias = 'ツトガG' where byochu like '%ツトガ%' or byochu like '%ツトムシ%';
update m_byochu set alias = 'メイガG' where byochu like '%メイガ%' or byochu like '%メイチュウ%' or byochu like '%ツヅリガ%';
update m_byochu set alias = 'ホソガ・カワモグリG' where byochu like '%ホソガ%' or byochu like '%カワモグリ%'; -- ハマキガより前に実行
update m_byochu set alias = 'シンクイガ・シンクイムシG' where byochu like '%シンクイ%'; -- キクイムシより前に実行
update m_byochu set alias = 'ハマキガG' where byochu like '%ハマキ%' or byochu like '%サヤムシ%' or byochu like '%カワモグリガ%'; -- ハマキモドキより前に実行
update m_byochu set alias = 'マイマイ・カタツムリG' where byochu like '%マイマイ%' or byochu like '%カタツムリ%'; -- マイマイガより前に実行
update m_byochu set alias = 'マイマイ・ドクガG' where byochu like '%ドクガ%' or byochu like '%マイマイガ%';
--別名優先処理3
update m_byochu set alias = 'カメムシG' where byochu like '%カメムシ%'; -- ナガカメムシより前に実行
update m_byochu set alias = 'ゾウムシG' where byochu like '%ゾウムシ%'; -- チョッキリより前に実行
update m_byochu set alias = 'テントウムシG' where byochu like '%テントウ%'; -- テントウムシダマシより前に実行
update m_byochu set alias = 'ハモグリガG' where byochu like '%ハモグリ%'; -- ハモグリバエより前に実行
update m_byochu set alias = 'アブラムシG' where byochu like '%アブラムシ%' or byochu like '%ワタムシ%'; -- ネアブラムシ、タマワタムシより前に実行
update m_byochu set alias = 'カイガラムシG' where byochu like '%カイガラムシ%'; -- コナカイガラムシ、ロウカイガラムシより前に実行
--害虫G通常処理
update m_byochu set alias = 'アオムシG' where byochu like '%アオムシ%';
update m_byochu set alias = 'ジャガイモガ・イモコガG' where byochu like '%イモコガ%' or byochu like '%ジャガイモガ%';
update m_byochu set alias = 'ガガンボG' where byochu like '%ガガンボ%';
update m_byochu set alias = 'カミキリムシG' where byochu like '%カミキリ%' or byochu like '%マツクイムシ%';
update m_byochu set alias = 'ハモグリバエ・キモグリバエ・カラバエ・ミギワバエG' where byochu like '%カラバエ%' or byochu like '%キノコバエ%' or byochu like '%モグリバエ%' or byochu like '%ショウジョウバエ%';
update m_byochu set alias = 'キジラミG' where byochu like '%キジラミ%';
update m_byochu set alias = 'クスサンG' where byochu like '%クスサン%';
update m_byochu set alias = 'グンバイムシG' where byochu like '%グンバイ%';
update m_byochu set alias = 'コオロギ・カネタタキG' where byochu like '%コオロギ%' or byochu like '%カネタタキ%';
update m_byochu set alias = 'コナダニG' where byochu like '%コナダニ%';
update m_byochu set alias = 'コメツキムシG' where byochu like '%コメツキ%' or byochu like '%ハリガネムシ%';
update m_byochu set alias = 'サビダニG' where byochu like '%サビダニ%';
update m_byochu set alias = 'スカシバG' where byochu like '%スカシバ%';
update m_byochu set alias = 'タネバエ・ハナバエG' where byochu like '%タネバエ%' or byochu like 'ハナバエ';
update m_byochu set alias = 'ヤガG' where byochu like '%タバコガ%' or byochu like '%ネキリムシ%';
update m_byochu set alias = 'タマバエG' where byochu like '%タマバエ%';
update m_byochu set alias = 'タマバチG' where byochu like '%タマバチ%';
update m_byochu set alias = 'タマムシG' where byochu like '%タマムシ%';
update m_byochu set alias = 'トビムシG' where byochu like '%トビムシ%';
update m_byochu set alias = 'ナメクジG' where byochu like '%ナメクジ%';
update m_byochu set alias = 'ヨコバイG' where byochu like '%ヨコバイ%';
update m_byochu set alias = 'ハゴロモG' where byochu like '%ハゴロモ%';
update m_byochu set alias = 'カキヘタノムシガ・マイコガG' where byochu like '%マイコガ%' or byochu like '%カキヘタノムシガ%';
update m_byochu set alias = 'ムギダニG' where byochu like '%ムギダニ%';
update m_byochu set alias = 'ロウムシ・ロウカイガラムシG' where byochu like '%ロウムシ%' or '%ロウカイガラムシ%';
update m_byochu set alias = 'アザミウマG' where byochu like '%アザミウマ%';
update m_byochu set alias = 'カスミカメG' where byochu like '%カスミカメ%';
update m_byochu set alias = 'カブトムシG' where byochu like '%カブトムシ%';
update m_byochu set alias = 'キクイムシG' where byochu like '%キクイムシ%' or byochu like '%ヒメコシンクイ%';
update m_byochu set alias = 'ケシキスイG' where byochu like '%ケシキスイ%';
update m_byochu set alias = 'コウモリガG' where byochu like '%コウモリガ%';
update m_byochu set alias = 'コナジラミG' where byochu like '%コナジラミ%';
update m_byochu set alias = 'ホコリダニG' where byochu like '%ホコリダニ%';
update m_byochu set alias = 'シバンムシG' where byochu like '%シバンムシ%';
update m_byochu set alias = 'シャチホコガG' where byochu like '%シャチホコ%';
update m_byochu set alias = 'センチュウG' where byochu like '%センチュウ%';
update m_byochu set alias = 'タネコバチG' where byochu like '%タネコバチ%';
update m_byochu set alias = 'ダンゴムシG' where byochu like '%ダンゴムシ%';
update m_byochu set alias = 'チョッキリG' where byochu like '%チョッキリ%';
update m_byochu set alias = 'ハンミョウG' where byochu like '%ハンミョウ%';
update m_byochu set alias = 'ヒラタムシG' where byochu like '%ヒラタムシ%';
update m_byochu set alias = 'ヒロズコガG' where byochu like '%ヒロズコガ%';
update m_byochu set alias = 'リンゴガイG' where byochu like '%リンゴガイ%';
update m_byochu set alias = 'タマワタムシG' where byochu like '%タマワタムシ%';
update m_byochu set alias = 'ナガカメムシG' where byochu like '%ナガカメムシ%';
update m_byochu set alias = 'ハマキモドキG' where byochu like '%ハマキモドキ%';
update m_byochu set alias = 'ネアブラムシG' where byochu like '%ネアブラムシ%';
update m_byochu set alias = 'コナカイガラムシG' where byochu like '%コナカイガラムシ%';
update m_byochu set alias = 'クロバネキノコバエG' where byochu like '%クロバネキノコバエ%';
update m_byochu set alias = 'テントウムシダマシG' where byochu like '%テントウムシダマシ%' or byochu like '%ニジュウヤホシテントウ%';
--害虫G例外処理
update m_byochu set alias = 'アリG' where byochu = 'アイノキクイムシ';
update m_byochu set alias = 'カイガラムシG' where byochu = 'キュウコンコナカイガラムシ';
update m_byochu set alias = 'カスミカメG' where byochu like '%コバネナガガメムシ';
update m_byochu set alias = 'カメムシG' where byochu = 'ウスモンミドリカスミカメ';
update m_byochu set alias = 'タネバエ・ハナバエG' where byochu in ('ダイコンバエ', 'タマネギバエ');
update m_byochu set alias = 'タマワタムシG' where byochu = 'リンゴワタムシ';
update m_byochu set alias = 'トビムシG' where byochu = 'クワシロドクガ';
update m_byochu set alias = 'ネアブラムシG' where byochu = 'クリイガアブラムシ';
update m_byochu set alias = 'ハマキガG' where byochu in ('イグサシンムシガ', 'クリミガ');
update m_byochu set alias = 'ヒラタムシG' where byochu = 'カキミガ';
update m_byochu set alias = 'マイマイ・ドクガG' where byochu = 'ハラアカマイマイガ';
update m_byochu set alias = 'ヤガG' where byochu in ('タバコアオムシ', 'ナシケンモン', 'ベニモンアオリガ', 'ムラサキアシブト');
update m_byochu set alias = '' where cid = 3 and byochu like '%、%';
--害虫別名追加
update m_byochu set alias = concat(',', alias, 'イネアオムシ') where byochu = 'フタオビコヤガ';
update m_byochu set alias = concat(',', alias, 'ワタヘリクロノメイガ') where byochu = 'ウリノメイガ';
--病害別名追加
update m_byochu set alias = concat(',', alias, 'バンプビョウ') where byochu like '晩腐病%';
commit;
drop table if exists t_byochu;
投票数:0 平均点:0.00

投稿ツリー

  条件検索へ