123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <?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">
- <!-- namespace必须指向DAO接口 -->
- <mapper namespace="com.jpsoft.picc.modules.base.dao.CompanyDAO">
- <resultMap id="CompanyMap" type="com.jpsoft.picc.modules.base.entity.Company">
- <id property="id" column="id_" />
- <result property="name" column="name_" />
- <result property="legalName" column="legal_name" />
- <result property="legalCard" column="legal_card" />
- <result property="legalCardFile" column="legal_card_file" />
- <result property="usccCode" column="uscc_code" />
- <result property="usccFiles" column="uscc_files" />
- <result property="type" column="type_" />
- <result property="businessNature" column="business_nature" />
- <result property="businessScope" column="business_scope" />
- <result property="industryType" column="industry_type" />
- <result property="employeesNumber" column="employees_number" />
- <result property="insuredNumber" column="insured_number" />
- <result property="person" column="person_" />
- <result property="tel" column="tel_" />
- <result property="mail" column="mail_" />
- <result property="postal" column="postal_" />
- <result property="address" column="address_" />
- <result property="companyStampFile" column="company_stamp_file" />
- <result property="promoter" column="promoter_" />
- <result property="remark" column="remark_" />
- <result property="buyId" column="buy_id" />
- <result property="status" column="status_" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="delFlag" column="del_flag" />
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.Company">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into base_company
- (id_,name_,legal_name,legal_card,legal_card_file,uscc_code,uscc_files,type_,business_nature,business_scope,industry_type,employees_number,insured_number,person_,tel_,mail_,postal_,address_,company_stamp_file,promoter_,remark_,buy_id,status_,create_by,create_time,update_by,update_time,del_flag)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{name,jdbcType=VARCHAR}
- ,#{legalName,jdbcType=VARCHAR}
- ,#{legalCard,jdbcType=VARCHAR}
- ,#{legalCardFile,jdbcType=VARCHAR}
- ,#{usccCode,jdbcType=VARCHAR}
- ,#{usccFiles,jdbcType=VARCHAR}
- ,#{type,jdbcType=VARCHAR}
- ,#{businessNature,jdbcType=VARCHAR}
- ,#{businessScope,jdbcType=VARCHAR}
- ,#{industryType,jdbcType=VARCHAR}
- ,#{employeesNumber,jdbcType= NUMERIC }
- ,#{insuredNumber,jdbcType= NUMERIC }
- ,#{person,jdbcType=VARCHAR}
- ,#{tel,jdbcType=VARCHAR}
- ,#{mail,jdbcType=VARCHAR}
- ,#{postal,jdbcType=VARCHAR}
- ,#{address,jdbcType=VARCHAR}
- ,#{companyStampFile,jdbcType=VARCHAR}
- ,#{promoter,jdbcType=VARCHAR}
- ,#{remark,jdbcType=VARCHAR}
- ,#{buyId,jdbcType=VARCHAR}
- ,#{status,jdbcType=VARCHAR}
- ,#{createBy,jdbcType=VARCHAR}
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateBy,jdbcType=VARCHAR}
- ,#{updateTime,jdbcType= TIMESTAMP }
- ,#{delFlag,jdbcType= NUMERIC }
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from base_company where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.Company">
- update base_company
- <set>
- <if test="name!=null">
- name_=#{name,jdbcType=VARCHAR},
- </if>
- <if test="legalName!=null">
- legal_name=#{legalName,jdbcType=VARCHAR},
- </if>
- <if test="legalCard!=null">
- legal_card=#{legalCard,jdbcType=VARCHAR},
- </if>
- <if test="legalCardFile!=null">
- legal_card_file=#{legalCardFile,jdbcType=VARCHAR},
- </if>
- <if test="usccCode!=null">
- uscc_code=#{usccCode,jdbcType=VARCHAR},
- </if>
- <if test="usccFiles!=null">
- uscc_files=#{usccFiles,jdbcType=VARCHAR},
- </if>
- <if test="type!=null">
- type_=#{type,jdbcType=VARCHAR},
- </if>
- <if test="businessNature!=null">
- business_nature=#{businessNature,jdbcType=VARCHAR},
- </if>
- <if test="businessScope!=null">
- business_scope=#{businessScope,jdbcType=VARCHAR},
- </if>
- <if test="industryType!=null">
- industry_type=#{industryType,jdbcType=VARCHAR},
- </if>
- <if test="employeesNumber!=null">
- employees_number=#{employeesNumber,jdbcType= NUMERIC },
- </if>
- <if test="insuredNumber!=null">
- insured_number=#{insuredNumber,jdbcType= NUMERIC },
- </if>
- <if test="person!=null">
- person_=#{person,jdbcType=VARCHAR},
- </if>
- <if test="tel!=null">
- tel_=#{tel,jdbcType=VARCHAR},
- </if>
- <if test="mail!=null">
- mail_=#{mail,jdbcType=VARCHAR},
- </if>
- <if test="postal!=null">
- postal_=#{postal,jdbcType=VARCHAR},
- </if>
- <if test="address!=null">
- address_=#{address,jdbcType=VARCHAR},
- </if>
- <if test="companyStampFile!=null">
- company_stamp_file=#{companyStampFile,jdbcType=VARCHAR},
- </if>
- <if test="promoter!=null">
- promoter_=#{promoter,jdbcType=VARCHAR},
- </if>
- <if test="remark!=null">
- remark_=#{remark,jdbcType=VARCHAR},
- </if>
- <if test="buyId!=null">
- buy_id=#{buyId,jdbcType=VARCHAR},
- </if>
- <if test="status!=null">
- status_=#{status,jdbcType=VARCHAR},
- </if>
- <if test="createBy!=null">
- create_by=#{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createTime!=null">
- create_time=#{createTime,jdbcType= TIMESTAMP },
- </if>
- <if test="updateBy!=null">
- update_by=#{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType= TIMESTAMP },
- </if>
- <if test="delFlag!=null">
- del_flag=#{delFlag,jdbcType= NUMERIC },
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="CompanyMap">
- select
- id_,name_,legal_name,legal_card,legal_card_file,uscc_code,uscc_files,type_,business_nature,business_scope,industry_type,employees_number,insured_number,person_,tel_,mail_,postal_,address_,company_stamp_file,promoter_,remark_,buy_id,status_,create_by,create_time,update_by,update_time,del_flag from base_company where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from base_company where id_=#{0}
- </select>
- <select id="list" resultMap="CompanyMap">
- select * from base_company
- </select>
- <select id="search" parameterType="hashmap" resultMap="CompanyMap">
- <![CDATA[
- select * from base_company
- ]]>
- <where>
- <if test="searchParams.id != null">
- and ID_ like #{searchParams.id}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- <select id="findByCreateBy" resultMap="CompanyMap">
- select * from base_company where create_by=#{0} and del_flag=0 limit 1
- </select>
- </mapper>
|