|
|
@@ -0,0 +1,132 @@
|
|
|
+<?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.goafanti.common.dao.LegalPersonOwnershipMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.LegalPersonOwnership" >
|
|
|
+ <id column="id" property="id" jdbcType="VARCHAR" />
|
|
|
+ <result column="uid" property="uid" jdbcType="VARCHAR" />
|
|
|
+ <result column="type" property="type" jdbcType="INTEGER" />
|
|
|
+ <result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
+ <result column="org_code" property="orgCode" jdbcType="VARCHAR" />
|
|
|
+ <result column="investment" property="investment" jdbcType="DECIMAL" />
|
|
|
+ <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ id, uid, type, name, org_code, investment, deleted_sign
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from legal_person_ownership
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
|
+ delete from legal_person_ownership
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.LegalPersonOwnership" >
|
|
|
+ insert into legal_person_ownership (id, uid, type,
|
|
|
+ name, org_code, investment,
|
|
|
+ deleted_sign)
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
|
|
|
+ #{name,jdbcType=VARCHAR}, #{orgCode,jdbcType=VARCHAR}, #{investment,jdbcType=DECIMAL},
|
|
|
+ #{deletedSign,jdbcType=INTEGER})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.LegalPersonOwnership" >
|
|
|
+ insert into legal_person_ownership
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id != null" >
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="uid != null" >
|
|
|
+ uid,
|
|
|
+ </if>
|
|
|
+ <if test="type != null" >
|
|
|
+ type,
|
|
|
+ </if>
|
|
|
+ <if test="name != null" >
|
|
|
+ name,
|
|
|
+ </if>
|
|
|
+ <if test="orgCode != null" >
|
|
|
+ org_code,
|
|
|
+ </if>
|
|
|
+ <if test="investment != null" >
|
|
|
+ investment,
|
|
|
+ </if>
|
|
|
+ <if test="deletedSign != null" >
|
|
|
+ deleted_sign,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id != null" >
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="uid != null" >
|
|
|
+ #{uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null" >
|
|
|
+ #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="name != null" >
|
|
|
+ #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="orgCode != null" >
|
|
|
+ #{orgCode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="investment != null" >
|
|
|
+ #{investment,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="deletedSign != null" >
|
|
|
+ #{deletedSign,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.LegalPersonOwnership" >
|
|
|
+ update legal_person_ownership
|
|
|
+ <set >
|
|
|
+ <if test="uid != null" >
|
|
|
+ uid = #{uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null" >
|
|
|
+ type = #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="name != null" >
|
|
|
+ name = #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="orgCode != null" >
|
|
|
+ org_code = #{orgCode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="investment != null" >
|
|
|
+ investment = #{investment,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="deletedSign != null" >
|
|
|
+ deleted_sign = #{deletedSign,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.LegalPersonOwnership" >
|
|
|
+ update legal_person_ownership
|
|
|
+ set uid = #{uid,jdbcType=VARCHAR},
|
|
|
+ type = #{type,jdbcType=INTEGER},
|
|
|
+ name = #{name,jdbcType=VARCHAR},
|
|
|
+ org_code = #{orgCode,jdbcType=VARCHAR},
|
|
|
+ investment = #{investment,jdbcType=DECIMAL},
|
|
|
+ deleted_sign = #{deletedSign,jdbcType=INTEGER}
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectByUid" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from legal_person_ownership
|
|
|
+ where uid = #{uid,jdbcType=VARCHAR} and deleted_sign = 0 order by investment desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
|
|
|
+ update legal_person_ownership set deleted_sign = 1
|
|
|
+ where id in
|
|
|
+ <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+</mapper>
|