ServerConfigMapper.xml
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sibu.orderHelper.base.dao.ServerConfigDao">
<!-- <cache type="org.mybatis.caches.ehcache.EhcacheCache"/> -->
<select id="gerOneServerDbConfig" resultMap="resultServerConfigBean" parameterType="map">
SELECT * from server_config where database_type = #{databaseType} and modules = #{moduleIndex} limit 1
</select>
<select id="listServerConfig" resultMap="resultServerConfigBean">
select * from server_config
</select>
<select id="countOneTypeServerConfig" parameterType="int" resultType="int">
select count(*) from server_config where database_type = #{dataType}
</select>
<insert id="addServerDbConfig" parameterType="map">
insert into server_config (database_id,database_type,modules,database_driver,database_url,database_username,database_password)
value(
#{dbConfig.databaseId},
#{dbConfig.databaseType},
#{dbConfig.modules},
#{dbConfig.databaseDriver},
#{dbConfig.databaseUrl},
#{dbConfig.databaseUsername},
#{dbConfig.databasePassword}
)
</insert>
<resultMap type="ServerConfigBean" id="resultServerConfigBean">
<result column="database_id" property="databaseId" />
<result column="database_type" property="databaseType" />
<result column="modules" property="modules" />
<result column="database_driver" property="databaseDriver" />
<result column="database_url" property="databaseUrl" />
<result column="database_username" property="databaseUsername" />
<result column="database_password" property="databasePassword" />
</resultMap>
</mapper>