BusinessLicenseMapper.xml 3.02 KB
<?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.yohoufo.dal.order.BusinessLicenseMapper">
    <resultMap id="BaseResultMap" type="com.yohoufo.dal.order.model.BusinessLicense">
      <result column="id" property="id" jdbcType="INTEGER" />
      <result column="uid" property="uid" jdbcType="INTEGER" />
      <result column="business_type" property="businessType" jdbcType="INTEGER" />
      <result column="business_name" property="businessName" jdbcType="VARCHAR" />
      <result column="social_credit_code" property="socialCreditCode" jdbcType="VARCHAR" />
      <result column="cert_name" property="certName" jdbcType="VARCHAR" />
      <result column="cert_no" property="certNo" jdbcType="VARCHAR" />
      <result column="start_time" property="startTime" jdbcType="INTEGER" />
      <result column="expire_time" property="expireTime" jdbcType="INTEGER" />
      <result column="license_original_image" property="licenseOriginalImage" jdbcType="VARCHAR" />
      <result column="license_copy_image" property="licenseCopyImage" jdbcType="VARCHAR" />
      <result column="cert_face_image" property="certFaceImage" jdbcType="VARCHAR" />
      <result column="cert_reverse_image" property="certReverseImage" jdbcType="VARCHAR" />
      <result column="commit_time" property="commitTime" jdbcType="INTEGER" />
      <result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
      <result column="audit_time" property="auditTime" jdbcType="INTEGER" />
      <result column="audit_uid" property="auditUid" jdbcType="INTEGER" />
      <result column="reject_reason" property="rejectReason" jdbcType="VARCHAR" />
    </resultMap>

    <sql id="Base_Column_List">
        id, uid, business_type, business_name, social_credit_code, cert_name, cert_no, start_time, expire_time, license_original_image, 
        license_copy_image, cert_face_image, cert_reverse_image, commit_time, audit_status, audit_time, audit_uid, reject_reason
    </sql>
    
    <insert id="insert" parameterType="com.yohoufo.dal.order.model.BusinessLicense">
        insert into business_license (uid, business_type, business_name, social_credit_code, cert_name, cert_no, start_time, expire_time,
        license_original_image, license_copy_image, cert_face_image, cert_reverse_image, commit_time) values (#{uid}, #{businessType}, #{businessName}, 
        #{socialCreditCode}, #{certName}, #{certNo}, #{startTime}, #{expireTime}, #{licenseOriginalImage}, #{licenseCopyImage}, 
        #{certFaceImage}, #{certReverseImage}, #{commitTime})
    </insert>
    
    <select id="selectByUid" resultMap="BaseResultMap" >
        select <include refid="Base_Column_List"></include> 
        from business_license 
        where uid=#{uid} 
        order by commit_time desc
    </select>
    
    <select id="selectById" resultMap="BaseResultMap">
      select <include refid="Base_Column_List"></include> 
      from business_license 
      where id=#{id}
    </select>
    
    
</mapper>