[[html]] 【概要】 * 概要 [#k91a50eb] 作者・作品・ファイルをデータベース化しそれらを使用して検索を行う。 検索は部分検索を可能とする。 【ディレクトリ構成】 あ - あ [Ark Performance] - [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 全04巻 * ディレクトリ構成 [#k91a50eb] あ - あ [Ark Performance] - [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 全04巻 - [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 第01巻 - [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 第02巻 - [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 第03巻 - [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 第04巻 - [Ark Performance] 機動戦士ガンダム MSV-R ジョニー・ライデンの帰還 【テーブル】 database : CSB CSG CSA * テーブル [#k91a50eb] Table : AuthList ProdList FileList database : CSB CSG CSA Table : AuthList ProdList FileList table AuthList | AutherId | Kana | Auther | | 1 | あ | [Ark Performance] | | 2 | あ | [Gユウスケ×三雲岳斗×阿倍野ちゃこ ] | table ProdList table ProdList | ProductId | AutherId | Product | ProdPath | | ProductId | AutherId | Product | ProdPath | | 1 | 1 | [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 全04巻 | | | 2 | 1 | [Ark Performance] 機動戦士ガンダム MSV-R ジョニー・ライデンの帰還 | | table FileList | FileId | ProductId | FileName | FileSize | FilePath | | FileId | ProductId | FileName | FileSize | FilePath | | 1 | 1 | [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 第01巻 | | | | 2 | 1 | [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 第02巻 | | | | 3 | 1 | [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 第03巻 | | | | 4 | 1 | [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 第04巻 | | | □【検索】 □□【操作画面】 検索 作者[ ] 作品[ ] Prod 〇 File ● 実行 * 検索[#k91a50eb] ** 操作画面[#k91a50eb] 検索 作者[ ] 作品[ ] Prod 〇 File ● 実行 【結果】 検索 作者[Ark ] 作品[ ] Prod ● File 〇 実行 あ [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 全04巻 path あ [Ark Performance] 機動戦士ガンダム MSV-R ジョニー・ライデンの帰還 path ... ** 結果[#k91a50eb] 検索 作者[Ark ] 作品[ ] Prod ● File 〇 実行 あ [Ark Performance] 機動戦士ガンダム -ギレン暗殺計画- 全04巻 path あ [Ark Performance] 機動戦士ガンダム MSV-R ジョニー・ライデンの帰還 path ... □□【動作仕様】 * Auther に入力がある場合 [#p67816ab] * 動作仕様 [#k91a50eb] ** Auther に入力がある場合 [#p67816ab] Auther に入力が存在するとき Product か File のどちらかを出力する。(ラジオボタン選択) ** Product 選択 [#da38b632] →AuthListを検索し引っかかったら、AutherId を確定し AuthList から その AutherId に該当するものの Kana Auther ProdList から その AutherId に該当するものの Product ProdPath を取得し出力する *** AuthList の終わりまで検索する。 [#a75b9d61] *** ProdList の終わりまで検索する。 [#y251d56c] *** Product 選択 [#da38b632] →AuthListを検索し引っかかったら、AutherId を確定し~ AuthList から その AutherId に該当するものの Kana Auther~ ProdList から その AutherId に該当するものの Product ProdPath~ を取得し出力する~ -- AuthList の終わりまで検索する。 -- ProdList の終わりまで検索する。 use CSB; use CSB; select * from AuthList where Auther like '%ちゃこ%'; | 2 | あ | [Gユウスケ×三雲岳斗×阿倍野ちゃこ ] | SELECT * FROM AuthList,ProdList WHERE AuthList.AutherId=ProdList.AutherId=2; select * from AuthList where Auther like '%ちゃこ%'; | 2 | あ | [Gユウスケ×三雲岳斗×阿倍野ちゃこ ] | SELECT * FROM AuthList,ProdList WHERE AuthList.AutherId=ProdList.AutherId=2; ** File 選択 [#rd2ccea2] →AuthListを検索し引っかかったら、AutherId を確定し AuthList から その AutherId に該当するものの Kana Auther ProdList から その AutherId に該当するものの ProductId(FileList の検索に使用) *** File 選択 [#rd2ccea2] →AuthListを検索し引っかかったら、AutherId を確定し~ AuthList から その AutherId に該当するものの Kana Auther~ ProdList から その AutherId に該当するものの ProductId(FileList の検索に使用)~ FileList から その ProductId に該当するものの FileName FileSize FilePath を取得し出力する *** AuthList の終わりまで検索する。 [#qbde9a8b] *** ProdList の終わりまで検索する。 [#y373a26f] *** FileList の終わりまで検索する。 [#u0daafa9] を取得し出力する~ -- AuthList の終わりまで検索する。 -- ProdList の終わりまで検索する。 -- FileList の終わりまで検索する。 * Product に入力がある場合 [#q19a39f1] ** Product に入力がある場合 [#q19a39f1] Product に入力が存在するとき Product か File のどちらかを出力する。(ラジオボタン選択) ** Product 選択 [#m17a5792] →ProdListを検索し引っかかったら、ProductId を確定し ProdList から その ProductId に該当するものの AutherId Product ProdPath AuthList から その AutherId に該当するものの Kana Auther を取得し出力する *** ProdList の終わりまで検索する。 [#z288c903] *** AuthList の終わりまで検索する。 [#m80cb327] *** Product 選択 [#m17a5792] →ProdListを検索し引っかかったら、ProductId を確定し~ ProdList から その ProductId に該当するものの AutherId Product ProdPath~ AuthList から その AutherId に該当するものの Kana Auther~ を取得し出力する~ -- ProdList の終わりまで検索する。 -- AuthList の終わりまで検索する。 ** File 選択 [#v423ce1f] →ProdListを検索し引っかかったら、ProductId を確定し ProdList から その ProductId に該当するものの AutherId AuthList から その AutherId に該当するものの Kana Auther FileList から その ProductId に該当するものの FileName FileSize FilePath を取得し出力する *** ProdList の終わりまで検索する。 [#d6d3205e] *** AuthList の終わりまで検索する。 [#m6a84cfd] *** FileList の終わりまで検索する。 [#o2aca0ca] *** File 選択 [#v423ce1f] →ProdListを検索し引っかかったら、ProductId を確定し~ ProdList から その ProductId に該当するものの AutherId~ AuthList から その AutherId に該当するものの Kana Auther~ FileList から その ProductId に該当するものの FileName FileSize FilePath~ を取得し出力する~ -- ProdList の終わりまで検索する。 -- AuthList の終わりまで検索する。 -- FileList の終わりまで検索する。 【テーブル更新】 * テーブル更新[#k91a50eb] * 操作画面[#k91a50eb] * 動作仕様[#k91a50eb] 【操作画面】 □□【動作仕様】 database : CSB Table : AuthList database : CSB Table : AuthList ProdList FileList において、comicB tree の下を検索する。 1) Table 全消し& 新規作成 drop database if exists CSB; create database if not exists CSB; create table CSB.AuthList( AutherId data_type AUTO_INCREMENT, Kana varchar(10), Auther varchar(256)); ** Table 全消し& 新規作成[#k91a50eb] create table CSB.ProdList( ProductId data_type AUTO_INCREMENT, AutherId int, Product varchar(256), ProdPath varchar(256)); drop database if exists CSB; create database if not exists CSB; create table CSB.AuthList( AutherId data_type AUTO_INCREMENT, Kana varchar(10), Auther varchar(256)); create table CSB.ProdList( ProductId data_type AUTO_INCREMENT, AutherId int, Product varchar(256), ProdPath varchar(256)); create table CSB.FileList( FileId data_type AUTO_INCREMENT, ProductId int, FileName varchar(256), FileSize int, FilePath varchar(256)); create table CSB.FileList( FileId data_type AUTO_INCREMENT, ProductId int, FileName varchar(256), FileSize int, FilePath varchar(256)); ** ディレクトリを検索しテーブルに登録[#k91a50eb] 基本的には mkhtml を作る手順でやる 2) ディレクトリを検索しテーブルに登録する 基本的には mkhtml を作る手順でやる 2段目がAuther項目。 AutherId は自動発番。 先頭が AuthList.Kana。 B/G は [] が AuthList.Auther。 insert into AuthList(Kana, Auther) values('あ', 'Ark Performance'); select AutherId from AuthList where Auther = 'Ark Performance'; - AutherId は自動発番。 - 先頭が AuthList.Kana。 - B/G は [] が AuthList.Auther。 - insert into AuthList(Kana, Auther) values('あ', 'Ark Performance'); - select AutherId from AuthList where Auther = 'Ark Performance'; で、AutherId を取っておく 3段目がProduct項目。 ProductId は自動発番。 AutherId は上で取っておいた AutherId。 [] をとってが ProdList.Product。 insert into ProdList(AutherId, Product, ProdPath) values($AutherId, '機動戦士ガンダム -ギレン暗殺計画- 全04巻', '$Path'); select ProductId from ProdList where Product = '機動戦士ガンダム -ギレン暗殺計画- 全04巻'; - ProductId は自動発番。 - AutherId は上で取っておいた AutherId。 - [] をとってが ProdList.Product。 - insert into ProdList(AutherId, Product, ProdPath) values($AutherId, '機動戦士ガンダム -ギレン暗殺計画- 全04巻', '$Path'); - select ProductId from ProdList where Product = '機動戦士ガンダム -ギレン暗殺計画- 全04巻'; で、ProductId を取っておく 4段目がFile項目。 FileId は自動発番。 ProductId は上で取っておいた ProductId。 [] をとってが FileList.FileName。 FileSize insert into FileList(ProductId, FileName, FileSize, ProdPath) values($ProductId, '機動戦士ガンダム -ギレン暗殺計画- 第01巻', $FileSize, '$Path'); - FileId は自動発番。 - ProductId は上で取っておいた ProductId。 - [] をとってが FileList.FileName。 - FileSize - insert into FileList(ProductId, FileName, FileSize, ProdPath) values($ProductId, '機動戦士ガンダム -ギレン暗殺計画- 第01巻', $FileSize, '$Path'); これを全ディレクトリで回す。 【結果】 ** 結果[#k91a50eb]