From 3b55d06b89bf64873e685c3d78fce5affbba3d17 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Tue, 16 Apr 2019 11:20:38 +0900 Subject: Add warehouse server source code. [Patch Set 2] Add ReadMe.md Change-Id: I6ade52d2490f5ca4ba107c1a27ed6d5b39048725 Signed-off-by: zheng_wenlong --- appmarket-persistence/pom.xml | 55 +++ .../interceptor/PaginationInterceptor.java | 74 +++++ .../market/persistence/mapper/app/AppMapper.java | 61 ++++ .../persistence/mapper/app/AppVersionMapper.java | 51 +++ .../mapper/authority/AuthorityMapper.java | 49 +++ .../authority/AuthorityResourceLinkMapper.java | 43 +++ .../mapper/resource/DictionaryMapper.java | 51 +++ .../mapper/resource/ResourceMapper.java | 49 +++ .../mapper/user/UserAuthorityLinkMapper.java | 43 +++ .../market/persistence/mapper/user/UserMapper.java | 70 ++++ .../app/market/persistence/xml/app/AppMapper.xml | 368 +++++++++++++++++++++ .../persistence/xml/app/AppVersionMapper.xml | 298 +++++++++++++++++ .../persistence/xml/authority/AuthorityMapper.xml | 194 +++++++++++ .../xml/authority/AuthorityResourceLinkMapper.xml | 146 ++++++++ .../persistence/xml/resource/DictionaryMapper.xml | 202 +++++++++++ .../persistence/xml/resource/ResourceMapper.xml | 220 ++++++++++++ .../xml/user/UserAuthorityLinkMapper.xml | 146 ++++++++ .../app/market/persistence/xml/user/UserMapper.xml | 308 +++++++++++++++++ .../test/java/app/market/persisitence/AppTest.java | 53 +++ 19 files changed, 2481 insertions(+) create mode 100644 appmarket-persistence/pom.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/interceptor/PaginationInterceptor.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppVersionMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityResourceLinkMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/DictionaryMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/ResourceMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserAuthorityLinkMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserMapper.java create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppVersionMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityResourceLinkMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/resource/DictionaryMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/resource/ResourceMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserAuthorityLinkMapper.xml create mode 100644 appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserMapper.xml create mode 100644 appmarket-persistence/src/test/java/app/market/persisitence/AppTest.java (limited to 'appmarket-persistence') diff --git a/appmarket-persistence/pom.xml b/appmarket-persistence/pom.xml new file mode 100644 index 0000000..cea0e2e --- /dev/null +++ b/appmarket-persistence/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + app.market + appmarket-root + 0.0.1-SNAPSHOT + + appmarket-persistence + jar + appmarket-persistence + http://maven.apache.org + + UTF-8 + + + + + org.mybatis + mybatis + 3.3.0 + + + + org.mybatis + mybatis-spring + 1.2.2 + + + + mysql + mysql-connector-java + 5.1.29 + + + junit + junit + 3.8.1 + test + + + app.market + appmarket-model + ${project.version} + + + app.market + appmarket-utils + ${project.version} + + + + diff --git a/appmarket-persistence/src/main/java/app/market/persistence/interceptor/PaginationInterceptor.java b/appmarket-persistence/src/main/java/app/market/persistence/interceptor/PaginationInterceptor.java new file mode 100644 index 0000000..0e84e4d --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/interceptor/PaginationInterceptor.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persistence.interceptor; + +import java.sql.Connection; +import java.util.Properties; +import java.util.regex.Pattern; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.ibatis.executor.statement.StatementHandler; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.plugin.Interceptor; +import org.apache.ibatis.plugin.Intercepts; +import org.apache.ibatis.plugin.Invocation; +import org.apache.ibatis.plugin.Plugin; +import org.apache.ibatis.plugin.Signature; +import org.apache.ibatis.session.RowBounds; + +@Intercepts(@Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class })) +public class PaginationInterceptor implements Interceptor { + + private final static String SQL_SELECT_REGEX = "(?is)^\\s*SELECT.*$"; + + private final static String SQL_COUNT_REGEX = "(?is)^\\s*SELECT\\s+COUNT\\s*\\(\\s*(?:\\*|\\w+)\\s*\\).*$"; + + @Override + public Object intercept(Invocation inv) throws Throwable { + StatementHandler target = (StatementHandler) inv.getTarget(); + BoundSql boundSql = target.getBoundSql(); + String sql = boundSql.getSql(); + if ( StringUtils.isBlank( sql ) ) { + return inv.proceed(); + } + if ( sql.matches( SQL_SELECT_REGEX ) && !Pattern.matches( SQL_COUNT_REGEX, sql ) ) { + Object obj = FieldUtils.readField( target, "delegate", true ); + RowBounds rowBounds = (RowBounds) FieldUtils.readField( obj, "rowBounds", true ); + if ( rowBounds != null && rowBounds != RowBounds.DEFAULT ) { + FieldUtils.writeField( boundSql, "sql", newSql( sql, rowBounds ), true ); + FieldUtils.writeField( rowBounds, "offset", RowBounds.NO_ROW_OFFSET, true ); + FieldUtils.writeField( rowBounds, "limit", RowBounds.NO_ROW_LIMIT, true ); + } + } + return inv.proceed(); + } + + public String newSql(String oldSql, RowBounds rowBounds) { + String end = " limit " + rowBounds.getOffset() + "," + rowBounds.getLimit(); + return oldSql + end; + } + + @Override + public Object plugin(Object target) { + return Plugin.wrap( target, this ); + } + + @Override + public void setProperties(Properties arg0) { + } + +} \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppMapper.java b/appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppMapper.java new file mode 100644 index 0000000..ef413a0 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppMapper.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persistence.mapper.app; + +import java.util.List; +import app.market.model.app.App; +import app.market.model.app.AppExample; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Repository; + +@Repository(value = "AppMapper") +public interface AppMapper { + int countByExample(AppExample example); + + int deleteByExample(AppExample example); + + int deleteByPrimaryKey(String appId); + + int insert(App record); + + int insertSelective(App record); + + List selectByExample(AppExample example); + + List selectByExample(RowBounds rowBounds, AppExample example); + + App selectByPrimaryKey(String appId); + + App selectByCustomId(String appIdCustom); + + int updateByExampleSelective(@Param("record") App record, @Param("example") AppExample example); + + int updateByExample(@Param("record") App record, @Param("example") AppExample example); + + int updateByPrimaryKeySelective(App record); + + int updateByPrimaryKey(App record); + + int deleteByAppId(String appId); + + int SelectByCount(@Param("keyWord") String keyWord, @Param("appTypeId") String appTypeId, + @Param("deviceTypeId") String deviceTypeId, @Param("isPublic") String isPublic); + + List SelectByList(@Param("offset") int offset, @Param("limit") int limit, @Param("keyWord") String keyWord, + @Param("order") String order, @Param("sort") String sort,@Param("appTypeId") String appTypeId, + @Param("deviceTypeId") String deviceTypeId, @Param("isPublic") String isPublic); +} \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppVersionMapper.java b/appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppVersionMapper.java new file mode 100644 index 0000000..822ca63 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/mapper/app/AppVersionMapper.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persistence.mapper.app; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import app.market.model.app.AppVersion; +import app.market.model.app.AppVersionExample; + +@Repository(value = "AppVersionMapper") +public interface AppVersionMapper { + int countByExample(AppVersionExample example); + + int deleteByExample(AppVersionExample example); + + int deleteByPrimaryKey(String versionId); + + int insert(AppVersion record); + + int insertSelective(AppVersion record); + + List selectByExample(AppVersionExample example); + + AppVersion selectByPrimaryKey(String versionId); + + int updateByExampleSelective(@Param("record") AppVersion record, @Param("example") AppVersionExample example); + + int updateByExample(@Param("record") AppVersion record, @Param("example") AppVersionExample example); + + int updateByPrimaryKeySelective(AppVersion record); + + int updateByPrimaryKey(AppVersion record); + + int deleteByAppId(String appId); +} \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityMapper.java b/appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityMapper.java new file mode 100644 index 0000000..a64ed59 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityMapper.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persistence.mapper.authority; + +import java.util.List; +import app.market.model.authority.Authority; +import app.market.model.authority.AuthorityExample; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository(value = "AuthorityMapper") +public interface AuthorityMapper { + int countByExample(AuthorityExample example); + + int deleteByExample(AuthorityExample example); + + int deleteByPrimaryKey(String auId); + + int insert(Authority record); + + int insertSelective(Authority record); + + List selectByExample(AuthorityExample example); + + Authority selectByPrimaryKey(String auId); + + int updateByExampleSelective(@Param("record") Authority record, @Param("example") AuthorityExample example); + + int updateByExample(@Param("record") Authority record, @Param("example") AuthorityExample example); + + int updateByPrimaryKeySelective(Authority record); + + int updateByPrimaryKey(Authority record); + + List selectOption(); +} \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityResourceLinkMapper.java b/appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityResourceLinkMapper.java new file mode 100644 index 0000000..18b4c00 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/mapper/authority/AuthorityResourceLinkMapper.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persistence.mapper.authority; + +import java.util.List; +import app.market.model.authority.AuthorityResourceLinkExample; +import app.market.model.authority.AuthorityResourceLinkKey; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository(value = "AuthorityResourceLinkMapper") +public interface AuthorityResourceLinkMapper { + int countByExample(AuthorityResourceLinkExample example); + + int deleteByExample(AuthorityResourceLinkExample example); + + int deleteByPrimaryKey(AuthorityResourceLinkKey key); + + int insert(AuthorityResourceLinkKey record); + + int insertSelective(AuthorityResourceLinkKey record); + + List selectByExample(AuthorityResourceLinkExample example); + + int updateByExampleSelective(@Param("record") AuthorityResourceLinkKey record, + @Param("example") AuthorityResourceLinkExample example); + + int updateByExample(@Param("record") AuthorityResourceLinkKey record, + @Param("example") AuthorityResourceLinkExample example); +} \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/DictionaryMapper.java b/appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/DictionaryMapper.java new file mode 100644 index 0000000..e5e3137 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/DictionaryMapper.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persistence.mapper.resource; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import app.market.model.resource.Dictionary; +import app.market.model.resource.DictionaryExample; + +@Repository(value = "DictionaryMapper") +public interface DictionaryMapper { + int countByExample(DictionaryExample example); + + int deleteByExample(DictionaryExample example); + + int deleteByPrimaryKey(Integer dicId); + + int insert(Dictionary record); + + int insertSelective(Dictionary record); + + List selectByExample(DictionaryExample example); + + Dictionary selectByPrimaryKey(Integer dicId); + + int updateByExampleSelective(@Param("record") Dictionary record, @Param("example") DictionaryExample example); + + int updateByExample(@Param("record") Dictionary record, @Param("example") DictionaryExample example); + + int updateByPrimaryKeySelective(Dictionary record); + + int updateByPrimaryKey(Dictionary record); + + List selectItemsByTypeId(String typeId); +} \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/ResourceMapper.java b/appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/ResourceMapper.java new file mode 100644 index 0000000..54aed67 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/mapper/resource/ResourceMapper.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persistence.mapper.resource; + +import java.util.List; +import app.market.model.resource.Resource; +import app.market.model.resource.ResourceExample; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository(value = "ResourceMapper") +public interface ResourceMapper { + int countByExample(ResourceExample example); + + int deleteByExample(ResourceExample example); + + int deleteByPrimaryKey(String resId); + + int insert(Resource record); + + int insertSelective(Resource record); + + List selectByExample(ResourceExample example); + + Resource selectByPrimaryKey(String resId); + + int updateByExampleSelective(@Param("record") Resource record, @Param("example") ResourceExample example); + + int updateByExample(@Param("record") Resource record, @Param("example") ResourceExample example); + + int updateByPrimaryKeySelective(Resource record); + + int updateByPrimaryKey(Resource record); + + List selectResourcesByUserId(String userName); +} \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserAuthorityLinkMapper.java b/appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserAuthorityLinkMapper.java new file mode 100644 index 0000000..145cde7 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserAuthorityLinkMapper.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persistence.mapper.user; + +import java.util.List; +import app.market.model.user.UserAuthorityLinkExample; +import app.market.model.user.UserAuthorityLinkKey; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +@Repository(value = "UserAuthorityLinkMapper") +public interface UserAuthorityLinkMapper { + int countByExample(UserAuthorityLinkExample example); + + int deleteByExample(UserAuthorityLinkExample example); + + int deleteByPrimaryKey(UserAuthorityLinkKey key); + + int insert(UserAuthorityLinkKey record); + + int insertSelective(UserAuthorityLinkKey record); + + List selectByExample(UserAuthorityLinkExample example); + + int updateByExampleSelective(@Param("record") UserAuthorityLinkKey record, + @Param("example") UserAuthorityLinkExample example); + + int updateByExample(@Param("record") UserAuthorityLinkKey record, + @Param("example") UserAuthorityLinkExample example); +} \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserMapper.java b/appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserMapper.java new file mode 100644 index 0000000..e334146 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/mapper/user/UserMapper.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persistence.mapper.user; + +import java.util.List; +import app.market.model.user.User; +import app.market.model.user.UserExample; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Repository; + +@Repository(value = "UserMapper") +public interface UserMapper { + int countByExample(UserExample example); + + int deleteByExample(UserExample example); + + int deleteByPrimaryKey(String userId); + + int insert(User record); + + int insertSelective(User record); + + List selectByExample(UserExample example); + + User selectByPrimaryKey(String userId); + + List selectOptionByExample(UserExample example); + + User selectOneByExample(UserExample example); + + User selectByLoginId(String loginId); + + int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); + + int updateByExample(@Param("record") User record, @Param("example") UserExample example); + + int updateByPrimaryKeySelective(User record); + + int updateByPrimaryKey(User record); + + int updatePassword(User record); + + int updateByPrimaryKeyWithBLOBs(User record); + + int insertOrUpdate(User record); + + List selectByExample(RowBounds rowBounds, UserExample example); + + int deleteByUserName(String userName); + + int countByUserName(String userName); + + int countByUserId(String userId); + + User selectByUserName(String userName); +} \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml b/appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml new file mode 100644 index 0000000..d025f54 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppMapper.xml @@ -0,0 +1,368 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + APP_ID, APP_NAME, APP_ABSTRACT, + APP_TYPE_ID,APP_ID_CUSTOM,IMAGE_PATH, + (select category.DIC_LABEL + from t_dictionary as category + where category.DIC_VALUE = APP_TYPE_ID and category.DIC_TYPE="0100" + ) as TYPE_NAME, + DEVELOPER,USER_NAME, + APP_VERSION_ID, APP_CREATE_DATE, APP_UPDATE_DATE, APP_IS_DEL, + FILE_PATH, SIZE, VERSION_CREATE_DATE, MD5, VERSION_NAME, + APP_IS_PUBLIC, + (select public.DIC_LABEL + from t_dictionary as public + where public.DIC_VALUE = APP_IS_PUBLIC and public.DIC_TYPE="0102" + ) as PUBLIC_LABLE, + APP_DEVICE_TYPE_ID, + (select device.DIC_LABEL + from t_dictionary as device + where device.DIC_VALUE = APP_DEVICE_TYPE_ID and device.DIC_TYPE="0101" + ) as APP_DEVICE_TYPE_NAME + + + + + delete from t_app + where APP_ID = #{appId,jdbcType=CHAR} + + + delete from t_app + + + + + + insert into t_app (APP_ID, APP_NAME, APP_ABSTRACT, + APP_TYPE_ID, APP_DEVICE_TYPE_ID, DEVELOPER, APP_CREATE_DATE, + APP_UPDATE_DATE, APP_IS_DEL,APP_VERSION_ID, APP_IS_PUBLIC, + APP_ID_CUSTOM) + values (#{appId,jdbcType=CHAR}, #{appName,jdbcType=VARCHAR}, #{appAbstract,jdbcType=VARCHAR}, + #{typeId,jdbcType=CHAR}, #{appDeviceTypeId,jdbcType=CHAR}, #{developer,jdbcType=CHAR}, #{createDate,jdbcType=TIMESTAMP}, + #{updateDate,jdbcType=TIMESTAMP}, #{isDel,jdbcType=CHAR}, #{appVersionId,jdbcType=VARCHAR}, #{appIsPublic,jdbcType=CHAR}, + #{appIdCustom,jdbcType=VARCHAR}) + + + insert into t_app + + + APP_ID, + + + APP_NAME, + + + APP_ABSTRACT, + + + APP_TYPE_ID, + + + APP_DEVICE_TYPE_ID, + + + DEVELOPER, + + + APP_CREATE_DATE, + + + APP_UPDATE_DATE, + + + APP_IS_DEL, + + + APP_VERSION_ID, + + + APP_IS_PUBLIC, + + + APP_ID_CUSTOM, + + + + + #{appId,jdbcType=CHAR}, + + + #{appName,jdbcType=VARCHAR}, + + + #{appAbstract,jdbcType=VARCHAR}, + + + #{typeId,jdbcType=CHAR}, + + + #{appDeviceTypeId,jdbcType=CHAR}, + + + #{developer,jdbcType=CHAR}, + + + #{createDate,jdbcType=TIMESTAMP}, + + + #{updateDate,jdbcType=TIMESTAMP}, + + + #{isDel,jdbcType=CHAR}, + + + #{appVersionId,jdbcType=VARCHAR}, + + + #{appIsPublic,jdbcType=CHAR}, + + + #{appIdCustom,jdbcType=VARCHAR}, + + + + + + update t_app + + + APP_ID = #{record.appId,jdbcType=CHAR}, + + + APP_NAME = #{record.appName,jdbcType=VARCHAR}, + + + APP_ABSTRACT = #{record.appAbstract,jdbcType=VARCHAR}, + + + APP_TYPE_ID = #{record.typeId,jdbcType=CHAR}, + + + APP_DEVICE_TYPE_ID = #{record.appDeviceTypeId,jdbcType=CHAR}, + + + DEVELOPER = #{record.developer,jdbcType=CHAR}, + + + APP_CREATE_DATE = #{record.createDate,jdbcType=TIMESTAMP}, + + + APP_UPDATE_DATE = #{record.updateDate,jdbcType=TIMESTAMP}, + + + APP_IS_DEL = #{record.isDel,jdbcType=CHAR}, + + + APP_VERSION_ID = #{record.appVersionId,jdbcType=VARCHAR}, + + + APP_IS_PUBLIC = #{record.appIsPublic,jdbcType=CHAR}, + + + APP_ID_CUSTOM = #{record.appIdCustom,jdbcType=VARCHAR}, + + + + + + + + update t_app + set APP_ID = #{record.appId,jdbcType=CHAR}, + APP_NAME = #{record.appName,jdbcType=VARCHAR}, + APP_ABSTRACT = #{record.appAbstract,jdbcType=VARCHAR}, + APP_TYPE_ID = #{record.typeId,jdbcType=CHAR}, + APP_DEVICE_TYPE_ID = #{record.appDeviceTypeId,jdbcType=CHAR}, + DEVELOPER = #{record.developer,jdbcType=CHAR}, + APP_CREATE_DATE = #{record.createDate,jdbcType=TIMESTAMP}, + APP_UPDATE_DATE = #{record.updateDate,jdbcType=TIMESTAMP}, + APP_VERSION_ID = #{record.appVersionId,jdbcType=VARCHAR}, + APP_IS_DEL = #{record.isDel,jdbcType=CHAR}, + APP_IS_PUBLIC = #{record.appIsPublic,jdbcType=CHAR} + APP_ID_CUSTOM = #{record.appIdCustom,jdbcType=VARCHAR} + + + + + + update t_app + + + APP_NAME = #{appName,jdbcType=VARCHAR}, + + + APP_ABSTRACT = #{appAbstract,jdbcType=VARCHAR}, + + + APP_TYPE_ID = #{typeId,jdbcType=CHAR}, + + + APP_DEVICE_TYPE_ID = #{appDeviceTypeId,jdbcType=CHAR}, + + + DEVELOPER = #{developer,jdbcType=CHAR}, + + + APP_CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, + + + APP_UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP}, + + + APP_VERSION_ID = #{appVersionId,jdbcType=VARCHAR}, + + + APP_IS_DEL = #{isDel,jdbcType=CHAR}, + + + APP_IS_PUBLIC = #{appIsPublic,jdbcType=CHAR}, + + + APP_ID_CUSTOM = #{appIdCustom,jdbcType=VARCHAR}, + + + where APP_ID = #{appId,jdbcType=CHAR} + + + update t_app + set APP_NAME = #{appName,jdbcType=VARCHAR}, + APP_ABSTRACT = #{appAbstract,jdbcType=VARCHAR}, + APP_TYPE_ID = #{typeId,jdbcType=CHAR}, + APP_DEVICE_TYPE_ID = #{appDeviceTypeId,jdbcType=CHAR}, + DEVELOPER = #{developer,jdbcType=CHAR}, + APP_CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, + APP_UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP}, + APP_VERSION_ID = #{appVersionId,jdbcType=VARCHAR}, + APP_IS_DEL = #{isDel,jdbcType=CHAR}, + APP_IS_PUBLIC = #{appIsPublic,jdbcType=CHAR}, + APP_ID_CUSTOM = #{appIdCustom,jdbcType=VARCHAR} + where APP_ID = #{appId,jdbcType=CHAR} + + + update t_app + set APP_IS_DEL = "1", APP_ID_CUSTOM = concat(APP_ID_CUSTOM,"-",APP_ID) + where APP_ID = #{appId,jdbcType=CHAR} + + + + \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppVersionMapper.xml b/appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppVersionMapper.xml new file mode 100644 index 0000000..d8ab1b8 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/xml/app/AppVersionMapper.xml @@ -0,0 +1,298 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + VERSION_ID, V_APP_ID, VERSION_NAME, SIZE, COMMENT, FILE_PATH, MD5, VERSION_CREATE_DATE, + VERSION_IS_DEL, IMAGE_PATH + + + + + delete from t_app_version + where VERSION_ID = #{versionId,jdbcType=CHAR} + + + delete from t_app_version + + + + + + insert into t_app_version (VERSION_ID, V_APP_ID, VERSION_NAME, + SIZE, COMMENT, FILE_PATH, + MD5, VERSION_CREATE_DATE, VERSION_IS_DEL, + IMAGE_PATH) + values (#{versionId,jdbcType=CHAR}, #{vAppId,jdbcType=CHAR}, #{versionName,jdbcType=VARCHAR}, + #{size,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, + #{md5,jdbcType=CHAR}, #{versionCreateDate,jdbcType=TIMESTAMP}, #{versionIsDel,jdbcType=CHAR}, + #{imagePath,jdbcType=VARCHAR}) + + + insert into t_app_version + + + VERSION_ID, + + + V_APP_ID, + + + VERSION_NAME, + + + SIZE, + + + COMMENT, + + + FILE_PATH, + + + MD5, + + + VERSION_CREATE_DATE, + + + VERSION_IS_DEL, + + + IMAGE_PATH, + + + + + #{versionId,jdbcType=CHAR}, + + + #{vAppId,jdbcType=CHAR}, + + + #{versionName,jdbcType=VARCHAR}, + + + #{size,jdbcType=INTEGER}, + + + #{comment,jdbcType=VARCHAR}, + + + #{filePath,jdbcType=VARCHAR}, + + + #{md5,jdbcType=CHAR}, + + + #{versionCreateDate,jdbcType=TIMESTAMP}, + + + #{versionIsDel,jdbcType=CHAR}, + + + #{imagePath,jdbcType=VARCHAR}, + + + + + + update t_app_version + + + VERSION_ID = #{record.versionId,jdbcType=CHAR}, + + + V_APP_ID = #{record.vAppId,jdbcType=CHAR}, + + + VERSION_NAME = #{record.versionName,jdbcType=VARCHAR}, + + + SIZE = #{record.size,jdbcType=INTEGER}, + + + COMMENT = #{record.comment,jdbcType=VARCHAR}, + + + FILE_PATH = #{record.filePath,jdbcType=VARCHAR}, + + + MD5 = #{record.md5,jdbcType=CHAR}, + + + VERSION_CREATE_DATE = #{record.versionCreateDate,jdbcType=TIMESTAMP}, + + + VERSION_IS_DEL = #{record.versionIsDel,jdbcType=CHAR}, + + + IMAGE_PATH = #{record.imagePath,jdbcType=VARCHAR}, + + + + + + + + update t_app_version + set VERSION_ID = #{record.versionId,jdbcType=CHAR}, + V_APP_ID = #{record.vAppId,jdbcType=CHAR}, + VERSION_NAME = #{record.versionName,jdbcType=VARCHAR}, + SIZE = #{record.size,jdbcType=INTEGER}, + COMMENT = #{record.comment,jdbcType=VARCHAR}, + FILE_PATH = #{record.filePath,jdbcType=VARCHAR}, + MD5 = #{record.md5,jdbcType=CHAR}, + VERSION_CREATE_DATE = #{record.versionCreateDate,jdbcType=TIMESTAMP}, + VERSION_IS_DEL = #{record.versionIsDel,jdbcType=CHAR}, + IMAGE_PATH = #{record.imagePath,jdbcType=VARCHAR} + + + + + + update t_app_version + + + V_APP_ID = #{vAppId,jdbcType=CHAR}, + + + VERSION_NAME = #{versionName,jdbcType=VARCHAR}, + + + SIZE = #{size,jdbcType=INTEGER}, + + + COMMENT = #{comment,jdbcType=VARCHAR}, + + + FILE_PATH = #{filePath,jdbcType=VARCHAR}, + + + MD5 = #{md5,jdbcType=CHAR}, + + + VERSION_CREATE_DATE = #{versionCreateDate,jdbcType=TIMESTAMP}, + + + VERSION_IS_DEL = #{versionIsDel,jdbcType=CHAR}, + + + IMAGE_PATH = #{imagePath,jdbcType=VARCHAR}, + + + where VERSION_ID = #{versionId,jdbcType=CHAR} + + + update t_app_version + set V_APP_ID = #{vAppId,jdbcType=CHAR}, + VERSION_NAME = #{versionName,jdbcType=VARCHAR}, + SIZE = #{size,jdbcType=INTEGER}, + COMMENT = #{comment,jdbcType=VARCHAR}, + FILE_PATH = #{filePath,jdbcType=VARCHAR}, + MD5 = #{md5,jdbcType=CHAR}, + VERSION_CREATE_DATE = #{versionCreateDate,jdbcType=TIMESTAMP}, + VERSION_IS_DEL = #{versionIsDel,jdbcType=CHAR}, + IMAGE_PATH = #{imagePath,jdbcType=VARCHAR} + where VERSION_ID = #{versionId,jdbcType=CHAR} + + + update t_app_version + set VERSION_IS_DEL = "1" + where V_APP_ID = #{appId,jdbcType=CHAR} + + + \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityMapper.xml b/appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityMapper.xml new file mode 100644 index 0000000..7843e0a --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityMapper.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + AU_ID, AU_NAME, AU_IS_DEL + + + + + delete from t_authority + where AU_ID = #{auId,jdbcType=CHAR} + + + delete from t_authority + + + + + + insert into t_authority (AU_ID, AU_NAME, AU_IS_DEL + ) + values (#{auId,jdbcType=CHAR}, #{auName,jdbcType=VARCHAR}, #{isDel,jdbcType=CHAR} + ) + + + insert into t_authority + + + AU_ID, + + + AU_NAME, + + + AU_IS_DEL, + + + + + #{auId,jdbcType=CHAR}, + + + #{auName,jdbcType=VARCHAR}, + + + #{isDel,jdbcType=CHAR}, + + + + + + update t_authority + + + AU_ID = #{record.auId,jdbcType=CHAR}, + + + AU_NAME = #{record.auName,jdbcType=VARCHAR}, + + + AU_IS_DEL = #{record.isDel,jdbcType=CHAR}, + + + + + + + + update t_authority + set AU_ID = #{record.auId,jdbcType=CHAR}, + AU_NAME = #{record.auName,jdbcType=VARCHAR}, + AU_IS_DEL = #{record.isDel,jdbcType=CHAR} + + + + + + update t_authority + + + AU_NAME = #{auName,jdbcType=VARCHAR}, + + + AU_IS_DEL = #{isDel,jdbcType=CHAR}, + + + where AU_ID = #{auId,jdbcType=CHAR} + + + update t_authority + set AU_NAME = #{auName,jdbcType=VARCHAR}, + AU_IS_DEL = #{isDel,jdbcType=CHAR} + where AU_ID = #{auId,jdbcType=CHAR} + + + \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityResourceLinkMapper.xml b/appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityResourceLinkMapper.xml new file mode 100644 index 0000000..bff6c1f --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/xml/authority/AuthorityResourceLinkMapper.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + R_RES_ID, R_AU_ID + + + + delete from t_authority_resource_link + where R_RES_ID = #{resId,jdbcType=CHAR} + and R_AU_ID = #{auId,jdbcType=CHAR} + + + delete from t_authority_resource_link + + + + + + insert into t_authority_resource_link (R_RES_ID, R_AU_ID) + values (#{resId,jdbcType=CHAR}, #{auId,jdbcType=CHAR}) + + + insert into t_authority_resource_link + + + R_RES_ID, + + + R_AU_ID, + + + + + #{resId,jdbcType=CHAR}, + + + #{auId,jdbcType=CHAR}, + + + + + + update t_authority_resource_link + + + R_RES_ID = #{record.resId,jdbcType=CHAR}, + + + R_AU_ID = #{record.auId,jdbcType=CHAR}, + + + + + + + + update t_authority_resource_link + set R_RES_ID = #{record.resId,jdbcType=CHAR}, + R_AU_ID = #{record.auId,jdbcType=CHAR} + + + + + \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/xml/resource/DictionaryMapper.xml b/appmarket-persistence/src/main/java/app/market/persistence/xml/resource/DictionaryMapper.xml new file mode 100644 index 0000000..92bfaf9 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/xml/resource/DictionaryMapper.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + DIC_ID, DIC_TYPE, DIC_VALUE, DIC_LABEL + + + + + delete from t_dictionary + where DIC_ID = #{dicId,jdbcType=INTEGER} + + + delete from t_dictionary + + + + + + insert into t_dictionary (DIC_ID, DIC_TYPE, DIC_VALUE, DIC_LABEL) + select #{dicId,jdbcType=INTEGER}, + #{dicType,jdbcType=VARCHAR}, + (SELECT max(cast(DIC_VALUE as SIGNED))+1 FROM t_dictionary where DIC_TYPE = #{dicType,jdbcType=VARCHAR}), + #{dicLabel,jdbcType=VARCHAR} + + + insert into t_dictionary + + + DIC_ID, + + + DIC_TYPE, + + + DIC_VALUE, + + + DIC_LABEL, + + + + + #{dicId,jdbcType=INTEGER}, + + + #{dicType,jdbcType=VARCHAR}, + + + #{dicValue,jdbcType=VARCHAR}, + + + #{dicLabel,jdbcType=VARCHAR}, + + + + + + update t_dictionary + + + DIC_ID = #{record.dicId,jdbcType=INTEGER}, + + + DIC_TYPE = #{record.dicType,jdbcType=VARCHAR}, + + + DIC_VALUE = #{record.dicValue,jdbcType=VARCHAR}, + + + DIC_LABEL = #{record.dicLabel,jdbcType=VARCHAR}, + + + + + + + + update t_dictionary + set DIC_LABEL = #{record.dicLabel,jdbcType=VARCHAR} + + + + + + update t_dictionary + + + DIC_TYPE = #{dicType,jdbcType=VARCHAR}, + + + DIC_VALUE = #{dicValue,jdbcType=VARCHAR}, + + + DIC_LABEL = #{dicLabel,jdbcType=VARCHAR}, + + + where DIC_ID = #{dicId,jdbcType=INTEGER} + + + update t_dictionary + set DIC_TYPE = #{dicType,jdbcType=VARCHAR}, + DIC_VALUE = #{dicValue,jdbcType=VARCHAR}, + DIC_LABEL = #{dicLabel,jdbcType=VARCHAR} + where DIC_ID = #{dicId,jdbcType=INTEGER} + + + \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/xml/resource/ResourceMapper.xml b/appmarket-persistence/src/main/java/app/market/persistence/xml/resource/ResourceMapper.xml new file mode 100644 index 0000000..876607e --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/xml/resource/ResourceMapper.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + RES_ID, RES_NAME, RES_TYPE, ACCESS_PATH, HTTP_METHOD + + + + + delete from t_resource + where RES_ID = #{resId,jdbcType=CHAR} + + + delete from t_resource + + + + + + insert into t_resource (RES_ID, RES_NAME, RES_TYPE, + ACCESS_PATH,HTTP_METHOD) + values (#{resId,jdbcType=CHAR}, #{resName,jdbcType=VARCHAR}, #{resType,jdbcType=VARCHAR}, + #{accessPath,jdbcType=VARCHAR}, #{httpMethod,jdbcType=VARCHAR}) + + + insert into t_resource + + + RES_ID, + + + RES_NAME, + + + RES_TYPE, + + + ACCESS_PATH, + + + HTTP_METHOD, + + + + + #{resId,jdbcType=CHAR}, + + + #{resName,jdbcType=VARCHAR}, + + + #{resType,jdbcType=VARCHAR}, + + + #{accessPath,jdbcType=VARCHAR}, + + + #{httpMethod,jdbcType=VARCHAR}, + + + + + + update t_resource + + + RES_ID = #{record.resId,jdbcType=CHAR}, + + + RES_NAME = #{record.resName,jdbcType=VARCHAR}, + + + RES_TYPE = #{record.resType,jdbcType=VARCHAR}, + + + ACCESS_PATH = #{record.accessPath,jdbcType=VARCHAR}, + + + HTTP_METHOD = #{record.httpMethod,jdbcType=VARCHAR}, + + + + + + + + update t_resource + set RES_ID = #{record.resId,jdbcType=CHAR}, + RES_NAME = #{record.resName,jdbcType=VARCHAR}, + RES_TYPE = #{record.resType,jdbcType=VARCHAR}, + ACCESS_PATH = #{record.accessPath,jdbcType=VARCHAR}, + HTTP_METHOD = #{record.httpMethod,jdbcType=VARCHAR} + + + + + + update t_resource + + + RES_NAME = #{resName,jdbcType=VARCHAR}, + + + RES_TYPE = #{resType,jdbcType=VARCHAR}, + + + ACCESS_PATH = #{accessPath,jdbcType=VARCHAR}, + + + HTTP_METHOD = #{httpMethod,jdbcType=VARCHAR}, + + + where RES_ID = #{resId,jdbcType=CHAR} + + + update t_resource + set RES_NAME = #{resName,jdbcType=VARCHAR}, + RES_TYPE = #{resType,jdbcType=VARCHAR}, + ACCESS_PATH = #{accessPath,jdbcType=VARCHAR}, + HTTP_METHOD = #{httpMethod,jdbcType=VARCHAR} + where RES_ID = #{resId,jdbcType=CHAR} + + + \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserAuthorityLinkMapper.xml b/appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserAuthorityLinkMapper.xml new file mode 100644 index 0000000..367aad2 --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserAuthorityLinkMapper.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + A_USER_ID, A_AU_ID + + + + delete from t_user_authority_link + where A_USER_ID = #{userId,jdbcType=CHAR} + and A_AU_ID = #{auId,jdbcType=CHAR} + + + delete from t_user_authority_link + + + + + + insert into t_user_authority_link (A_USER_ID, A_AU_ID) + values (#{userId,jdbcType=CHAR}, #{auId,jdbcType=CHAR}) + + + insert into t_user_authority_link + + + A_USER_ID, + + + A_AU_ID, + + + + + #{userId,jdbcType=CHAR}, + + + #{auId,jdbcType=CHAR}, + + + + + + update t_user_authority_link + + + A_USER_ID = #{record.userId,jdbcType=CHAR}, + + + A_AU_ID = #{record.auId,jdbcType=CHAR}, + + + + + + + + update t_user_authority_link + set A_USER_ID = #{record.userId,jdbcType=CHAR}, + A_AU_ID = #{record.auId,jdbcType=CHAR} + + + + + \ No newline at end of file diff --git a/appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserMapper.xml b/appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserMapper.xml new file mode 100644 index 0000000..f1c63da --- /dev/null +++ b/appmarket-persistence/src/main/java/app/market/persistence/xml/user/UserMapper.xml @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + USER_ID, USER_PW, USER_NAME, MAIL_ADDRESS, CREATE_DATE, UPDATE_DATE, IS_DEL, ual.A_AU_ID, au.AU_NAME + + + USER_ID, USER_NAME, MAIL_ADDRESS, CREATE_DATE, UPDATE_DATE, IS_DEL, ual.A_AU_ID, au.AU_NAME + + + + + + delete from t_user + where USER_ID = #{userId,jdbcType=CHAR} + + + delete from t_user + + + + + + insert into t_user (USER_ID, USER_PW, USER_NAME, + MAIL_ADDRESS, CREATE_DATE, UPDATE_DATE, + IS_DEL) + values (#{userId,jdbcType=CHAR}, #{userPw,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, + #{mailAddress,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{updateDate,jdbcType=TIMESTAMP}, + #{isDel,jdbcType=CHAR}) + + + insert into t_user + + + USER_ID, + + + USER_PW, + + + USER_NAME, + + + MAIL_ADDRESS, + + + CREATE_DATE, + + + UPDATE_DATE, + + + IS_DEL, + + + + + #{userId,jdbcType=CHAR}, + + + #{userPw,jdbcType=VARCHAR}, + + + #{userName,jdbcType=VARCHAR}, + + + #{mailAddress,jdbcType=VARCHAR}, + + + #{createDate,jdbcType=TIMESTAMP}, + + + #{updateDate,jdbcType=TIMESTAMP}, + + + #{isDel,jdbcType=CHAR}, + + + + + + update t_user + + + USER_ID = #{record.userId,jdbcType=CHAR}, + + + USER_PW = #{record.userPw,jdbcType=VARCHAR}, + + + USER_NAME = #{record.userName,jdbcType=VARCHAR}, + + + MAIL_ADDRESS = #{record.mailAddress,jdbcType=VARCHAR}, + + + CREATE_DATE = #{record.createDate,jdbcType=TIMESTAMP}, + + + UPDATE_DATE = #{record.updateDate,jdbcType=TIMESTAMP}, + + + IS_DEL = #{record.isDel,jdbcType=CHAR}, + + + + + + + + update t_user + set USER_ID = #{record.userId,jdbcType=CHAR}, + USER_PW = #{record.userPw,jdbcType=VARCHAR}, + USER_NAME = #{record.userName,jdbcType=VARCHAR}, + MAIL_ADDRESS = #{record.mailAddress,jdbcType=VARCHAR}, + CREATE_DATE = #{record.createDate,jdbcType=TIMESTAMP}, + UPDATE_DATE = #{record.updateDate,jdbcType=TIMESTAMP}, + IS_DEL = #{record.isDel,jdbcType=CHAR} + + + + + + update t_user + + + USER_PW = #{userPw,jdbcType=VARCHAR}, + + + USER_NAME = #{userName,jdbcType=VARCHAR}, + + + MAIL_ADDRESS = #{mailAddress,jdbcType=VARCHAR}, + + + CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, + + + UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP}, + + + IS_DEL = #{isDel,jdbcType=CHAR}, + + + where USER_ID = #{userId,jdbcType=CHAR} + + + update t_user + set USER_PW = #{userPw,jdbcType=VARCHAR}, + USER_NAME = #{userName,jdbcType=VARCHAR}, + MAIL_ADDRESS = #{mailAddress,jdbcType=VARCHAR}, + CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, + UPDATE_DATE = #{updateDate,jdbcType=TIMESTAMP}, + IS_DEL = #{isDel,jdbcType=CHAR} + where USER_ID = #{userId,jdbcType=CHAR} + + + update t_user + set USER_PW = #{userPw,jdbcType=VARCHAR} + where USER_NAME = #{userName,jdbcType=VARCHAR} + and USER_PW = #{userPwBak,jdbcType=VARCHAR} + + + insert into t_user (USER_NAME, USER_PW, MAIL_ADDRESS, + CREATE_DATE, UPDATE_DATE, IS_DEL + ) + values (#{userName,jdbcType=VARCHAR}, #{userPw,jdbcType=VARCHAR}, #{mailAddress,jdbcType=VARCHAR}, + NOW(), NOW(), #{isDel,jdbcType=INTEGER}} + ) + ON DUPLICATE KEY UPDATE + t_user.USER_NAME = #{userName,jdbcType=VARCHAR}, + MAIL_ADDRESS = #{mailAddress,jdbcType=VARCHAR}, + UPDATE_DATE = NOW(), + IS_DEL = #{isDel,jdbcType=INTEGER}, + + t_user.USER_PW = #{userPw,jdbcType=VARCHAR} + + + + delete from t_user + where USER_NAME = #{userName,jdbcType=VARCHAR} + + + + + + \ No newline at end of file diff --git a/appmarket-persistence/src/test/java/app/market/persisitence/AppTest.java b/appmarket-persistence/src/test/java/app/market/persisitence/AppTest.java new file mode 100644 index 0000000..c0af50c --- /dev/null +++ b/appmarket-persistence/src/test/java/app/market/persisitence/AppTest.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * 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 app.market.persisitence; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} -- cgit