Files
zxjp-web/coolstore-partner-dao/src/main/resources/mapper/BigRegionMapper.xml
2025-05-15 15:31:23 +08:00

59 lines
2.2 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.cool.store.mapper.BigRegionMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.BigRegionDO">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="region_id" jdbcType="BIGINT" property="regionId" />
<result column="region_name" jdbcType="VARCHAR" property="regionName" />
<result column="org_code" jdbcType="VARCHAR" property="orgCode" />
<result column="org_id" jdbcType="VARCHAR" property="orgId" />
<result column="org_name" jdbcType="VARCHAR" property="orgName" />
<result column="join_mode" jdbcType="TINYINT" property="joinMode" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
</resultMap>
<select id="queryAllBigRegion" resultType="com.cool.store.dto.region.BigRegionDTO">
select DISTINCT
region_id as regionId,
region_name as regionName
FROM `xfsg_big_region`
<where>
<if test="keyword!=null and keyword !=''">
and region_name like CONCAT('%',#{keyword},'%')
</if>
</where>
</select>
<select id="queryOrgInfoByBigRegionAndJoinMode" resultMap="BaseResultMap">
select *
FROM `xfsg_big_region`
<where>
<if test="regionId !=null ">
and region_id = #{regionId}
</if>
<if test="joinMode !=null ">
and join_mode = #{joinMode}
</if>
</where>
</select>
<select id="queryBigRegion" resultType="com.cool.store.dto.region.BigRegionDTO">
select *
from `xfsg_big_region`
where join_mode = 0
<if test="request.keyword!=null and request.keyword !=''">
and region_name like CONCAT('%',#{request.keyword},'%')
</if>
<if test="request.groupNameList!=null and request.groupNameList.size()>0">
and group_name in
<foreach item="item" collection="request.groupNameList" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
</mapper>