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/UnitMaintainPlatformDao.xml

183 lines
6.6 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.UnitMaintainPlatformDao">
<select id="getLinkPlatformList" resultType="com.glxp.api.res.inout.PlatformLinkResponse">
SELECT a1.id as platformId,
a1.`name`,
a1.`host`,
iu.id,
iu.unitId,
iu.customerId,
iu.invCode,
iu.targetAction,
iu.sourceAction,
iu.invSubCode,
b1.`name` as corpName
FROM auth_platform a1
LEFT JOIN io_unit_maintain_platform iu ON a1.id = iu.platformId
LEFT JOIN basic_corp b1 ON b1.erpId = iu.unitId
<where>
<if test="key != null and key != ''">
AND a1.`name` = #{key}
</if>
</where>
GROUP BY a1.id
</select>
<select id="selectByCustomerId" resultType="com.glxp.api.entity.inout.UnitMaintainPlatformEntity">
select *
from io_unit_maintain_platform
where customerId = #{customerId}
</select>
<update id="updateById" parameterType="com.glxp.api.entity.inout.UnitMaintainPlatformEntity">
update io_unit_maintain_platform
<trim prefix="set" suffixOverrides=",">
<if test="unitId != null and unitId != ''">
unitId = #{unitId},
</if>
<if test="customerId != null">
customerId = #{customerId},
</if>
<if test="platformId != null and platformId != ''">
platformId = #{platformId},
</if>
<if test="sourceAction != null and sourceAction != ''">
sourceAction = #{sourceAction},
</if>
<if test="targetAction != null and targetAction != ''">
targetAction = #{targetAction},
</if>
<if test="invCode != null and invCode != ''">
invCode = #{invCode},
</if>
<if test="invSubCode != null and invSubCode != ''">
invSubCode = #{invSubCode},
</if>
<if test="appid != null and appid != ''">
appid = #{appid},
</if>
<if test="apiKey != null and apiKey != ''">
apiKey = #{apiKey},
</if>
<if test="secretKey != null and secretKey != ''">
secretKey = #{secretKey},
</if>
<if test="invName != null and invName != ''">
invName = #{invName},
</if>
<if test="invSubName != null and invSubName != ''">
invSubName = #{invSubName},
</if>
<if test="targetName != null and targetName != ''">
targetName = #{targetName}
</if>
</trim>
where id = #{id}
</update>
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id"
parameterType="com.glxp.api.entity.inout.UnitMaintainPlatformEntity">
insert into io_unit_maintain_platform (unitId, customerId, platformId, sourceAction, targetAction, invCode,
invSubCode, appid, apiKey, secretKey, invName, invSubName, targetName)
VALUES (#{unitId}, #{customerId}, #{platformId}, #{sourceAction}, #{targetAction}, #{invCode}, #{invSubCode},
#{appid}, #{apiKey}, #{secretKey}, #{invName}, #{invSubName}, #{targetName})
</insert>
<select id="selectList" resultType="com.glxp.api.entity.inout.UnitMaintainPlatformEntity">
select *
from io_unit_maintain_platform
<where>
<if test="unitId != null and unitId != ''">
AND unitId = #{unitId}
</if>
<if test="platformId != null and platformId != ''">
AND platformId = #{platformId}
</if>
<if test="sourceAction != null and sourceAction != ''">
AND sourceAction = #{sourceAction}
</if>
<if test="targetAction != null and targetAction != ''">
AND targetAction = #{targetAction}
</if>
<if test="invSubCode != null and invSubCode != ''">
AND invCode = #{invCode}
</if>
<if test="invSubCode != null and invSubCode != ''">
AND invSubCode = #{invSubCode}
</if>
</where>
</select>
<select id="findLinkData" resultType="com.glxp.api.entity.inout.UnitMaintainPlatformEntity">
select *
from io_unit_maintain_platform
<where>
<if test="unitId != null and unitId != ''">
AND unitId = #{unitId}
</if>
<if test="customerId != null">
AND customerId = #{customerId}
</if>
<if test="action != null and action != ''">
AND sourceAction = #{action}
</if>
</where>
</select>
<delete id="deleteById">
delete
from io_unit_maintain_platform
where id = #{id}
</delete>
<select id="selectCount" resultType="java.lang.Long">
select count(*)
from io_unit_maintain_platform
where sourceAction = #{action}
and unitId = #{unitId}
</select>
<select id="selectDelectList" resultType="com.glxp.api.res.inout.PlatformLinkResponse">
SELECT io.id,
io.unitId,
io.platformId,
io.invCode,
io.invName,
io.invSubCode,
io.invSubName,
io.targetAction,
io.targetName,
io.sourceAction,
io.appid,
io.apiKey,
io.secretKey,
b1.`name` as sourceName
FROM io_unit_maintain_platform io
LEFT JOIN basic_bussiness_type b1 ON b1.action = io.sourceAction
where io.platformId = #{platformId}
</select>
<select id="selectByUnitld" resultType="com.glxp.api.res.inout.PlatformLinkResponse">
SELECT
io.id,
io.unitId,
io.platformId,
io.customerId,
io.invCode,
io.invName,
io.invSubCode,
io.invSubName,
io.targetAction,
io.targetName,
io.sourceAction,
io.appid,
io.secretKey,
a1.host
FROM io_unit_maintain_platform io
inner join auth_platform a1 on a1.id = io.platformId
where io.unitId = #{unitld} and io.sourceAction = #{sourceAction}
GROUP BY io.unitId
</select>
</mapper>