Commit 00fb5730 by tyfanchz

对接嘀加商城接口

1 parent 559f325b
......@@ -4,7 +4,9 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;
import com.glsx.smart.pojo.BaseDTO;
import lombok.Data;
......@@ -24,6 +26,13 @@ import lombok.Data;
@Table(name = "smart_sys_code")
public class SmartSysCode extends BaseDTO {
/**
*
*/
@Transient
private List<SmartSysCode> subCodeList;
/**
* 标识ID
*/
@Id
......
package com.glsx.smart.dao.mapper;
import java.util.List;
import com.glsx.smart.dao.entity.SmartSysCode;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>Description:
* <p>Project: chejia-smart
......@@ -17,7 +16,9 @@ import java.util.List;
@Mapper
public interface SmartSysCodeMapper extends tk.mybatis.mapper.common.Mapper<SmartSysCode> {
List<SmartSysCode> getList(SmartSysCode req);
List<SmartSysCode> getList(SmartSysCode code);
List<SmartSysCode> getTree(SmartSysCode code);
int insertOrUpdate(SmartSysCode record);
......
......@@ -19,6 +19,26 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="update_by" jdbcType="BIGINT" property="updateBy"/>
</resultMap>
<resultMap id="TreeResultMap" type="com.glsx.smart.dao.entity.SmartSysCode">
<!--@mbg.generated-->
<!--@Table smart_sys_code-->
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="dict_type" jdbcType="VARCHAR" property="dictType"/>
<result column="dict_key" jdbcType="VARCHAR" property="dictKey"/>
<result column="dict_value" jdbcType="VARCHAR" property="dictValue"/>
<result column="parent_key" jdbcType="VARCHAR" property="parentKey"/>
<result column="sort" jdbcType="TINYINT" property="sort"/>
<result column="status" jdbcType="TINYINT" property="status"/>
<result column="level" jdbcType="TINYINT" property="level"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="create_by" jdbcType="BIGINT" property="createBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="update_by" jdbcType="BIGINT" property="updateBy"/>
<collection property="subCodeList" select="getTree" column="{parentKey=dict_key}"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, dict_type, dict_key, dict_value, parent_key, sort, `status`, `level`, remark,
......@@ -43,6 +63,24 @@
order by ssc.sort asc, ssc.create_time desc
</select>
<select id="getTree" resultMap="TreeResultMap">
select *
from smart_sys_code ssc
<where>
<if test="dictType != null and dictType != ''">
and ssc.dict_type = #{dictType,jdbcType=VARCHAR}
</if>
<if test="parentKey != null and parentKey != ''">
and ssc.parent_key = #{parentKey,jdbcType=VARCHAR}
</if>
<if test="level != null">
and ssc.level = #{level,jdbcType=TINYINT}
</if>
and ssc.status = 1
</where>
order by ssc.sort asc, ssc.create_time desc
</select>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!