|
@@ -0,0 +1,226 @@
|
|
|
+<?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.caimei365.user.mapper.CmProvidersMapper">
|
|
|
+
|
|
|
+ <resultMap type="CmProviders" id="CmProvidersResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="userId" column="userId" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="serviceLevel" column="serviceLevel" />
|
|
|
+ <result property="serviceCategory" column="serviceCategory" />
|
|
|
+ <result property="address" column="address" />
|
|
|
+ <result property="linkMan" column="linkMan" />
|
|
|
+ <result property="mobile" column="mobile" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="text" column="text" />
|
|
|
+ <result property="qrCodeImage" column="qrCodeImage" />
|
|
|
+ <result property="qualificationImage" column="qualificationImage" />
|
|
|
+ <result property="qualificationId" column="qualificationId" />
|
|
|
+ <result property="createBy" column="createBy" />
|
|
|
+ <result property="updateTime" column="updateTime" />
|
|
|
+ <result property="createTime" column="createTime" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCmProvidersVo">
|
|
|
+ select
|
|
|
+ cm_providers.id,
|
|
|
+ cm_providers.userId,
|
|
|
+ cm_providers.name,
|
|
|
+ cm_providers.serviceLevel,
|
|
|
+ cm_providers.serviceCategory,
|
|
|
+ cm_providers.address,
|
|
|
+ cm_providers.linkMan,
|
|
|
+ cm_providers.mobile,
|
|
|
+ cm_providers.status,
|
|
|
+ cm_providers.text,
|
|
|
+ cm_providers.qrCodeImage,
|
|
|
+ cm_providers.qualificationImage,
|
|
|
+ cm_providers.qualificationId,
|
|
|
+ cm_providers.createBy,
|
|
|
+ cm_providers.updateTime,
|
|
|
+ cm_providers.createTime
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getByCmProviders" parameterType="CmProviders" resultMap="CmProvidersResult">
|
|
|
+ <include refid="selectCmProvidersVo"/>
|
|
|
+ from cm_providers AS cm_providers
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''"> and cm_providers.id = #{id}</if>
|
|
|
+ <if test="userId != null "> and cm_providers.userId = #{userId}</if>
|
|
|
+ <if test="name != null and name != ''"> and cm_providers.name =#{name}</if>
|
|
|
+ <if test="serviceLevel != null "> and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
+ <if test="serviceCategory != null "> and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
+ <if test="address != null and address != ''"> and cm_providers.address = #{address}</if>
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_providers.linkMan = #{linkMan}</if>
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_providers.mobile = #{mobile}</if>
|
|
|
+ <if test="status != null "> and cm_providers.status = #{status}</if>
|
|
|
+ <if test="text != null and text != ''"> and cm_providers.text = #{text}</if>
|
|
|
+ <if test="qrCodeImage != null and qrCodeImage != ''"> and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
+ <if test="qualificationImage != null and qualificationImage != ''"> and cm_providers.qualificationImage = #{qualificationImage}</if>
|
|
|
+ <if test="qualificationId != null and qualificationId != ''"> and cm_providers.qualificationId = #{qualificationId}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_providers.id
|
|
|
+ limit 0,1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCmProvidersList" parameterType="CmProviders" resultMap="CmProvidersResult">
|
|
|
+ <include refid="selectCmProvidersVo"/>
|
|
|
+ from cm_providers AS cm_providers
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''"> and cm_providers.id = #{id}</if>
|
|
|
+ <if test="userId != null "> and cm_providers.userId = #{userId}</if>
|
|
|
+ <if test="name != null and name != ''"> and cm_providers.name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="serviceLevel != null "> and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
+ <if test="serviceCategory != null "> and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
+ <if test="address != null and address != ''"> and cm_providers.address = #{address}</if>
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_providers.linkMan = #{linkMan}</if>
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_providers.mobile = #{mobile}</if>
|
|
|
+ <if test="status != null "> and cm_providers.status = #{status}</if>
|
|
|
+ <if test="text != null and text != ''"> and cm_providers.text = #{text}</if>
|
|
|
+ <if test="qrCodeImage != null and qrCodeImage != ''"> and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
+ <if test="qualificationImage != null and qualificationImage != ''"> and cm_providers.qualificationImage = #{qualificationImage}</if>
|
|
|
+ <if test="qualificationId != null and qualificationId != ''"> and cm_providers.qualificationId = #{qualificationId}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_providers.id
|
|
|
+ order by cm_providers.createTime desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCount" parameterType="CmProviders" resultType="int">
|
|
|
+ select count(1)
|
|
|
+ from cm_providers AS cm_providers
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''"> and cm_providers.id = #{id}</if>
|
|
|
+ <if test="userId != null "> and cm_providers.userId = #{userId}</if>
|
|
|
+ <if test="name != null and name != ''"> and cm_providers.name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="serviceLevel != null "> and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
+ <if test="serviceCategory != null "> and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
+ <if test="address != null and address != ''"> and cm_providers.address = #{address}</if>
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_providers.linkMan = #{linkMan}</if>
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_providers.mobile = #{mobile}</if>
|
|
|
+ <if test="status != null "> and cm_providers.status = #{status}</if>
|
|
|
+ <if test="text != null and text != ''"> and cm_providers.text = #{text}</if>
|
|
|
+ <if test="qrCodeImage != null and qrCodeImage != ''"> and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
+ <if test="qualificationImage != null and qualificationImage != ''"> and cm_providers.qualificationImage = #{qualificationImage}</if>
|
|
|
+ <if test="qualificationId != null and qualificationId != ''"> and cm_providers.qualificationId = #{qualificationId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCmProvidersById" parameterType="String" resultMap="CmProvidersResult">
|
|
|
+ <include refid="selectCmProvidersVo"/>
|
|
|
+ from cm_providers AS cm_providers
|
|
|
+ where cm_providers.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getById" parameterType="CmProviders" resultType="String">
|
|
|
+ select id
|
|
|
+ from cm_providers AS cm_providers
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''"> and cm_providers.id = #{id}</if>
|
|
|
+ <if test="userId != null "> and cm_providers.userId = #{userId}</if>
|
|
|
+ <if test="name != null and name != ''"> and cm_providers.name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="serviceLevel != null "> and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
+ <if test="serviceCategory != null "> and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
+ <if test="address != null and address != ''"> and cm_providers.address = #{address}</if>
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_providers.linkMan = #{linkMan}</if>
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_providers.mobile = #{mobile}</if>
|
|
|
+ <if test="status != null "> and cm_providers.status = #{status}</if>
|
|
|
+ <if test="text != null and text != ''"> and cm_providers.text = #{text}</if>
|
|
|
+ <if test="qrCodeImage != null and qrCodeImage != ''"> and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
+ <if test="qualificationImage != null and qualificationImage != ''"> and cm_providers.qualificationImage = #{qualificationImage}</if>
|
|
|
+ <if test="qualificationId != null and qualificationId != ''"> and cm_providers.qualificationId = #{qualificationId}</if>
|
|
|
+ </where>
|
|
|
+ group by cm_providers.id
|
|
|
+ limit 0,1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="addCmProviders" parameterType="CmProviders" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into cm_providers
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null and id != ''">id,</if>
|
|
|
+ <if test="userId != null">userId,</if>
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
+ <if test="serviceLevel != null">serviceLevel,</if>
|
|
|
+ <if test="serviceCategory != null">serviceCategory,</if>
|
|
|
+ <if test="address != null and address != ''">address,</if>
|
|
|
+ <if test="linkMan != null and linkMan != ''">linkMan,</if>
|
|
|
+ <if test="mobile != null and mobile != ''">mobile,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="text != null and text != ''">text,</if>
|
|
|
+ <if test="qrCodeImage != null and qrCodeImage != ''">qrCodeImage,</if>
|
|
|
+ <if test="qualificationImage != null and qualificationImage != ''">qualificationImage,</if>
|
|
|
+ <if test="qualificationId != null and qualificationId != ''">qualificationId,</if>
|
|
|
+ <if test="createBy != null and createBy != ''">createBy,</if>
|
|
|
+ <if test="updateTime != null">updateTime,</if>
|
|
|
+ <if test="createTime != null">createTime,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null and id != ''">#{id},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
+ <if test="serviceLevel != null">#{serviceLevel},</if>
|
|
|
+ <if test="serviceCategory != null">#{serviceCategory},</if>
|
|
|
+ <if test="address != null and address != ''">#{address},</if>
|
|
|
+ <if test="linkMan != null and linkMan != ''">#{linkMan},</if>
|
|
|
+ <if test="mobile != null and mobile != ''">#{mobile},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="text != null and text != ''">#{text},</if>
|
|
|
+ <if test="qrCodeImage != null and qrCodeImage != ''">#{qrCodeImage},</if>
|
|
|
+ <if test="qualificationImage != null and qualificationImage != ''">#{qualificationImage},</if>
|
|
|
+ <if test="qualificationId != null and qualificationId != ''">#{qualificationId},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCmProviders" parameterType="CmProviders">
|
|
|
+ update cm_providers
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">userId = #{userId},</if>
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
+ <if test="serviceLevel != null">serviceLevel = #{serviceLevel},</if>
|
|
|
+ <if test="serviceCategory != null">serviceCategory = #{serviceCategory},</if>
|
|
|
+ <if test="address != null and address != ''">address = #{address},</if>
|
|
|
+ <if test="linkMan != null and linkMan != ''">linkMan = #{linkMan},</if>
|
|
|
+ <if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="text != null and text != ''">text = #{text},</if>
|
|
|
+ <if test="qrCodeImage != null and qrCodeImage != ''">qrCodeImage = #{qrCodeImage},</if>
|
|
|
+ <if test="qualificationImage != null and qualificationImage != ''">qualificationImage = #{qualificationImage},</if>
|
|
|
+ <if test="qualificationId != null and qualificationId != ''">qualificationId = #{qualificationId},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">createBy = #{createBy},</if>
|
|
|
+ <if test="updateTime != null">updateTime = #{updateTime},</if>
|
|
|
+ <if test="createTime != null">createTime = #{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="delCmProvidersById" parameterType="String">
|
|
|
+ delete
|
|
|
+ from cm_providers where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="delCmProviders" parameterType="CmProviders">
|
|
|
+ delete
|
|
|
+ from cm_providers AS cm_providers
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''"> and cm_providers.id = #{id}</if>
|
|
|
+ <if test="userId != null "> and cm_providers.userId = #{userId}</if>
|
|
|
+ <if test="name != null and name != ''"> and cm_providers.name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="serviceLevel != null "> and cm_providers.serviceLevel = #{serviceLevel}</if>
|
|
|
+ <if test="serviceCategory != null "> and cm_providers.serviceCategory = #{serviceCategory}</if>
|
|
|
+ <if test="address != null and address != ''"> and cm_providers.address = #{address}</if>
|
|
|
+ <if test="linkMan != null and linkMan != ''"> and cm_providers.linkMan = #{linkMan}</if>
|
|
|
+ <if test="mobile != null and mobile != ''"> and cm_providers.mobile = #{mobile}</if>
|
|
|
+ <if test="status != null "> and cm_providers.status = #{status}</if>
|
|
|
+ <if test="text != null and text != ''"> and cm_providers.text = #{text}</if>
|
|
|
+ <if test="qrCodeImage != null and qrCodeImage != ''"> and cm_providers.qrCodeImage = #{qrCodeImage}</if>
|
|
|
+ <if test="qualificationImage != null and qualificationImage != ''"> and cm_providers.qualificationImage = #{qualificationImage}</if>
|
|
|
+ <if test="qualificationId != null and qualificationId != ''"> and cm_providers.qualificationId = #{qualificationId}</if>
|
|
|
+ </where>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|