| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ard.work.mapper.ArdServerInfoMapper"> |
| | | |
| | | <resultMap type="ArdServerInfo" id="ArdServerManagementResult"> |
| | | <resultMap type="ArdServerInfo" id="ArdServerInfoResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="serverName" column="server_name" /> |
| | | <result property="host" column="host" /> |
| | |
| | | <result property="serverStatus" column="server_status" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdServerInfoVoNo"> |
| | | select id, |
| | | server_name, |
| | | host, |
| | | tcp_port, |
| | | http_port, |
| | | access_key_id, |
| | | access_key_secret, |
| | | longitude, |
| | | latitude, |
| | | altitude, |
| | | user_id, |
| | | dept_id, |
| | | server_status |
| | | from ard_server |
| | | </sql> |
| | | |
| | | <sql id="selectArdServerInfoVo"> |
| | | select c.id, |
| | | c.server_name, |
| | |
| | | c.user_id, |
| | | c.dept_id, |
| | | c.server_status |
| | | from ard_server_info c |
| | | from ard_server c |
| | | left join sys_dept d on d.dept_id = c.dept_id |
| | | left join sys_user u on u.user_id = c.user_id |
| | | </sql> |
| | |
| | | <include refid="selectArdServerInfoVo"/> |
| | | <where> |
| | | <if test="id != null and id != ''"> and c.id = #{id}</if> |
| | | <if test="serverName != null and serverName != ''"> and server_name like c.concat('%', #{serverName}, '%')</if> |
| | | <if test="serverName != null and serverName != ''"> and c.server_name like concat('%', #{serverName}, '%')</if> |
| | | <if test="accessKeyId != null and accessKeyId != ''"> and c.access_key_id = #{accessKeyId}</if> |
| | | <if test="accessKeySecret != null and accessKeySecret != ''"> and c.access_key_secret = #{accessKeySecret}</if> |
| | | <if test="serverStatus != null and serverStatus != ''"> and c.server_status = #{serverStatus}</if> |
| | |
| | | </select> |
| | | |
| | | <insert id="insertArdServerInfo" parameterType="ArdServerInfo"> |
| | | insert into ard_server_info |
| | | insert into ard_server |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="serverName != null">server_name,</if> |
| | |
| | | </insert> |
| | | |
| | | <update id="updateArdServerInfo" parameterType="ArdServerInfo"> |
| | | update ard_server_info |
| | | update ard_server |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="serverName != null">server_name = #{serverName},</if> |
| | | <if test="host != null">host = #{host},</if> |
| | |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="updateServerStatus"> |
| | | update ard_server |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="status != null">server_status = #{status},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdServerInfoById" parameterType="String"> |
| | | delete from ard_server_info where id = #{id} |
| | | delete from ard_server where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdServerInfoByIds" parameterType="String"> |
| | | delete from ard_server_info where id in |
| | | delete from ard_server where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="getServerIdsList" resultType="String"> |
| | | SELECT id |
| | | FROM ard_server |
| | | where server_status = "1" |
| | | </select> |
| | | </mapper> |