Просмотр исходного кода

[tags去除tenantId][重整]

release_toaliyun_real
Stormeye.Wu 7 лет назад
Родитель
Сommit
e2a648dc67
2 измененных файлов: 66 добавлений и 86 удалений
  1. +5
    -15
      mallinkService/src/main/java/com/iformall/domain/po/WxTags.java
  2. +61
    -71
      mallinkService/src/main/resources/mapper/WxTagsMapper.xml

+ 5
- 15
mallinkService/src/main/java/com/iformall/domain/po/WxTags.java Просмотреть файл

@@ -40,30 +40,21 @@ public class WxTags implements Serializable {
/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
/*名称**/
/**名称**/
@io.swagger.annotations.ApiModelProperty(value="名称",name="name")
private String name;
/*1基础2生活属性3消费偏好4行为偏好**/
/**1基础2生活属性3消费偏好4行为偏好**/
@io.swagger.annotations.ApiModelProperty(value="1基础2生活属性3消费偏好4行为偏好",name="type1")
private String type1;
/*二级属性 性别等**/
/**二级属性 性别等**/
@io.swagger.annotations.ApiModelProperty(value="二级属性 性别等",name="type2")
private String type2;
/*创建时间**/
/**创建时间**/
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
private Date createDate;
/*更新时间**/
/**更新时间**/
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
private Date updateDate;
public String getTenantId() {
return tenantId;
}
public void setTenantId(String _tenantId) {
tenantId = _tenantId;
}
public String getName() {
return name;
}
@@ -100,7 +91,6 @@ public class WxTags implements Serializable {
public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
,Name_ASC("`name` ASC"),Name_DESC("`name` DESC")
,Type1_ASC("`type1` ASC"),Type1_DESC("`type1` DESC")
,Type2_ASC("`type2` ASC"),Type2_DESC("`type2` DESC")


+ 61
- 71
mallinkService/src/main/resources/mapper/WxTagsMapper.xml Просмотреть файл

@@ -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>

Загрузка…
Отмена
Сохранить