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.
spms-java/api-admin/src/main/resources/mybatis/mapper/basic/BasicUnitMaintainDao.xml

258 lines
8.9 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.sale.admin.dao.basic.BasicUnitMaintainDao">
<select id="filterList" parameterType="com.glxp.sale.admin.req.basic.BasicUnitMaintainFilterRequest"
resultType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
SELECT * FROM basic_corp
<where>
<if test="key != '' and key!=null">
and
( name like concat('%',#{key},'%')
or spell like concat('%',#{key},'%')
or erpId like concat('%',#{key},'%')
or creditNo like concat('%',#{key},'%')
or thirdId like concat('%',#{key},'%')
or thirdId1 like concat('%',#{key},'%')
or thirdId2 like concat('%',#{key},'%')
or thirdId3 like concat('%',#{key},'%')
or thirdId4 like concat('%',#{key},'%')
or addr like concat('%',#{key},'%')
)
</if>
<if test="id != '' and id != null">
AND id = #{id}
</if>
<if test="unitId != '' and unitId != null">
AND unitId = #{unitId}
</if>
<if test="erpId != '' and erpId != null">
AND erpId = #{erpId}
</if>
<if test="corpType != null">
AND corpType = #{corpType}
</if>
<if test="outType != null">
AND ( outType <![CDATA[ <> ]]> #{outType} or outType is NULL)
</if>
</where>
order by updateTime desc
</select>
<select id="selectByThirdId" parameterType="com.glxp.sale.admin.req.basic.BasicUnitMaintainFilterRequest"
resultType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
select * FROM basic_corp
<where>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="thirdId1 != '' and thirdId1 != null">
AND thirdId1 = #{thirdId1}
</if>
<if test="thirdId2 != '' and thirdId2 != null">
AND thirdId2 = #{thirdId2}
</if>
<if test="thirdId3 != '' and thirdId3 != null">
AND thirdId3 = #{thirdId3}
</if>
<if test="thirdId4 != '' and thirdId4 != null">
AND thirdId4 = #{thirdId4}
</if>
<if test="corpType != null">
AND corpType = #{corpType}
</if>
</where>
limit 1
</select>
<insert id="insertBasicUnitMaintain" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
REPLACE
INTO basic_corp
(thirdId,erpId,name,spell,
addr,status,type,creditNo,contact,mobile,thirdId1,thirdId2,thirdId3,thirdId4,
thirdName,thirdName1,thirdName2,thirdName3,thirdName4,updateTime,corpType,outType)
values
(
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType}
)
</insert>
<insert id="insertBasicUnitMaintainignore" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
insert
ignore
INTO basic_corp
(thirdId,erpId,name,spell,
addr,status,type,creditNo,contact,mobile,thirdId1,thirdId2,thirdId3,thirdId4,
thirdName,thirdName1,thirdName2,thirdName3,thirdName4,updateTime,corpType,outType)
values
(
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},#{outType}
)
</insert>
<insert id="insert" parameterType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
insert INTO basic_corp(thirdId, erpId, name, spell, addr,
status, type, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType,outType)
values (#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1}, #{thirdId2}, #{thirdId3}, #{thirdId4},
#{thirdName}, #{thirdName1}, #{thirdName2}, #{thirdName3}, #{thirdName4}, #{updateTime}, #{corpType},#{outType})
</insert>
<update id="updateById" parameterType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
UPDATE basic_corp
<trim prefix="set" suffixOverrides=",">
<if test="thirdId != null">thirdId=#{thirdId},</if>
<if test="erpId != null">erpId=#{erpId},</if>
<if test="name != null">name=#{name},</if>
<if test="spell != null">spell=#{spell},</if>
<if test="addr != null">addr=#{addr},</if>
<if test="status != null">status=#{status},</if>
<if test="type != null">type=#{type},</if>
<if test="creditNo != null">creditNo=#{creditNo},</if>
<if test="contact != null">contact=#{contact},</if>
<if test="mobile != null">mobile=#{mobile},</if>
<if test="thirdId1 != null">thirdId1=#{thirdId1},</if>
<if test="thirdId2 != null">thirdId2=#{thirdId2},</if>
<if test="thirdId3 != null">thirdId3=#{thirdId3},</if>
<if test="thirdId4 != null">thirdId4=#{thirdId4},</if>
<if test="thirdName != null">thirdName=#{thirdName},</if>
<if test="thirdName1 != null">thirdName1=#{thirdName1},</if>
<if test="thirdName2 != null">thirdName2=#{thirdName2},</if>
<if test="thirdName3 != null">thirdName3=#{thirdName3},</if>
<if test="thirdName4 != null">thirdName4=#{thirdName4},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="corpType != null">corpType=#{corpType},</if>
<if test="outType != null">outType=#{outType},</if>
</trim>
WHERE id=#{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_corp
WHERE id = #{id}
</delete>
<select id="selectById" parameterType="Map" resultType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
select *
FROM basic_corp
WHERE id = #{id}
</select>
<select id="batchSelectByIds" resultType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
select *
from basic_corp where id in
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="batchSelectByErpIds" resultType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
select *
from basic_corp where erpId in
<foreach collection="erpIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="selectByName" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity">
SELECT *
FROM basic_corp
WHERE (name = #{name}) limit 1
</select>
<insert id="importBasicUnitMaintain" keyProperty="id">
REPLACE
INTO basic_corp
( thirdId, erpId, name, spell,
addr, status, type, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType,outType)
values (
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},#{outType}
)
</insert>
</mapper>