| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <?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.chinaitop.depot.sqr.mapper.BizSqrEnterpriseApplyMapper">
- <resultMap id="BaseResultMap" type="com.chinaitop.depot.sqr.model.vo.BizSqrEnterpriseApplyVO" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="create_user" property="createUser" jdbcType="VARCHAR" />
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
- <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
- <result column="sqr_enterprise_id" property="sqrEnterpriseId" jdbcType="VARCHAR" />
- <result column="apply_type" property="applyType" jdbcType="INTEGER" />
- <result column="apply_status" property="applyStatus" jdbcType="INTEGER" />
- <result column="attachment" property="attachment" jdbcType="VARCHAR" />
- <result column="unit_info_id" property="unitInfoId" jdbcType="VARCHAR" />
- <result column="storage_expire_time" property="storageExpireTime" jdbcType="TIMESTAMP" />
- <result column="reissue_time" property="reissueTime" jdbcType="TIMESTAMP" />
- <result column="full_time_staff_count" property="fullTimeStaffCount" jdbcType="INTEGER" />
- <result column="certified_storekeeper_count" property="certifiedStorekeeperCount" jdbcType="INTEGER" />
- <result column="certified_inspector_count" property="certifiedInspectorCount" jdbcType="INTEGER" />
- <result column="warehouse_facility_situation" property="warehouseFacilitySituation" jdbcType="VARCHAR" />
- <result column="dwmc" property="dwmc" jdbcType="VARCHAR" />
- <result column="dwdm" property="dwdm" jdbcType="VARCHAR" />
- <result column="fddbr" property="fddbr" jdbcType="VARCHAR" />
- <result column="dwlx" property="dwlx" jdbcType="VARCHAR" />
- <result column="zcdz" property="zcdz" jdbcType="VARCHAR" />
- <result column="cfs" property="cfs" jdbcType="INTEGER" />
- <result column="ygs" property="ygs" jdbcType="INTEGER" />
- <result column="DICT_LABEL" property="dictLabel" jdbcType="VARCHAR" />
- <result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Example_Where_Clause" >
- <where >
- <foreach collection="oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause" >
- <where >
- <foreach collection="example.oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <select id="findByPage" resultType="Map" resultMap="BaseResultMap">
- SELECT
- bgqa.id,bui.id unitInfoId, bui.dwmc,bui.dwdm,bui.fddbr,bui.dwlx,bgqa.apply_status,bgqa.apply_type,bgq.audit_status
- FROM
- province_all.biz_sqr_enterprise_apply bgqa
- LEFT JOIN province_all.biz_unit_info bui ON bgqa.unit_info_id = bui.id
- LEFT JOIN province_all.biz_audit_request bgq ON bgqa.id = bgq.request_id
- where bgqa.apply_type=#{applyType,jdbcType=INTEGER}
- <if test="dwmc != null and dwmc != ''">
- and bui.dwmc LIKE concat('%', #{dwmc}, '%')
- </if>
- </select>
- <select id="findById" resultType="Map" resultMap="BaseResultMap">
- SELECT
- A.dwmc,A.id unitInfoId, A.dwdm,A.fddbr,A.dwlx,A.zcdz,A.cfs,A.ygs,A.DICT_LABEL,bgqa.apply_status,bgqa.apply_type,
- bse.certified_storekeeper_count ,bse.certified_inspector_count ,bse.warehouse_facility_situation ,
- bse.full_time_staff_count ,bse.storage_expire_time ,bse.attachment attachment
- FROM
- province_all.biz_sqr_enterprise_apply bgqa
- left join province_all.biz_sqr_enterprise bse on bgqa.sqr_enterprise_id =bse.id
- left join(select bui.id,bui.dwmc,bui.dwdm,bui.fddbr,bui.dwlx,bui.zcdz,bui.cfs,bui.ygs,dict.DICT_LABEL from province_all.biz_unit_info bui left join province_all.dev_dict dict on bui.dwlx = dict.id
- <if test="unitInfoId != null and unitInfoId != ''">
- where bui.id =#{unitInfoId,jdbcType=VARCHAR}
- </if>
- )A on bgqa.unit_info_id = A.id
- where bgqa.id=#{id,jdbcType=INTEGER} and bgqa.apply_type=#{applyType,jdbcType=INTEGER}
- </select>
- <insert id="insert" keyProperty="id" useGeneratedKeys="true" parameterType="com.chinaitop.depot.sqr.model.BizSqrEnterpriseApply">
- insert into province_all.biz_sqr_enterprise_apply (id,unit_info_id,apply_type,
- apply_status,storage_expire_time,sqr_enterprise_id,
- create_time,create_user,update_time,update_user)
- values (
- #{id,jdbcType=INTEGER},
- #{unitInfoId,jdbcType=VARCHAR},
- #{applyType,jdbcType=INTEGER},
- #{applyStatus,jdbcType=INTEGER},
- #{storageExpireTime,jdbcType=TIMESTAMP},
- #{sqrEnterpriseId,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP},
- #{createUser,jdbcType=VARCHAR},
- #{updateTime,jdbcType=TIMESTAMP},
- #{updateUser,jdbcType=VARCHAR}
- )
- </insert>
- <select id="selectRequestfindByApplyId" resultType="java.lang.Integer">
- SELECT COUNT(*) FROM province_all.biz_audit_request WHERE type =3 and request_id=#{id,jdbcType=INTEGER}
- </select>
- <delete id="delete" parameterType="java.lang.Integer">
- DELETE FROM province_all.biz_sqr_enterprise_apply WHERE id = #{id,jdbcType=INTEGER}
- </delete>
- </mapper>
|