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.

105 lines
3.8 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.udidl.admin.dao.udi.UdiCompanyDao">
<select id="selectAllTyshxyh"
resultType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
SELECT deviceRecordKey,tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc FROM device
GROUP BY tyshxydm
</select>
<select id="selectContactBykey" parameterType="Map"
resultType="com.glxp.udidl.admin.entity.udid.Contactlist">
SELECT qylxrdh,qylxryx,qylxrcz from contactlist
WHERE deviceRecordKey = #{deviceRecordKey}
</select>
<select id="filterUdiCompany"
parameterType="com.glxp.udidl.admin.req.UdiCompanyRequest"
resultType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
SELECT * FROM udicompany
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat('%',#{ylqxzcrbarmc},'%')
</if>
<if test="tyshxydm != '' and tyshxydm != null">
AND tyshxydm =#{tyshxydm}
</if>
<if test="provinceCode != '' and provinceCode != null">
AND SUBSTRING(tyshxydm,3,2) = #{provinceCode}
</if>
<if test="cityCode != '' and cityCode != null">
AND SUBSTRING(tyshxydm,3,4) = #{cityCode}
</if>
<if test="areaCode != '' and areaCode != null">
AND SUBSTRING(tyshxydm,3,6) = #{areaCode}
</if>
</where>
</select>
<select id="searchByName" parameterType="java.lang.String" resultType="java.lang.String">
select ylqxzcrbarmc from udicompany where ylqxzcrbarmc like concat('%',#{name},'%') limit 50
</select>
<insert id="insertUdiCompany" keyProperty="id" parameterType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
REPLACE INTO udicompany
(
tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc,qylxrdh,
qylxrcz,qylxryx
)
values
(
#{tyshxydm},
#{ylqxzcrbarmc},
#{ylqxzcrbarywmc},
#{qylxrdh},
#{qylxrcz},
#{qylxryx}
)
</insert>
<insert id="insertUdiCompanys" keyProperty="id" parameterType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
replace INTO udicompany(
tyshxydm,ylqxzcrbarmc,ylqxzcrbarywmc,qylxrdh,
qylxrcz,qylxryx)
values
<foreach collection="udiCompanyEntities" item="item" index="index"
separator=",">
(
#{item.tyshxydm},
#{item.ylqxzcrbarmc},
#{item.ylqxzcrbarywmc},
#{item.qylxrdh},
#{item.qylxrcz},
#{item.qylxryx})
</foreach>
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM udicompany WHERE id = #{id}
</delete>
<delete id="deleteAll" parameterType="java.util.List">
DELETE FROM udicompany WHERE id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<update id="updateUdiCompany" parameterType="com.glxp.udidl.admin.entity.udi.UdiCompanyEntity">
UPDATE udicompany
<set>
<if test="tyshxydm != null">tyshxydm=#{tyshxydm},</if>
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
<if test="ylqxzcrbarywmc != null">ylqxzcrbarywmc=#{ylqxzcrbarywmc},</if>
<if test="qylxrdh != null">qylxrdh=#{qylxrdh},</if>
<if test="qylxrcz != null">qylxrcz=#{qylxrcz},</if>
<if test="qylxryx != null">qylxryx=#{qylxryx},</if>
</set>
WHERE id = #{id}
</update>
</mapper>