<?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="org.example.mybatisplus.mapper.auto.CmsEntRiskInfoDeclMapper">
  <resultMap id="BaseResultMap" type="org.example.mybatisplus.model.auto.CmsEntRiskInfoDecl">
    <result column="decl_id" jdbcType="BIGINT" property="declId" />
    <result column="ent_name" jdbcType="VARCHAR" property="entName" />
    <result column="reg_code" jdbcType="VARCHAR" property="regCode" />
    <result column="decl_sn" jdbcType="VARCHAR" property="declSn" />
    <result column="decl_type" jdbcType="VARCHAR" property="declType" />
    <result column="decl_url" jdbcType="VARCHAR" property="declUrl" />
    <result column="secret_key" jdbcType="VARCHAR" property="secretKey" />
    <result column="issue_date" jdbcType="TIMESTAMP" property="issueDate" />
    <result column="expiry_date" jdbcType="TIMESTAMP" property="expiryDate" />
    <result column="decl_state" jdbcType="VARCHAR" property="declState" />
    <result column="open_info" jdbcType="VARCHAR" property="openInfo" />
    <result column="submit_info" jdbcType="VARCHAR" property="submitInfo" />
    <result column="check_info" jdbcType="VARCHAR" property="checkInfo" />
    <result column="form_items" jdbcType="VARCHAR" property="formItems" />
    <result column="decl_result" jdbcType="VARCHAR" property="declResult" />
    <result column="decl_sender" jdbcType="VARCHAR" property="declSender" />
    <result column="decl_recipient" jdbcType="VARCHAR" property="declRecipient" />
    <result column="parent_id" jdbcType="BIGINT" property="parentId" />
    <result column="dept_id" jdbcType="BIGINT" property="deptId" />
    <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
    <result column="created_by" jdbcType="VARCHAR" property="createdBy" />
    <result column="modified_by" jdbcType="VARCHAR" property="modifiedBy" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
  </resultMap>

  <sql id="selectCmsEntRiskInfoDeclVo">
        select decl_id, ent_name, reg_code, decl_sn, decl_type, decl_url, secret_key, issue_date, expiry_date, decl_state, open_info, submit_info, check_info, form_items, decl_result, decl_sender, decl_recipient, parent_id, dept_id, tenant_id, created_by, modified_by, created_time, modified_time, from cms_ent_risk_info_decl
   </sql>

  <select id="selectCmsEntRiskInfoDeclList" parameterType="org.example.mybatisplus.model.auto.CmsEntRiskInfoDecl" resultMap="BaseResultMap">
    <include refid="selectCmsEntRiskInfoDeclVo"/>
    <where>
        <if test="declId != null "> and decl_id = #{declId}</if>
        <if test="entName != null  and entName != ''"> and ent_name = #{entName}</if>
        <if test="regCode != null  and regCode != ''"> and reg_code = #{regCode}</if>
        <if test="declSn != null  and declSn != ''"> and decl_sn = #{declSn}</if>
        <if test="declType != null  and declType != ''"> and decl_type = #{declType}</if>
        <if test="declUrl != null  and declUrl != ''"> and decl_url = #{declUrl}</if>
        <if test="secretKey != null  and secretKey != ''"> and secret_key = #{secretKey}</if>
        <if test="issueDate != null "> and issue_date = #{issueDate}</if>
        <if test="expiryDate != null "> and expiry_date = #{expiryDate}</if>
        <if test="declState != null  and declState != ''"> and decl_state = #{declState}</if>
        <if test="openInfo != null  and openInfo != ''"> and open_info = #{openInfo}</if>
        <if test="submitInfo != null  and submitInfo != ''"> and submit_info = #{submitInfo}</if>
        <if test="checkInfo != null  and checkInfo != ''"> and check_info = #{checkInfo}</if>
        <if test="formItems != null  and formItems != ''"> and form_items = #{formItems}</if>
        <if test="declResult != null  and declResult != ''"> and decl_result = #{declResult}</if>
        <if test="declSender != null  and declSender != ''"> and decl_sender = #{declSender}</if>
        <if test="declRecipient != null  and declRecipient != ''"> and decl_recipient = #{declRecipient}</if>
        <if test="parentId != null "> and parent_id = #{parentId}</if>
        <if test="deptId != null "> and dept_id = #{deptId}</if>
        <if test="tenantId != null "> and tenant_id = #{tenantId}</if>
        <if test="createdBy != null  and createdBy != ''"> and created_by = #{createdBy}</if>
        <if test="modifiedBy != null  and modifiedBy != ''"> and modified_by = #{modifiedBy}</if>
        <if test="createdTime != null "> and created_time = #{createdTime}</if>
        <if test="modifiedTime != null "> and modified_time = #{modifiedTime}</if>
    </where>
  </select>
</mapper>