|
@@ -31,47 +31,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="reason" column="reason" />
|
|
|
<result property="status" column="status" />
|
|
|
<result property="primaryBusiness" column="primary_business" />
|
|
|
+ <association property="companyExamine" column="company_reviewed_id" javaType="CompanyExamine" resultMap="CompanyExamineResult" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="CompanyExamine" id="CompanyExamineResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="companyReviewedId" column="company_reviewed_id" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="examineDate" column="examine_date" />
|
|
|
+ <result property="rejectReason" column="reject_reason" />
|
|
|
+ <result property="createBy" column="examine_by" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCompanyReviewedVo">
|
|
|
- select id, company_id, company_name, company_type, detail_address, longitude, latitude, legal_person, contact_number, establish_date,
|
|
|
- unified_social_credit_code, business_license_url, default_img_url, propaganda_img_url, company_introduce, version_num, create_by,
|
|
|
- create_time, update_by, update_time, remark ,login_name,password,reason,status,primary_business
|
|
|
- from company_reviewed
|
|
|
+ select cr.id, cr.company_id, cr.company_name, cr.company_type, cr.detail_address, cr.longitude, cr.latitude, cr.legal_person, cr.contact_number,
|
|
|
+ cr.establish_date,cr.unified_social_credit_code, cr.business_license_url, cr.default_img_url, cr.propaganda_img_url, cr.company_introduce, cr.version_num, cr.create_by,
|
|
|
+ cr.create_time, cr.update_by, cr.update_time, cr.remark ,cr.login_name,cr.password,cr.reason,cr.status,cr.primary_business,
|
|
|
+ ce.company_reviewed_id,ce.status,ce.examine_date,ce.reject_reason,ce.create_by examine_by
|
|
|
+ from company_reviewed cr
|
|
|
+ left join company_examine ce on ce.company_reviewed_id = cr.id
|
|
|
+
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectCompanyReviewedList" parameterType="CompanyReviewed" resultMap="CompanyReviewedResult">
|
|
|
<include refid="selectCompanyReviewedVo"/>
|
|
|
<where>
|
|
|
- <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
- <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
|
|
|
- <if test="companyType != null "> and company_type = #{companyType}</if>
|
|
|
- <if test="detailAddress != null and detailAddress != ''"> and detail_address = #{detailAddress}</if>
|
|
|
- <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
|
|
|
- <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
|
|
|
- <if test="legalPerson != null and legalPerson != ''"> and legal_person = #{legalPerson}</if>
|
|
|
- <if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
|
|
|
- <if test="establishDate != null "> and establish_date = #{establishDate}</if>
|
|
|
- <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''"> and unified_social_credit_code = #{unifiedSocialCreditCode}</if>
|
|
|
- <if test="businessLicenseUrl != null and businessLicenseUrl != ''"> and business_license_url = #{businessLicenseUrl}</if>
|
|
|
- <if test="defaultImgUrl != null and defaultImgUrl != ''"> and default_img_url = #{defaultImgUrl}</if>
|
|
|
- <if test="propagandaImgUrl != null and propagandaImgUrl != ''"> and propaganda_img_url = #{propagandaImgUrl}</if>
|
|
|
- <if test="companyIntroduce != null and companyIntroduce != ''"> and company_introduce = #{companyIntroduce}</if>
|
|
|
- <if test="versionNum != null "> and version_num = #{versionNum}</if>
|
|
|
- <if test="loginName != null and loginName != ''"> and login_name = #{loginName}</if>
|
|
|
- <if test="password != null and password != ''"> and password = #{password}</if>
|
|
|
- <if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
|
|
- <if test="status != null "> and status = #{status}</if>
|
|
|
+ <if test="companyId != null "> and cr.company_id = #{companyId}</if>
|
|
|
+ <if test="companyName != null and companyName != ''"> and cr.company_name like concat('%', #{companyName}, '%')</if>
|
|
|
+ <if test="companyType != null and companyType != ''"> and cr.company_type = #{companyType}</if>
|
|
|
+ <if test="detailAddress != null and detailAddress != ''"> and cr.detail_address = #{detailAddress}</if>
|
|
|
+ <if test="longitude != null and longitude != ''"> and cr.longitude = #{longitude}</if>
|
|
|
+ <if test="latitude != null and latitude != ''"> and cr.latitude = #{latitude}</if>
|
|
|
+ <if test="legalPerson != null and legalPerson != ''"> and cr.legal_person = #{legalPerson}</if>
|
|
|
+ <if test="contactNumber != null and contactNumber != ''"> and cr.contact_number = #{contactNumber}</if>
|
|
|
+ <if test="establishDate != null "> and cr.establish_date = #{establishDate}</if>
|
|
|
+ <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''"> and cr.unified_social_credit_code = #{unifiedSocialCreditCode}</if>
|
|
|
+ <if test="businessLicenseUrl != null and businessLicenseUrl != ''"> and cr.business_license_url = #{businessLicenseUrl}</if>
|
|
|
+ <if test="defaultImgUrl != null and defaultImgUrl != ''"> and cr.default_img_url = #{defaultImgUrl}</if>
|
|
|
+ <if test="propagandaImgUrl != null and propagandaImgUrl != ''"> and cr.propaganda_img_url = #{propagandaImgUrl}</if>
|
|
|
+ <if test="companyIntroduce != null and companyIntroduce != ''"> and cr.company_introduce = #{companyIntroduce}</if>
|
|
|
+ <if test="versionNum != null "> and cr.version_num = #{versionNum}</if>
|
|
|
+ <if test="loginName != null and loginName != ''"> and cr.login_name = #{loginName}</if>
|
|
|
+ <if test="password != null and password != ''"> and cr.password = #{password}</if>
|
|
|
+ <if test="reason != null and reason != ''"> and cr.reason = #{reason}</if>
|
|
|
+ <if test="status != null "> and cr.status = #{status}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCompanyReviewedById" parameterType="Long" resultMap="CompanyReviewedResult">
|
|
|
<include refid="selectCompanyReviewedVo"/>
|
|
|
- where id = #{id}
|
|
|
+ where cr.id = #{id}
|
|
|
</select>
|
|
|
<select id="selectCompanyReviewedByCompanyId" parameterType="Long" resultMap="CompanyReviewedResult">
|
|
|
<include refid="selectCompanyReviewedVo"/>
|
|
|
- where company_id = #{companyId}
|
|
|
+ where cr.company_id = #{companyId}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertCompanyReviewed" parameterType="CompanyReviewed" useGeneratedKeys="true" keyProperty="id">
|
|
@@ -79,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="companyId != null ">company_id,</if>
|
|
|
<if test="companyName != null and companyName != ''">company_name,</if>
|
|
|
- <if test="companyType != null ">company_type,</if>
|
|
|
+ <if test="companyType != null and companyType != '' ">company_type,</if>
|
|
|
<if test="detailAddress != null and detailAddress != ''">detail_address,</if>
|
|
|
<if test="longitude != null and longitude != ''">longitude,</if>
|
|
|
<if test="latitude != null and latitude != ''">latitude,</if>
|
|
@@ -106,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="companyId != null ">#{companyId},</if>
|
|
|
<if test="companyName != null and companyName != ''">#{companyName},</if>
|
|
|
- <if test="companyType != null ">#{companyType},</if>
|
|
|
+ <if test="companyType != null and companyType != ''">#{companyType},</if>
|
|
|
<if test="detailAddress != null and detailAddress != ''">#{detailAddress},</if>
|
|
|
<if test="longitude != null and longitude != ''">#{longitude},</if>
|
|
|
<if test="latitude != null and latitude != ''">#{latitude},</if>
|
|
@@ -137,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
|
|
<if test="companyName != null and companyName != ''">company_name = #{companyName},</if>
|
|
|
- <if test="companyType != null ">company_type = #{companyType},</if>
|
|
|
+ <if test="companyType != null and companyType != ''">company_type = #{companyType},</if>
|
|
|
<if test="detailAddress != null and detailAddress != ''">detail_address = #{detailAddress},</if>
|
|
|
<if test="longitude != null and longitude != ''">longitude = #{longitude},</if>
|
|
|
<if test="latitude != null and latitude != ''">latitude = #{latitude},</if>
|
|
@@ -176,32 +189,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<select id="checkLoginNameUnique" resultType="int">
|
|
|
- select count(1) from company_reviewed where login_name=#{loginName} and reason='0' and status="0"
|
|
|
+ select count(1) from company_reviewed where login_name=#{loginName} and reason='0' and status='0'
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCompanyReviewedListWiteAudit" parameterType="CompanyReviewed" resultMap="CompanyReviewedResult">
|
|
|
<include refid="selectCompanyReviewedVo"/>
|
|
|
<where>
|
|
|
- <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
- <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
|
|
|
- <if test="companyType != null "> and company_type = #{companyType}</if>
|
|
|
- <if test="detailAddress != null and detailAddress != ''"> and detail_address = #{detailAddress}</if>
|
|
|
- <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
|
|
|
- <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
|
|
|
- <if test="legalPerson != null and legalPerson != ''"> and legal_person = #{legalPerson}</if>
|
|
|
- <if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
|
|
|
- <if test="establishDate != null "> and establish_date = #{establishDate}</if>
|
|
|
- <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''"> and unified_social_credit_code = #{unifiedSocialCreditCode}</if>
|
|
|
- <if test="businessLicenseUrl != null and businessLicenseUrl != ''"> and business_license_url = #{businessLicenseUrl}</if>
|
|
|
- <if test="defaultImgUrl != null and defaultImgUrl != ''"> and default_img_url = #{defaultImgUrl}</if>
|
|
|
- <if test="propagandaImgUrl != null and propagandaImgUrl != ''"> and propaganda_img_url = #{propagandaImgUrl}</if>
|
|
|
- <if test="companyIntroduce != null and companyIntroduce != ''"> and company_introduce = #{companyIntroduce}</if>
|
|
|
- <if test="versionNum != null "> and version_num = #{versionNum}</if>
|
|
|
- <if test="loginName != null and loginName != ''"> and login_name = #{loginName}</if>
|
|
|
- <if test="password != null and password != ''"> and password = #{password}</if>
|
|
|
- <if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
|
|
+ <if test="companyId != null "> and cr.company_id = #{companyId}</if>
|
|
|
+ <if test="companyName != null and companyName != ''"> and cr.company_name like concat('%', #{companyName}, '%')</if>
|
|
|
+ <if test="companyType != null and companyType != '' "> and cr.company_type = #{companyType}</if>
|
|
|
+ <if test="detailAddress != null and detailAddress != ''"> and cr.detail_address = #{detailAddress}</if>
|
|
|
+ <if test="longitude != null and longitude != ''"> and cr.longitude = #{longitude}</if>
|
|
|
+ <if test="latitude != null and latitude != ''"> and cr.latitude = #{latitude}</if>
|
|
|
+ <if test="legalPerson != null and legalPerson != ''"> and cr.legal_person = #{legalPerson}</if>
|
|
|
+ <if test="contactNumber != null and contactNumber != ''"> and cr.contact_number = #{contactNumber}</if>
|
|
|
+ <if test="establishDate != null "> and cr.establish_date = #{establishDate}</if>
|
|
|
+ <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''"> and cr.unified_social_credit_code = #{unifiedSocialCreditCode}</if>
|
|
|
+ <if test="businessLicenseUrl != null and businessLicenseUrl != ''"> and cr.business_license_url = #{businessLicenseUrl}</if>
|
|
|
+ <if test="defaultImgUrl != null and defaultImgUrl != ''"> and cr.default_img_url = #{defaultImgUrl}</if>
|
|
|
+ <if test="propagandaImgUrl != null and propagandaImgUrl != ''"> and cr.propaganda_img_url = #{propagandaImgUrl}</if>
|
|
|
+ <if test="companyIntroduce != null and companyIntroduce != ''"> and cr.company_introduce = #{companyIntroduce}</if>
|
|
|
+ <if test="versionNum != null "> and cr.version_num = #{versionNum}</if>
|
|
|
+ <if test="loginName != null and loginName != ''"> and cr.login_name = #{loginName}</if>
|
|
|
+ <if test="password != null and password != ''"> and cr.password = #{password}</if>
|
|
|
+ <if test="reason != null and reason != ''"> and cr.reason = #{reason}</if>
|
|
|
</where>
|
|
|
- order by status,create_time
|
|
|
+ order by cr.status,ce.examine_date desc,cr.create_time desc
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|