<?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_community.dao.ComFmsTeamDAO">
|
|
<resultMap type="com.panzhihua.service_community.entity.ComFmsTeam" id="ComFmsTeamMap">
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
<result property="teamType" column="team_type" jdbcType="INTEGER"/>
|
<result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
|
<result property="createdBy" column="created_by" jdbcType="INTEGER"/>
|
<result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
|
<result property="updatedBy" column="updated_by" jdbcType="INTEGER"/>
|
<result property="communityId" column="community_id" jdbcType="INTEGER"/>
|
<result property="image" column="image" jdbcType="VARCHAR"/>
|
</resultMap>
|
|
<!-- 批量插入 -->
|
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
insert into smart_life.com_fms_team(name, phone, team_type, created_at, created_by, updated_at, updated_by, community_id)
|
values
|
<foreach collection="entities" item="entity" separator=",">
|
(#{entity.name}, #{entity.phone}, #{entity.teamType}, #{entity.createdAt}, #{entity.createdBy}, #{entity.updatedAt}, #{entity.updatedBy}, #{entity.communityId})
|
</foreach>
|
</insert>
|
<!-- 批量插入或按主键更新 -->
|
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
insert into smart_life.com_fms_team(name, phone, team_type, created_at, created_by, updated_at, updated_by, community_id)
|
values
|
<foreach collection="entities" item="entity" separator=",">
|
(#{entity.name}, #{entity.phone}, #{entity.teamType}, #{entity.createdAt}, #{entity.createdBy}, #{entity.updatedAt}, #{entity.updatedBy}, #{entity.communityId})
|
</foreach>
|
on duplicate key update
|
name = values(name) , phone = values(phone) , team_type = values(team_type) , created_at = values(created_at) , created_by = values(created_by) , updated_at = values(updated_at) , updated_by = values(updated_by) , community_id = values(community_id) </insert>
|
<select id="pageFmsTeamApplets" resultType="com.panzhihua.common.model.vos.community.fms.ComFmsTeamVO">
|
SELECT id, `name`, phone, team_type, image
|
FROM com_fms_team
|
WHERE community_id = #{pageFmsTeamDTO.communityId}
|
<if test="pageFmsTeamDTO.teamType != null">
|
AND team_type = #{pageFmsTeamDTO.teamType}
|
</if>
|
<if test="pageFmsTeamDTO.keyword != null and pageFmsTeamDTO.keyword != """>
|
AND `name` LIKE CONCAT('%',#{pageFmsTeamDTO.keyword},'%')
|
</if>
|
ORDER BY created_at DESC
|
</select>
|
<select id="listFmsTeamApplets" resultType="com.panzhihua.common.model.vos.community.fms.ComFmsTeamVO">
|
SELECT id, `name`, phone, team_type, image
|
FROM com_fms_team
|
WHERE community_id = #{pageFmsTeamDTO.communityId}
|
<if test="pageFmsTeamDTO.teamType != null">
|
AND team_type = #{pageFmsTeamDTO.teamType}
|
</if>
|
<if test="pageFmsTeamDTO.keyword != null and pageFmsTeamDTO.keyword != """>
|
AND `name` LIKE CONCAT('%',#{pageFmsTeamDTO.keyword},'%')
|
</if>
|
ORDER BY created_at DESC
|
</select>
|
|
</mapper>
|