| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <?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>
-
- <insert id="batchInsert" parameterType="com.goafanti.common.model.LegalPersonOwnership">
- insert into legal_person_ownership (id, uid, type, name, org_code, investment, deleted_sign)
- values
- <foreach item="item" index="index" collection="list" separator=",">
- (#{item.id,jdbcType=VARCHAR}, #{item.uid,jdbcType=VARCHAR}, #{item.type,jdbcType=INTEGER},
- #{item.name,jdbcType=VARCHAR}, #{item.orgCode,jdbcType=VARCHAR}, #{item.investment,jdbcType=DECIMAL},
- #{item.deletedSign,jdbcType=INTEGER})
- </foreach>
- ON DUPLICATE KEY UPDATE
- type = values(type),
- name = values(name),
- org_code = values(org_code),
- investment = values(investment),
- deleted_sign = values(deleted_sign)
- </insert>
- </mapper>
|