| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646 |
- -- [login]
- SELECT
- id, loginName, userName,
- companyId, deptId, userType,
- email, phonenumber, sex,
- avatar, status, delFlag,
- remark, postIds
- FROM $table$
- WHERE loginName = #{loginName} AND password = #{password};
- -- [queryLoginUsers]
- select a.id, a.companyId, a.deptId, a.loginName,
- a.userName, a.userType, a.email, a.phoneNumber,
- a.sex, a.avatar, a.status, a.delFlag,
- a.createBy, a.createTime, a.updateBy,
- a.updateTime, a.remark, a.postIds, b.deptName
- from $table1$ a
- left join $table2$ b on a.deptId = b.id
- -- trim prefix=WHERE prefixOverrides=AND|OR
- -- if deptId > 0
- and a.deptId = #{deptId}
- -- end
- -- if status >= 0
- and a.status = #{status}
- -- end
- -- isNotEmpty keyWord
- and (a.loginName LIKE #{Like:keyWord} or a.userName LIKE #{Like:keyWord})
- -- end
- -- isNotEmpty loginName
- and a.loginName LIKE #{Like:loginName}
- -- end
- -- isNotEmpty phone
- and a.phoneNumber LIKE #{Like:phoneNumber}
- -- end
- -- isNotEmpty beginTime
- and a.createTime >= #{beginTime}
- -- end
- -- isNotEmpty endTime
- and a.createTime <= #{endTime}
- -- end
- -- end
- -- isEmpty orderBy
- order by createTime desc
- -- else
- order by #{orderBy}
- -- end
- ;
- -- [getUserInfo]
- SELECT
- id, loginName, userName,
- companyId, deptId, userType,
- email, phonenumber, sex,
- avatar, status, delFlag,
- remark, postIds
- FROM $table$
- WHERE id = #{id};
- -- [accountExists]
- SELECT count(id)
- FROM $table$
- WHERE loginName = #{loginName};
- -- [insertLoginUser]
- insert into $table$ (
- id, companyId, deptId,
- loginName, userName, userType,
- email, phonenumber, sex,
- avatar, password, salt,
- status, createBy,
- createTime, updateBy, updateTime,
- remark, postIds, shareCode)
- values (
- #{id}, #{companyid}, #{deptid},
- #{loginname}, #{username}, #{usertype},
- #{email}, #{phonenumber}, #{sex},
- #{avatar}, #{password}, #{salt},
- #{status}, #{createby},
- #{createtime}, #{updateby}, #{updatetime},
- #{remark}, #{postids}, #{sharecode}
- );
- -- [insertUserRole]
- insert into $table$ (userId, roleId)
- VALUES (#{userid}, #{roleid});
- -- [clearUserRole]
- delete from $table$ where userId = #{userId};
- -- [updateLoginUser]
- update $table$ set
- deptId = #{deptid},
- userName = #{username},
- email = #{email},
- phonenumber = #{phonenumber},
- sex = #{sex},
- updateBy = #{updateby},
- updateTime = #{updatetime},
- remark = #{remark},
- postIds = #{postids}
- where id = #{id};
- -- [voidLoginUser]
- update $table$ set
- status = #{status}
- where id = #{id};
- -- [resetLoginUser]
- update $table$ set
- password = #{password}
- where id = #{id};
- -- [changeMyPassword]
- UPDATE $table$ SET
- password = #{password}
- WHERE id = #{id};
- -- [queryAllMenus]
- select *
- from $table$
- -- isEmpty orderBy
- order by parentId, sortNum
- -- else
- order by #{orderBy}
- -- end
- ;
- -- [queryAllRoles]
- select *
- from $table$
- -- trim prefix=WHERE prefixOverrides=AND|OR
- -- isNotEmpty roleName
- roleName LIKE #{Like:roleName}
- -- end
- -- if status >= 0
- and status = #{status}
- -- end
- -- end
- -- isEmpty orderBy
- order by sortNum
- -- else
- order by #{orderBy}
- -- end
- ;
- -- [insertRole]
- insert into $table$
- (id, roleName,
- sortNum, status, createBy,
- createTime, updateBy, updateTime,
- remark, systemFlag)
- VALUES (
- #{id}, #{rolename},
- #{sortnum}, #{status}, #{createby},
- #{createtime}, #{updateby}, #{updatetime},
- #{remark}, #{systemflag}
- );
- -- [updateRole]
- update $table$ set
- roleName = #{rolename},
- sortNum = #{sortnum},
- updateBy = #{updateby},
- updateTime = #{updatetime},
- remark = #{remark}
- where id = #{id};
- -- [voidRole]
- update $table$ set
- status = #{status}
- where id = #{id};
- -- [insertRoleMenu]
- insert into $table$ (roleId, menuId) VALUES (#{roleid}, #{menuid});
- -- [clearRoleMenu]
- delete from $table$ where roleId = #{roleId};
- -- [queryRoleMenus]
- select a.*, b.perms as menuperms, b.menuType, b.parentId from $table1$ a
- left join $table2$ b on a.menuId = b.id
- where a.roleId= #{roleId} and b.menuType in ('M', 'C');
- -- [queryRoleActions]
- select a.*, b.perms as menuperms, b.menuType, b.parentId from $table1$ a
- left join $table2$ b on a.menuId = b.id
- where a.roleId= #{roleId};
- -- [queryUserRoles]
- select userId,roleId from $table$ WHERE userId = #{userid};
- -- [queryMenuRoles]
- select b.id, b.roleName, b.roleKey, b.sortNum, b.remark
- from $table1$ a
- left join $table2$ b on a.roleId = b.id
- where a.menuId = #{menuId}
- order by b.sortNum;
- -- [queryRoleUsers]
- select b.id, b.companyId, b.deptId, b.loginName, b.userName, b.email, b.phonenumber, b.status
- from $table1$ a
- left join $table2$ b on a.userId = b.id
- where a.roleId = #{roleId}
- order by b.id;
- --[queryAllDepts]
- select * from $table$
- --[addDept]
- insert into $table$ (id, parentId, deptName, deptCode,
- sortNum, leader, phone,
- email, status, parentName,
- createBy, createTime, createTimeLong,
- updateBy, updateTime, updateTimeLong ) values ( #{id}, #{parentid}, #{deptname}, #{deptcode},
- #{sortnum}, #{leader}, #{phone},
- #{email}, #{status}, #{parentname},
- #{createby}, #{createtime},
- #{createtimelong}, #{updateby}, #{updatetime},
- #{updatetimelong} );
- -- [updateDept]
- update $table$ set parentId = #{parentid},deptName = #{deptname},deptCode = #{deptcode},sortNum = #{sortnum},
- leader = #{leader},phone = #{phone},email = #{email},status = #{status},
- parentName = #{parentname},
- updateBy = #{updateby},updateTime = #{updatetime},updateTimeLong = #{updatetimelong}
- where id = #{id};
- -- [voidDept]
- update $table$ set
- status = #{status},
- updateBy = #{updateby},
- updateTime = #{updatetime}
- where id=#{id};
- -- [insertMenu]
- insert into $table$
- (id, menuName, parentId,
- sortNum, url, menuType,
- visible, cacheFlag, perms, icon,
- createBy, createTime, updateBy,
- updateTime, remark,
- route, pathName,
- runKind, delphiPackage, delphiParams,
- delphiRunKind, delphiRunForm, delphiFormShow)
- values (
- #{id}, #{menuname}, #{parentid},
- #{sortnum}, #{url}, #{menutype},
- #{visible}, #{cacheflag}, #{perms}, #{icon},
- #{createby}, #{createtime}, #{updateby},
- #{updatetime}, #{remark},
- #{route}, #{pathname},
- #{runkind}, #{delphipackage}, #{delphiparams},
- #{delphirunkind}, #{delphirunform}, #{delphiformshow}
- );
- -- [updateMenu]
- update $table$ set
- menuName = #{menuname},
- parentId = #{parentid},
- sortNum = #{sortnum},
- url = #{url},
- menuType = #{menutype},
- perms = #{perms},
- icon = #{icon},
- updateBy = #{updateby},
- updateTime = #{updatetime},
- remark = #{remark},
- cacheFlag = #{cacheflag},
- route = #{route},
- pathName = #{pathname},
- runKind = #{runkind},
- delphiPackage = #{delphipackage},
- delphiParams = #{delphiparams},
- delphiRunKind = #{delphirunkind},
- delphiRunForm = #{delphirunform},
- delphiFormShow = #{delphiformshow}
- where id = #{id};
- -- [voidMenu]
- update $table$ set
- visible = #{visible},
- updateBy = #{updateby},
- updateTime = #{updatetime}
- where id = #{id};
- --[deleteRoleMenu]
- delete from $table$ where menuId in (/* in ids */)
- --[deleteMenu]
- delete from $table$ where id in (/* in ids */)
- -- [insertERPFile]
- insert into $table$
- (idUser, userName, fileKind,
- srcFileName, fileDescription, downloadUrl,
- createBy, createTime, createTimeLong,
- updateBy, updateTime, updateTimeLong )
- values (#{iduser}, #{username}, #{filekind},
- #{srcfilename}, #{filedescription}, #{downloadurl},
- #{createby}, #{createtime}, #{createtimelong},
- #{updateby}, #{updatetime}, #{updatetimelong} );
- -- [queryAllConfig]
- select * from $table$;
- -- [queryConfig]
- select * from $table$
- where configKey = #{configKey};
- -- [insertConfigValue]
- insert into $table$
- (configKey, configName, configValue1,
- configValue2, configValue3, configType,
- remark)
- VALUES (
- #{configkey}, #{configname}, #{configvalue1},
- #{configvalue2}, #{configvalue3}, #{configtype},
- #{remark}
- );
- -- [updateConfigValue]
- update $table$ set
- configName = #{configname},
- configModule = #{configmodule},
- configValue1 = #{configvalue1},
- configValue2 = #{configvalue2},
- configValue3 = #{configvalue3},
- remark = #{remark}
- where configKey = #{configkey};
- -- [updateOnlyConfigValue]
- update $table$ set
- configValue1 = #{configvalue1}
- where configKey = #{configkey};
- -- [deleteConfigValue]
- delete from $table$
- where configKey = #{configkey};
- -- [queryDictTypes]
- select *
- from $table$
- -- trim prefix=WHERE prefixOverrides=AND|OR
- -- if voidFlag >= 0
- voidFlag = #{voidFlag}
- -- end
- -- isNotEmpty keyWord
- and (dictName LIKE #{Like:keyWord} or dictType LIKE #{Like:keyWord})
- -- end
- -- end
- -- isEmpty orderBy
- order by createTime desc
- -- else
- order by #{orderBy}
- -- end
- ;
- -- [addDictType]
- insert into $table$
- (id, dictName, dictType,
- voidFlag, remark, createBy,
- createTime, updateBy, updateTime)
- values (
- #{id}, #{dictname}, #{dicttype},
- #{voidflag}, #{remark}, #{createby},
- #{createtime}, #{updateby}, #{updatetime}
- );
- -- [updateDictType]
- update $table$ set
- dictName = #{dictname},
- dictType = #{dicttype},
- remark = #{remark},
- updateBy = #{updateby},
- updateTime = #{updatetime}
- where id = #{id};
- -- [voidDictType]
- update $table$ set
- voidFlag = #{voidflag},
- updateBy = #{updateby},
- updateTime = #{updatetime}
- where id = #{id};
- -- [queryDictDatas]
- select *
- from $table$
- -- trim prefix=WHERE prefixOverrides=AND|OR
- -- if idType >= 0
- idType = #{idType}
- -- end
- -- if voidFlag >= 0
- voidFlag = #{voidFlag}
- -- end
- -- isNotEmpty dictLabel
- and dictLabel LIKE #{Like:dictLabel}
- -- end
- -- end
- -- isEmpty orderBy
- order by sortNum desc
- -- else
- order by #{orderBy}
- -- end
- ;
- -- [addDictData]
- insert into $table$
- (id, idType, dictLabel,
- dictValue, sortNum, cssClass,
- listClass, voidFlag, remark,
- createBy, createTime, updateBy,
- updateTime)
- values (
- #{id}, #{idtype}, #{dictlabel},
- #{dictvalue}, #{sortnum}, #{cssclass},
- #{listclass}, #{voidflag}, #{remark},
- #{createby}, #{createtime}, #{updateby},
- #{updatetime}
- );
- -- [updateDictData]
- update $table$ set
- dictLabel = #{dictlabel},
- dictValue = #{dictvalue},
- sortNum = #{sortnum},
- cssClass = #{cssclass},
- listClass = #{listclass},
- remark = #{remark},
- updateBy = #{updateby},
- updateTime = #{updatetime}
- where id = #{id};
- -- [voidDictData]
- update $table$ set
- voidFlag = #{voidflag},
- updateBy = #{updateby},
- updateTime = #{updatetime}
- where id = #{id};
- -- [selectAllNoticeMessage]
- select * from $table$;
- -- [addNoticeMessage]
- insert into $table$ (
- id, messageCode, messageName, messageKind,
- voidFlag, createBy, createTime,
- createTimeLong, updateBy, updateTime,
- updateTimeLong )
- values (
- #{id}, #{messagecode}, #{messagename}, #{messagekind},
- #{voidflag}, #{createby}, #{createtime},
- #{createtimelong}, #{updateby}, #{updatetime},
- #{updatetimelong} );
- -- [updateNoticeMessage]
- update $table$ set
- messageName = #{messagename},
- messageKind = #{messagekind},
- updateBy = #{updateby},
- updateTime = #{updatetime},
- updateTimeLong = #{updatetimelong}
- where id = #{id};
- -- [voidNoticeMessage]
- update $table$ set
- voidFlag = #{voidflag},
- updateBy = #{updateby},
- updateTime = #{updatetime},
- updateTimeLong = #{updatetimelong}
- where id = #{id};
- -- [selectUserNoticeMessage]
- SELECT a.*, b.messageCode FROM $table1$ a
- LEFT JOIN $table2$ b ON a.idNoticeMessage = b.id;
- -- [addUserNoticeMessage]
- insert into $table$ (
- id, idUser,
- idNoticeMessage, createBy, createTime,
- createTimeLong, updateBy, updateTime,
- updateTimeLong )
- values (
- #{id}, #{iduser},
- #{idnoticemessage}, #{createby}, #{createtime},
- #{createtimelong}, #{updateby}, #{updatetime},
- #{updatetimelong} );
- -- [deleteNoticeMessage]
- delete from $table$ where idUser = #{iduser} and idNoticeMessage = #{idnoticemessage};
- -- [queryPersonConfigValue]
- select * from $table$;
- -- [addPersonConfigValue]
- insert into $table$ (
- idUser, configKey, configName,
- configValue1, configValue2, configValue3,
- createBy, createTime, createTimeLong,
- updateBy, updateTime, updateTimeLong )
- values (
- #{iduser}, #{configkey}, #{configname},
- #{configvalue1}, #{configvalue2}, #{configvalue3},
- #{createby}, #{createtime}, #{createtimelong},
- #{updateby}, #{updatetime}, #{updatetimelong} );
- -- [updatePersonConfigValue]
- update $table$ set
- configValue1 = #{configvalue1},
- configValue2 = #{configvalue2},
- configValue3 = #{configvalue3},
- updateBy = #{updateby},
- updateTime = #{updatetime},
- updateTimeLong = #{updatetimelong}
- where idUser = #{iduser} and configKey = #{configkey};
- -- [selectDataPurview]
- select * from $table$ order by idData, idUser, idCreateUser;
- -- [addDataPurview]
- insert into $table$ (
- idUser, userName, idCreateUser,
- createUserName, idData )
- values (
- #{iduser}, #{username}, #{idcreateuser},
- #{createusername}, #{iddata} );
- -- [deleteDataPurview]
- delete from $table$
- where idData = #{iddata} and idUser = #{iduser} and idCreateUser = #{idcreateuser};
- -- [insertTaskQueue]
- insert into $table$
- (userId, createTime, taskName,
- queryBeginDate, queryEndDate, queryContent,
- errorMsg, fileName, fileURL,
- webFileURL)
- values (
- #{userid}, #{createtime}, #{taskname},
- #{querybegindate}, #{queryenddate}, #{querycontent},
- #{errormsg}, #{filename}, #{fileurl},
- #{webfileurl}
- );
- -- [selectTaskQueue]
- select * from $table$
- where userId = #{userId}
- -- isNotEmpty beginTime
- and createTime >= #{beginTime}
- -- end
- -- isNotEmpty endTime
- and createTime <= #{endTime}
- -- end
- order by createTime desc;
- -- [insertPageTableColumn]
- insert into $table$ (
- idUser, pageName, columnName,
- columnTitle, columnWidth, columnIndex)
- values (
- #{iduser}, #{pagename}, #{columnname},
- #{columntitle}, #{columnwidth}, #{columnindex});
- -- [deletePageTableColumn]
- delete from $table$
- where idUser = #{idUser} and pageName = #{pageName};
- -- [selectPageTableColumn]
- select * from $table$
- where idUser = #{idUser} and pageName = #{pageName}
- order by columnindex;
- -- [insertAnnouncement]
- insert into $table$ (id, idAnnouncementType, announcementType, announcementTitle,
- announcementState, voidFlag, idReleaseMan,
- releaseMan, releaseDate,
- createMan, createBy,
- createTime, updateBy,
- updateTime ) values ( #{id}, #{idannouncementtype}, #{announcementtype}, #{announcementtitle},
- #{announcementstate}, #{voidflag}, #{idreleaseman},
- #{releaseman}, #{releasedate},
- #{createman}, #{createby},
- #{createtime}, #{updateby},
- #{updatetime} );
- -- [updateAnnouncement]
- update $table$ set idAnnouncementType = #{idannouncementtype},announcementType = #{announcementtype},announcementTitle = #{announcementtitle},announcementState = #{announcementstate},
- voidFlag = #{voidflag},idReleaseMan = #{idreleaseman},releaseMan = #{releaseman},releaseDate = #{releasedate},
- createMan = #{createman},createBy = #{createby},
- createTime = #{createtime},updateBy = #{updateby},updateTime = #{updatetime} where id = #{id};
- -- [voidAnnouncement]
- update $table$ set
- voidFlag = #{voidflag},
- updateBy = #{updateby},
- updateTime = #{updatetime}
- where id = #{id};
- -- [insertAnnouncementAttachment]
- insert into $table$ (id, idAnnouncement, idUser, userName,
- originName, srcFileName, fileDescription,
- attachmentUrl, downloadUrl, sortNum,
- createBy, createTime,
- updateBy, updateTime ) values ( #{id}, #{idannouncement}, #{iduser}, #{username},
- #{originname}, #{srcfilename}, #{filedescription},
- #{attachmenturl}, #{downloadurl}, #{sortnum},
- #{createby}, #{createtime},
- #{updateby}, #{updatetime} );
- -- [deleteAnnouncementAttachment]
- delete from $table$ where id = #{id};
- -- [selectSiteContent]
- select * from $table$
- order by sortIndex;
- -- [addSiteContent]
- insert into $table$ (
- id, groupName, caption, contentUrl,
- sortIndex, siteLabel,
- createBy, createTime,
- createTimeLong, updateBy, updateTime,
- updateTimeLong )
- values (
- #{id}, #{groupname}, #{caption}, #{contenturl},
- #{sortindex}, #{sitelabel},
- #{createby}, #{createtime},
- #{createtimelong}, #{updateby}, #{updatetime},
- #{updatetimelong} );
- -- [updateSiteContent]
- update $table$ set
- groupName = #{groupname},
- siteLabel = #{sitelabel},
- caption = #{caption},
- contentUrl = #{contenturl},
- sortIndex = #{sortindex},
- updateBy = #{updateby},
- updateTime = #{updatetime},
- updateTimeLong = #{updatetimelong}
- where id = #{id};
- -- [deleteSiteContent]
- delete from $table$ where id = #{id};
|