|
@@ -0,0 +1,155 @@
|
|
|
+<?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.hcloud.microserver.bank.dao.CustomerCompanyTypeMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.hcloud.microserver.facade.carbon.entity.CustomerCompanyType">
|
|
|
+ <id column="guid" jdbcType="CHAR" property="guid" />
|
|
|
+ <result column="parent_id" jdbcType="CHAR" property="parentId" />
|
|
|
+ <result column="type_name" jdbcType="VARCHAR" property="typeName" />
|
|
|
+ <result column="type_val" jdbcType="VARCHAR" property="typeVal" />
|
|
|
+ <result column="state" jdbcType="INTEGER" property="state" />
|
|
|
+ <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
|
|
|
+ <result column="methodology" jdbcType="VARCHAR" property="methodology" />
|
|
|
+ <result column="type_desc" jdbcType="VARCHAR" property="typeDesc" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ guid, parent_id, type_name, type_val, state, modified_time, methodology, type_desc
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from t_customer_company_type
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
+ delete from t_customer_company_type
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.hcloud.microserver.facade.carbon.entity.CustomerCompanyType">
|
|
|
+ insert into t_customer_company_type (guid, parent_id, type_name,
|
|
|
+ type_val, state, modified_time,
|
|
|
+ methodology, type_desc)
|
|
|
+ values (#{guid,jdbcType=CHAR}, #{parentId,jdbcType=CHAR}, #{typeName,jdbcType=VARCHAR},
|
|
|
+ #{typeVal,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP},
|
|
|
+ #{methodology,jdbcType=VARCHAR}, #{typeDesc,jdbcType=VARCHAR})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.hcloud.microserver.facade.carbon.entity.CustomerCompanyType">
|
|
|
+ insert into t_customer_company_type
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="guid != null">
|
|
|
+ guid,
|
|
|
+ </if>
|
|
|
+ <if test="parentId != null">
|
|
|
+ parent_id,
|
|
|
+ </if>
|
|
|
+ <if test="typeName != null">
|
|
|
+ type_name,
|
|
|
+ </if>
|
|
|
+ <if test="typeVal != null">
|
|
|
+ type_val,
|
|
|
+ </if>
|
|
|
+ <if test="state != null">
|
|
|
+ state,
|
|
|
+ </if>
|
|
|
+ <if test="modifiedTime != null">
|
|
|
+ modified_time,
|
|
|
+ </if>
|
|
|
+ <if test="methodology != null">
|
|
|
+ methodology,
|
|
|
+ </if>
|
|
|
+ <if test="typeDesc != null">
|
|
|
+ type_desc,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="guid != null">
|
|
|
+ #{guid,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="parentId != null">
|
|
|
+ #{parentId,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="typeName != null">
|
|
|
+ #{typeName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="typeVal != null">
|
|
|
+ #{typeVal,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="state != null">
|
|
|
+ #{state,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="modifiedTime != null">
|
|
|
+ #{modifiedTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="methodology != null">
|
|
|
+ #{methodology,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="typeDesc != null">
|
|
|
+ #{typeDesc,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microserver.facade.carbon.entity.CustomerCompanyType">
|
|
|
+ update t_customer_company_type
|
|
|
+ <set>
|
|
|
+ <if test="parentId != null">
|
|
|
+ parent_id = #{parentId,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="typeName != null">
|
|
|
+ type_name = #{typeName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="typeVal != null">
|
|
|
+ type_val = #{typeVal,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="state != null">
|
|
|
+ state = #{state,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="modifiedTime != null">
|
|
|
+ modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="methodology != null">
|
|
|
+ methodology = #{methodology,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="typeDesc != null">
|
|
|
+ type_desc = #{typeDesc,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.hcloud.microserver.facade.carbon.entity.CustomerCompanyType">
|
|
|
+ update t_customer_company_type
|
|
|
+ set parent_id = #{parentId,jdbcType=CHAR},
|
|
|
+ type_name = #{typeName,jdbcType=VARCHAR},
|
|
|
+ type_val = #{typeVal,jdbcType=VARCHAR},
|
|
|
+ state = #{state,jdbcType=INTEGER},
|
|
|
+ modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
|
|
|
+ methodology = #{methodology,jdbcType=VARCHAR},
|
|
|
+ type_desc = #{typeDesc,jdbcType=VARCHAR}
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 查询企业类型是否存在 lym -->
|
|
|
+ <select id="isExist" parameterType="com.hcloud.microserver.facade.carbon.entity.CustomerCompanyType" resultType="int">
|
|
|
+ SELECT IFNULL(COUNT(*),0) FROM t_customer_company_type
|
|
|
+ where state = 1
|
|
|
+ <if test="parentId != null and parentId != ''">
|
|
|
+ AND parent_id = #{parentId}
|
|
|
+ </if>
|
|
|
+ <if test="typeName != null and typeName != ''">
|
|
|
+ AND type_name = #{typeName}
|
|
|
+ </if>
|
|
|
+ <if test="guid != null and guid != ''">
|
|
|
+ AND guid != #{guid}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询列表 lym -->
|
|
|
+ <select id="selectList" resultType="com.hcloud.microserver.facade.carbon.forms.CustomerCompanyTypeForm" resultMap="BaseResultMap">
|
|
|
+ SELECT <include refid="Base_Column_List"/> FROM t_customer_company_type
|
|
|
+ where state = 1
|
|
|
+ <if test="parentId != null and parentId != ''">
|
|
|
+ AND parent_id = #{parentId}
|
|
|
+ </if>
|
|
|
+ <if test="typeName != null and typeName != ''">
|
|
|
+ AND type_name LIKE CONCAT("%",#{typeName},"%")
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+</mapper>
|