|
@@ -4,223 +4,102 @@
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.caimei365.user.mapper.CmProvidersMapper">
|
|
<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 id="getByCmProviders" parameterType="com.caimei365.user.model.po.ServiceProviderModel" resultType="com.caimei365.user.model.po.ServiceProviderModel">
|
|
select
|
|
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
|
|
|
|
|
|
+ serviceProviderId,
|
|
|
|
+ name,
|
|
|
|
+ serviceLevel,
|
|
|
|
+ serviceCategory,
|
|
|
|
+ status,
|
|
|
|
+ userId,
|
|
|
|
+ address,
|
|
|
|
+ linkMan,
|
|
|
|
+ contractMobile as mobile,
|
|
|
|
+ text,
|
|
|
|
+ brandName,
|
|
|
|
+ qrCodeImage,
|
|
|
|
+ qualificationImage,
|
|
|
|
+ qualificationId,
|
|
|
|
+ createBy,
|
|
|
|
+ addTime,
|
|
|
|
+ splitCode
|
|
|
|
+ from serviceprovider
|
|
<where>
|
|
<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>
|
|
|
|
|
|
+ <if test="serviceProviderId != null and serviceProviderId != ''">
|
|
|
|
+ and serviceProviderId = #{serviceProviderId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="serviceLevel != null ">and serviceLevel = #{serviceLevel}</if>
|
|
|
|
+ <if test="serviceCategory != null ">and cserviceCategory = #{serviceCategory}</if>
|
|
|
|
+ <if test="status != null ">and status = #{status}</if>
|
|
|
|
+ <if test="userId != null ">and userId = #{userId}</if>
|
|
|
|
+ <if test="address != null and address != ''">and address = #{address}</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''">andlinkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''">and contractMobile = #{mobile}</if>
|
|
</where>
|
|
</where>
|
|
- group by cm_providers.id
|
|
|
|
|
|
+ group by serviceProviderId
|
|
|
|
+ order by addTime desc
|
|
limit 0,1
|
|
limit 0,1
|
|
</select>
|
|
</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
|
|
|
|
|
|
+ <select id="getCmProvidersList" parameterType="com.caimei365.user.model.po.ServiceProviderModel" resultType="com.caimei365.user.model.po.ServiceProviderModel">
|
|
|
|
+ select
|
|
|
|
+ serviceProviderId,
|
|
|
|
+ name,
|
|
|
|
+ serviceLevel,
|
|
|
|
+ serviceCategory,
|
|
|
|
+ status,
|
|
|
|
+ userId,
|
|
|
|
+ address,
|
|
|
|
+ linkMan,
|
|
|
|
+ contractMobile as mobile,
|
|
|
|
+ text,
|
|
|
|
+ brandName,
|
|
|
|
+ qrCodeImage,
|
|
|
|
+ qualificationImage,
|
|
|
|
+ qualificationId,
|
|
|
|
+ createBy,
|
|
|
|
+ addTime,
|
|
|
|
+ splitCode
|
|
|
|
+ from serviceprovider
|
|
<where>
|
|
<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>
|
|
|
|
|
|
+ <if test="serviceProviderId != null and serviceProviderId != ''">
|
|
|
|
+ and serviceProviderId = #{serviceProviderId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="serviceLevel != null ">and serviceLevel = #{serviceLevel}</if>
|
|
|
|
+ <if test="serviceCategory != null ">and cserviceCategory = #{serviceCategory}</if>
|
|
|
|
+ <if test="status != null ">and status = #{status}</if>
|
|
|
|
+ <if test="userId != null ">and userId = #{userId}</if>
|
|
|
|
+ <if test="address != null and address != ''">and address = #{address}</if>
|
|
|
|
+ <if test="linkMan != null and linkMan != ''">andlinkMan = #{linkMan}</if>
|
|
|
|
+ <if test="mobile != null and mobile != ''">and contractMobile = #{mobile}</if>
|
|
</where>
|
|
</where>
|
|
|
|
+ group by serviceProviderId
|
|
|
|
+ order by addTime desc
|
|
</select>
|
|
</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 id="getCmProvidersById" parameterType="String" resultType="com.caimei365.user.model.po.ServiceProviderModel">
|
|
|
|
+ select
|
|
|
|
+ serviceProviderId,
|
|
|
|
+ name,
|
|
|
|
+ serviceLevel,
|
|
|
|
+ serviceCategory,
|
|
|
|
+ status,
|
|
|
|
+ userId,
|
|
|
|
+ address,
|
|
|
|
+ linkMan,
|
|
|
|
+ contractMobile as mobile,
|
|
|
|
+ text,
|
|
|
|
+ brandName,
|
|
|
|
+ qrCodeImage,
|
|
|
|
+ qualificationImage,
|
|
|
|
+ qualificationId,
|
|
|
|
+ createBy,
|
|
|
|
+ addTime,
|
|
|
|
+ splitCode
|
|
|
|
+ from serviceprovider
|
|
|
|
+ where serviceProviderId = #{id}
|
|
</select>
|
|
</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>
|
|
</mapper>
|