<?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.panzhihua.service_jinhui_community.dao.JinhuiConvenientMerchantDao">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.panzhihua.service_jinhui_community.entity.JinhuiConvenientMerchant">
|
<id column="id" property="id" />
|
<id column="name" property="name" />
|
<id column="logo" property="logo" />
|
<id column="contacts" property="contacts" />
|
<id column="phone" property="phone" />
|
<id column="address" property="address" />
|
<id column="detailed_address" property="detailedAddress" />
|
<id column="lat" property="lat" />
|
<id column="lon" property="lon" />
|
<id column="introduction" property="introduction" />
|
<id column="is_del" property="isDel" />
|
<id column="created_at" property="createdAt" />
|
<id column="created_by" property="createdBy" />
|
<id column="updated_at" property="updatedAt" />
|
<id column="convenient_type" property="convenientType" />
|
<id column="audit_type" property="auditType" />
|
<id column="audit_opinion" property="auditOpinion" />
|
<id column="img_url" property="imgUrl" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id,
|
name,
|
logo,
|
contacts,
|
phone,
|
address,
|
detailed_address,
|
lat,
|
lon,
|
introduction,
|
is_del,
|
created_at,
|
created_by,
|
updated_at,
|
convenient_type,
|
audit_type,
|
audit_opinion,
|
img_url
|
</sql>
|
<select id="pageMerchant" resultType="com.panzhihua.common.model.vos.community.convenient.JinhuiConvenientMerchantVO">
|
SELECT
|
id,
|
name,
|
logo,
|
contacts,
|
phone,
|
address,
|
detailed_address,
|
lat,
|
lon,
|
introduction,
|
is_del,
|
created_at,
|
created_by,
|
updated_at,
|
convenient_type,
|
(select jccsc.name from jinhui_com_convenient_service_categories as jccsc where jccsc.id=ccm.convenient_type) as convenientName,
|
audit_type,
|
audit_opinion,
|
img_url
|
FROM jinhui_com_convenient_merchants ccm
|
WHERE ccm.is_del = 0
|
<if test="item.auditType != null and item.auditType != ''">
|
AND ccm.audit_type = #{item.auditType}
|
</if>
|
<if test="item.convenientType != null and item.convenientType != ''">
|
AND ccm.convenient_type = #{item.convenientType}
|
</if>
|
<if test="item.keyword != null and item.keyword != """>
|
AND (
|
ccm.name LIKE CONCAT('%', #{item.keyword}, '%')
|
OR ccm.address LIKE CONCAT('%', #{item.keyword}, '%')
|
OR ccm.phone LIKE CONCAT('%', #{item.keyword}, '%')
|
)
|
</if>
|
GROUP BY created_at DESC
|
</select>
|
<select id="selectMerchantById" resultType="com.panzhihua.common.model.vos.community.convenient.JinhuiConvenientMerchantVO">
|
SELECT
|
id,
|
name,
|
logo,
|
contacts,
|
phone,
|
address,
|
detailed_address,
|
lat,
|
lon,
|
introduction,
|
is_del,
|
created_at,
|
created_by,
|
updated_at,
|
convenient_type,
|
(select jccsc.name from jinhui_com_convenient_service_categories as jccsc where jccsc.id=ccm.convenient_type) as convenientName,
|
audit_type,
|
audit_opinion,
|
img_url
|
FROM jinhui_com_convenient_merchants ccm
|
WHERE ccm.id = #{merchantId}
|
</select>
|
|
<update id="deleteMerchantById">
|
UPDATE jinhui_com_convenient_merchants
|
SET is_del = 1
|
WHERE id = #{merchantId}
|
</update>
|
|
|
|
<insert id="addData">
|
insert into jinhui_com_convenient_merchants
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
id,
|
</if>
|
<if test="item.name != null and item.name != '' ">
|
`name`,
|
</if>
|
<if test="item.logo != null and item.logo != '' ">
|
logo,
|
</if>
|
<if test="item.contacts != null and item.contacts != '' ">
|
contacts,
|
</if>
|
<if test="item.phone != null and item.phone != '' ">
|
phone,
|
</if>
|
<if test="item.address != null and item.address != '' ">
|
address,
|
</if>
|
<if test="item.detailedAddress != null and item.detailedAddress != '' ">
|
detailed_address,
|
</if>
|
<if test="item.lat != null and item.lat != '' ">
|
lat,
|
</if>
|
<if test="item.lon != null and item.lon != '' ">
|
lon,
|
</if>
|
<if test="item.introduction != null and item.introduction != '' ">
|
introduction,
|
</if>
|
<if test="item.isDel != null and item.isDel != '' ">
|
is_del,
|
</if>
|
<if test="item.createdBy != null and item.createdBy != '' ">
|
created_by,
|
</if>
|
<if test="item.convenientType != null and item.convenientType != '' ">
|
convenient_type,
|
</if>
|
<if test="item.auditType != null and item.auditType != '' ">
|
audit_type,
|
</if>
|
<if test="item.auditOpinion != null and item.auditOpinion != '' ">
|
audit_opinion,
|
</if>
|
<if test="item.imgUrl != null and item.imgUrl != '' ">
|
img_url,
|
</if>
|
created_at
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
#{item.id},
|
</if>
|
<if test="item.name != null and item.name != '' ">
|
#{item.name},
|
</if>
|
<if test="item.logo != null and item.logo != '' ">
|
#{item.logo},
|
</if>
|
<if test="item.contacts != null and item.contacts != '' ">
|
#{item.contacts},
|
</if>
|
<if test="item.phone != null and item.phone != '' ">
|
#{item.phone},
|
</if>
|
<if test="item.address != null and item.address != '' ">
|
#{item.address},
|
</if>
|
<if test="item.detailedAddress != null and item.detailedAddress != '' ">
|
#{item.detailedAddress},
|
</if>
|
<if test="item.lat != null and item.lat != '' ">
|
#{item.lat},
|
</if>
|
<if test="item.lon != null and item.lon != '' ">
|
#{item.lon},
|
</if>
|
<if test="item.introduction != null and item.introduction != '' ">
|
#{item.introduction},
|
</if>
|
<if test="item.isDel != null and item.isDel != '' ">
|
#{item.isDel},
|
</if>
|
<if test="item.createdBy != null and item.createdBy != '' ">
|
#{item.createdBy},
|
</if>
|
<if test="item.convenientType != null and item.convenientType != '' ">
|
#{item.convenientType},
|
</if>
|
<if test="item.auditType != null and item.auditType != '' ">
|
#{item.auditType},
|
</if>
|
<if test="item.auditOpinion != null and item.auditOpinion != '' ">
|
#{item.auditOpinion},
|
</if>
|
<if test="item.imgUrl != null and item.imgUrl != '' ">
|
#{item.imgUrl},
|
</if>
|
sysdate()
|
</trim>
|
</insert>
|
|
<update id="editData">
|
update jinhui_com_convenient_merchants
|
<set>
|
<if test="item.id != null and item.id != '' ">
|
id=#{item.id},
|
</if>
|
<if test="item.name != null and item.name != '' ">
|
`name`=#{item.name},
|
</if>
|
<if test="item.logo != null and item.logo != '' ">
|
logo=#{item.logo},
|
</if>
|
<if test="item.contacts != null and item.contacts != '' ">
|
contacts=#{item.contacts},
|
</if>
|
<if test="item.phone != null and item.phone != '' ">
|
phone=#{item.phone},
|
</if>
|
<if test="item.address != null and item.address != '' ">
|
address=#{item.address},
|
</if>
|
<if test="item.detailedAddress != null and item.detailedAddress != '' ">
|
detailed_address=#{item.detailedAddress},
|
</if>
|
<if test="item.lat != null and item.lat != '' ">
|
lat=#{item.lat},
|
</if>
|
<if test="item.lon != null and item.lon != '' ">
|
lon=#{item.lon},
|
</if>
|
<if test="item.introduction != null and item.introduction != '' ">
|
introduction=#{item.introduction},
|
</if>
|
<if test="item.isDel != null and item.isDel != '' ">
|
is_del=#{item.isDel},
|
</if>
|
<if test="item.createdBy != null and item.createdBy != '' ">
|
created_by=#{item.createdBy},
|
</if>
|
<if test="item.convenientType != null and item.convenientType != '' ">
|
convenient_type=#{item.convenientType},
|
</if>
|
<if test="item.auditType != null and item.auditType != '' ">
|
audit_type=#{item.auditType},
|
</if>
|
<if test="item.auditOpinion != null and item.auditOpinion != '' ">
|
audit_opinion=#{item.auditOpinion},
|
</if>
|
<if test="item.imgUrl != null and item.imgUrl != '' ">
|
img_url=#{item.imgUrl},
|
</if>
|
updated_at=sysdate()
|
</set>
|
where id = #{item.id}
|
</update>
|
|
</mapper>
|