You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-wms-java/src/main/resources/mybatis/mapper/inout/PlatformDao.xml

107 lines
3.2 KiB
XML

<?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.glxp.api.dao.inout.PlatformDao">
<insert id="batchSave" parameterType="java.util.List">
replace into auth_platform
(id, name, host)
values
<foreach item="item" index="index" collection="list"
separator=",">
(#{item.id}, #{item.name,jdbcType=VARCHAR}, #{item.host,jdbcType=VARCHAR})
</foreach>
</insert>
<select id="get" resultType="com.glxp.api.entity.system.PlatformEntity">
select *
from auth_platform
where id = #{value}
</select>
<select id="list" resultType="com.glxp.api.entity.system.PlatformEntity">
select *
from auth_platform
<where>
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="name != null and name != ''">
and instr(name, #{name})
</if>
<if test="host != null and host != ''">
and instr(host, #{host})
</if>
</where>
order by id desc
</select>
<select id="count" resultType="int">
select count(*)
from auth_platform
<where>
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="name != null and name != ''">
and instr(name, #{name})
</if>
<if test="host != null and host != ''">
and instr(host, #{host})
</if>
</where>
</select>
<select id="selectByNameAndHost" resultType="com.glxp.api.entity.system.PlatformEntity">
select *
from auth_platform
where name = #{name}
and host = #{host}
</select>
<select id="selectById" resultType="com.glxp.api.entity.system.PlatformEntity">
select *
from auth_platform
where id = #{platformId}
</select>
<insert id="insert">
insert into auth_platform(id, name, host)
VALUES (#{id}, #{name}, #{host})
</insert>
<select id="selectList" resultType="com.glxp.api.entity.system.PlatformEntity">
select *
from auth_platform
<where>
<if test="id != null and id != '' and id != 'null'">
AND id = #{id}
</if>
<if test="name != null and name != '' and name != 'null'">
AND name like concat('%', #{name}, '%')
</if>
<if test="host != null and host != '' and host != 'null'">
AND host like concat('%', #{host}, '%')
</if>
</where>
</select>
<delete id="deleteById">
delete
from auth_platform
where id = #{id}
</delete>
<update id="updateById">
update auth_platform
<trim prefix="set" suffixOverrides=",">
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="host != null and host != ''">
host = #{host},
</if>
</trim>
where id = #{id}
</update>
</mapper>