|
|
|
@@ -1,80 +1,70 @@ |
|
|
|
<?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.iformall.mapper.WxTagsMapper"> |
|
|
|
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxTags"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id" /> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> |
|
|
|
<result column="name" jdbcType="VARCHAR" property="name" /> |
|
|
|
<result column="type1" jdbcType="VARCHAR" property="type1" /> |
|
|
|
<result column="type2" jdbcType="VARCHAR" property="type2" /> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> |
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
|
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxTags"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
<result column="name" jdbcType="VARCHAR" property="name"/> |
|
|
|
<result column="type1" jdbcType="VARCHAR" property="type1"/> |
|
|
|
<result column="type2" jdbcType="VARCHAR" property="type2"/> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> |
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
|
`id`,`tenant_id`,`name`,`type1`,`type2`,`create_date`,`update_date` |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
|
where 1 = 1 |
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
and `id` = #{id} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId "> |
|
|
|
and `tenant_id` like concat('%', #{tenantId},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != name "> |
|
|
|
and `name` like concat('%', #{name},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != type1 "> |
|
|
|
and `type1` like concat('%', #{type1},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != type2 "> |
|
|
|
and `type2` like concat('%', #{type2},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != createDate "> |
|
|
|
and `create_date` = #{createDate} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != updateDate "> |
|
|
|
and `update_date` = #{updateDate} |
|
|
|
|
|
|
|
</if> |
|
|
|
<if test=" null != ids "> |
|
|
|
and id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test=" null != sortColumns"> order by ${sortColumns} </if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findList" parameterType="com.iformall.domain.po.WxTags" resultMap="BaseResultMap"> |
|
|
|
select <include refid="allColumns" /> from wx_tags |
|
|
|
<include refid="dynamicWhereConditions" /> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findType1Value" resultMap="BaseResultMap"> |
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
|
where 1 = 1 |
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
and `id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != name "> |
|
|
|
and `name` like concat('%', #{name},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != type1 "> |
|
|
|
and `type1` like concat('%', #{type1},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != type2 "> |
|
|
|
and `type2` like concat('%', #{type2},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != createDate "> |
|
|
|
and `create_date` = #{createDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != updateDate "> |
|
|
|
and `update_date` = #{updateDate} |
|
|
|
</if> |
|
|
|
<if test=" null != ids "> |
|
|
|
and id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findList" parameterType="com.iformall.domain.po.WxTags" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_tags |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findType1Value" resultMap="BaseResultMap"> |
|
|
|
select DISTINCT type1 from wx_tags |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findType2Value" parameterType="String" resultMap="BaseResultMap"> |
|
|
|
select DISTINCT type2 from wx_tags where 1=1 |
|
|
|
<if test="_parameter!= null and _parameter!= ''"> |
|
|
|
and type1=#{type1} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="findType2Value" parameterType="String" resultMap="BaseResultMap"> |
|
|
|
select DISTINCT type2 from wx_tags where 1=1 |
|
|
|
<if test="_parameter!= null and _parameter!= ''"> |
|
|
|
and type1=#{type1} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |