/** Ċ Ġ* ĠĠĠ ĠCopyright Ġ 2 0 1 6 - 2 0 1 9 Ġthe Ġoriginal Ġauthor Ġor Ġauthors . Ċ Ġ* Ċ Ġ* ĠĠĠ ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* ĠĠĠ Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠĠĠ ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠĠĠ ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* ĠĠĠ Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠĠĠ ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠĠĠ ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* ĠĠĠ Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġexamples . kotlin . canonical Ċ Ċ import Ġexamples . kotlin . canonical . Person Dynamic Sql Support . Person Ċ import Ġexamples . kotlin . canonical . Person Dynamic Sql Support . Person . address Id Ċ import Ġexamples . kotlin . canonical . Person Dynamic Sql Support . Person . birth Date Ċ import Ġexamples . kotlin . canonical . Person Dynamic Sql Support . Person . employ ed Ċ import Ġexamples . kotlin . canonical . Person Dynamic Sql Support . Person . firstName Ċ import Ġexamples . kotlin . canonical . Person Dynamic Sql Support . Person . id Ċ import Ġexamples . kotlin . canonical . Person Dynamic Sql Support . Person . lastName Ċ import Ġexamples . kotlin . canonical . Person Dynamic Sql Support . Person . occup ation Ċ import Ġorg . mybatis . dynamic . sql . Sql Builder . isEqualTo Ċ import Ġorg . mybatis . dynamic . sql . update . Update DSL Ċ import Ġorg . mybatis . dynamic . sql . update . Update Model Ċ import Ġorg . mybatis . dynamic . sql . util . kotlin . Count Comp leter Ċ import Ġorg . mybatis . dynamic . sql . util . kotlin . Delete Comp leter Ċ import Ġorg . mybatis . dynamic . sql . util . kotlin . Select Comp leter Ċ import Ġorg . mybatis . dynamic . sql . util . kotlin . Update Comp leter Ċ import Ġorg . mybatis . dynamic . sql . util . kotlin . mybatis 3 .* Ċ Ċ fun ĠPerson Mapper . count ( comp leter : ĠCount Comp leter ) Ġ= ĊĠĠĠ Ġcount ( this :: count , ĠPerson , Ġcomp leter ) Ċ Ċ fun ĠPerson Mapper . delete ( comp leter : ĠDelete Comp leter ) Ġ= ĊĠĠĠ Ġdelete From ( this :: delete , ĠPerson , Ġcomp leter ) Ċ Ċ fun ĠPerson Mapper . delete By PrimaryKey ( id _: ĠInt ) Ġ= ĊĠĠĠ Ġdelete Ġ{ ĊĠĠĠĠĠĠĠ Ġwhere ( id , Ġis EqualTo ( id _)) ĊĠĠĠ Ġ} Ċ Ċ fun ĠPerson Mapper . insert ( record : ĠPerson Record ) Ġ= ĊĠĠĠ Ġinsert ( this :: insert , Ġrecord , ĠPerson ) Ġ{ ĊĠĠĠĠĠĠĠ Ġmap ( id ). to Property (" id ") ĊĠĠĠĠĠĠĠ Ġmap ( firstName ). to Property (" firstName ") ĊĠĠĠĠĠĠĠ Ġmap ( lastName ). to Property (" lastName ") ĊĠĠĠĠĠĠĠ Ġmap ( birth Date ). to Property (" birth Date ") ĊĠĠĠĠĠĠĠ Ġmap ( employ ed ). to Property (" employ ed ") ĊĠĠĠĠĠĠĠ Ġmap ( occup ation ). to Property (" occup ation ") ĊĠĠĠĠĠĠĠ Ġmap ( address Id ). to Property (" address Id ") ĊĠĠĠ Ġ} Ċ Ċ fun ĠPerson Mapper . insert Multiple ( var arg Ġrecords : ĠPerson Record ) Ġ= ĊĠĠĠ Ġinsert Multiple ( records . toList ()) Ċ Ċ fun ĠPerson Mapper . insert Multiple ( records : ĠCollection < Person Record >) Ġ= ĊĠĠĠ Ġinsert Multiple ( this :: insert Multiple , Ġrecords , ĠPerson ) Ġ{ ĊĠĠĠĠĠĠĠ Ġmap ( id ). to Property (" id ") ĊĠĠĠĠĠĠĠ Ġmap ( firstName ). to Property (" firstName ") ĊĠĠĠĠĠĠĠ Ġmap ( lastName ). to Property (" lastName ") ĊĠĠĠĠĠĠĠ Ġmap ( birth Date ). to Property (" birth Date ") ĊĠĠĠĠĠĠĠ Ġmap ( employ ed ). to Property (" employ ed ") ĊĠĠĠĠĠĠĠ Ġmap ( occup ation ). to Property (" occup ation ") ĊĠĠĠĠĠĠĠ Ġmap ( address Id ). to Property (" address Id ") ĊĠĠĠ Ġ} Ċ Ċ fun ĠPerson Mapper . insert Select ive ( record : ĠPerson Record ) Ġ= ĊĠĠĠ Ġinsert ( this :: insert , Ġrecord , ĠPerson ) Ġ{ ĊĠĠĠĠĠĠĠ Ġmap ( id ). to Property When Present (" id ", Ġrecord :: id ) ĊĠĠĠĠĠĠĠ Ġmap ( firstName ). to Property When Present (" firstName ", Ġrecord :: firstName ) ĊĠĠĠĠĠĠĠ Ġmap ( lastName ). to Property When Present (" lastName ", Ġrecord :: lastName ) ĊĠĠĠĠĠĠĠ Ġmap ( birth Date ). to Property When Present (" birth Date ", Ġrecord :: birth Date ) ĊĠĠĠĠĠĠĠ Ġmap ( employ ed ). to Property When Present (" employ ed ", Ġrecord :: employ ed ) ĊĠĠĠĠĠĠĠ Ġmap ( occup ation ). to Property When Present (" occup ation ", Ġrecord :: occup ation ) ĊĠĠĠĠĠĠĠ Ġmap ( address Id ). to Property When Present (" address Id ", Ġrecord :: address Id ) ĊĠĠĠ Ġ} Ċ Ċ private Ġval Ġcolumn List Ġ= ĠlistOf ( id .` as ` (" A _ ID "), ĠfirstName , ĠlastName , Ġbirth Date , Ġemploy ed , Ġoccup ation , Ġaddress Id ) Ċ Ċ fun ĠPerson Mapper . select One ( comp leter : ĠSelect Comp leter ) Ġ= ĊĠĠĠ Ġselect One ( this :: select One , Ġcolumn List , ĠPerson , Ġcomp leter ) Ċ Ċ fun ĠPerson Mapper . select ( comp leter : ĠSelect Comp leter ) Ġ= ĊĠĠĠ Ġselect List ( this :: select Many , Ġcolumn List , ĠPerson , Ġcomp leter ) Ċ Ċ fun ĠPerson Mapper . select Distinct ( comp leter : ĠSelect Comp leter ) Ġ= ĊĠĠĠ Ġselect Distinct ( this :: select Many , Ġcolumn List , ĠPerson , Ġcomp leter ) Ċ Ċ fun ĠPerson Mapper . select By PrimaryKey ( id _: ĠInt ) Ġ= ĊĠĠĠ Ġselect One Ġ{ ĊĠĠĠĠĠĠĠ Ġwhere ( id , Ġis EqualTo ( id _)) ĊĠĠĠ Ġ} Ċ Ċ fun ĠPerson Mapper . update ( comp leter : ĠUpdate Comp leter ) Ġ= ĊĠĠĠ Ġupdate ( this :: update , ĠPerson , Ġcomp leter ) Ċ Ċ fun ĠUpdate DSL < Update Model >. update All Columns ( record : ĠPerson Record ) Ġ= ĊĠĠĠ Ġapply Ġ{ ĊĠĠĠĠĠĠĠ Ġset ( id ). equalTo ( record :: id ) ĊĠĠĠĠĠĠĠ Ġset ( firstName ). equalTo ( record :: firstName ) ĊĠĠĠĠĠĠĠ Ġset ( lastName ). equalTo ( record :: lastName ) ĊĠĠĠĠĠĠĠ Ġset ( birth Date ). equalTo ( record :: birth Date ) ĊĠĠĠĠĠĠĠ Ġset ( employ ed ). equalTo ( record :: employ ed ) ĊĠĠĠĠĠĠĠ Ġset ( occup ation ). equalTo ( record :: occup ation ) ĊĠĠĠĠĠĠĠ Ġset ( address Id ). equalTo ( record :: address Id ) ĊĠĠĠ Ġ} Ċ Ċ fun ĠUpdate DSL < Update Model >. update Select ive Columns ( record : ĠPerson Record ) Ġ= ĊĠĠĠ Ġapply Ġ{ ĊĠĠĠĠĠĠĠ Ġset ( id ). equalTo When Present ( record :: id ) ĊĠĠĠĠĠĠĠ Ġset ( firstName ). equalTo When Present ( record :: firstName ) ĊĠĠĠĠĠĠĠ Ġset ( lastName ). equalTo When Present ( record :: lastName ) ĊĠĠĠĠĠĠĠ Ġset ( birth Date ). equalTo When Present ( record :: birth Date ) ĊĠĠĠĠĠĠĠ Ġset ( employ ed ). equalTo When Present ( record :: employ ed ) ĊĠĠĠĠĠĠĠ Ġset ( occup ation ). equalTo When Present ( record :: occup ation ) ĊĠĠĠĠĠĠĠ Ġset ( address Id ). equalTo When Present ( record :: address Id ) ĊĠĠĠ Ġ} Ċ Ċ fun ĠPerson Mapper . update By PrimaryKey ( record : ĠPerson Record ) Ġ= ĊĠĠĠ Ġupdate Ġ{ ĊĠĠĠĠĠĠĠ Ġset ( firstName ). equalTo ( record :: firstName ) ĊĠĠĠĠĠĠĠ Ġset ( lastName ). equalTo ( record :: lastName ) ĊĠĠĠĠĠĠĠ Ġset ( birth Date ). equalTo ( record :: birth Date ) ĊĠĠĠĠĠĠĠ Ġset ( employ ed ). equalTo ( record :: employ ed ) ĊĠĠĠĠĠĠĠ Ġset ( occup ation ). equalTo ( record :: occup ation ) ĊĠĠĠĠĠĠĠ Ġset ( address Id ). equalTo ( record :: address Id ) ĊĠĠĠĠĠĠĠ Ġwhere ( id , Ġis EqualTo ( record :: id )) ĊĠĠĠ Ġ} Ċ Ċ fun ĠPerson Mapper . update By PrimaryKey Select ive ( record : ĠPerson Record ) Ġ= ĊĠĠĠ Ġupdate Ġ{ ĊĠĠĠĠĠĠĠ Ġset ( firstName ). equalTo When Present ( record :: firstName ) ĊĠĠĠĠĠĠĠ Ġset ( lastName ). equalTo When Present ( record :: lastName ) ĊĠĠĠĠĠĠĠ Ġset ( birth Date ). equalTo When Present ( record :: birth Date ) ĊĠĠĠĠĠĠĠ Ġset ( employ ed ). equalTo When Present ( record :: employ ed ) ĊĠĠĠĠĠĠĠ Ġset ( occup ation ). equalTo When Present ( record :: occup ation ) ĊĠĠĠĠĠĠĠ Ġset ( address Id ). equalTo When Present ( record :: address Id ) ĊĠĠĠĠĠĠĠ Ġwhere ( id , Ġis EqualTo ( record :: id )) ĊĠĠĠ Ġ} Ċ