|
|
@@ -54,45 +54,50 @@
|
|
|
<select id="findPojo" resultType="com.sckw.system.model.pojo.FindEntListPojo" parameterType="com.sckw.system.model.pojo.FindPojoParam">
|
|
|
select tab.*,
|
|
|
case when tab.id in (select ent_id from kws_ent_dep) then '子单位' else '主单位' end entDept,
|
|
|
- case when tab.status = 0 then '正常' else '冻结' end statusName from
|
|
|
+ case when tab.status = 0 then '正常' else '冻结' end statusName
|
|
|
+ from
|
|
|
(
|
|
|
- select a.id,
|
|
|
- min(a.firm_name) firm_name,
|
|
|
- min(a.code) code,
|
|
|
- min(a.contacts) contacts,
|
|
|
- min(a.phone) phone,
|
|
|
- min(a.legal_name) legal_name,
|
|
|
- min(a.legal_phone) legal_phone,
|
|
|
- min(a.head) head,
|
|
|
- min(a.integral) integral,
|
|
|
- min(a.balance) balance,
|
|
|
- min(a.experience) experience,
|
|
|
- min(a.member_level) member_level,
|
|
|
- min(a.reg_time) reg_time,
|
|
|
- min(a.reg_source) reg_source,
|
|
|
- min(a.org_code) org_code,
|
|
|
- min(a.city_code) city_code,
|
|
|
- min(a.detail_address) detail_address,
|
|
|
- min(a.lat) lat,
|
|
|
- min(a.lng) lng,
|
|
|
- min(a.approval) approval,
|
|
|
- min(a.approval_time) approval_time,
|
|
|
- min(a.manager) manager,
|
|
|
- min(a.remark) remark,
|
|
|
- min(a.status) status,
|
|
|
- min(a.create_by) create_by,
|
|
|
- min(a.create_time) create_time,
|
|
|
- min(a.update_by) update_by,
|
|
|
- min(a.update_time) update_time,
|
|
|
- min(a.del_flag) del_flag,
|
|
|
- ifnull(GROUP_CONCAT(distinct b.type), '') type,
|
|
|
- min(k.system_type) system_type,
|
|
|
- min(k.name) createByName,
|
|
|
- min(ku.name) updateByName
|
|
|
+ select a.id,
|
|
|
+ min(a.firm_name) firm_name,
|
|
|
+ min(a.code) code,
|
|
|
+ min(a.contacts) contacts,
|
|
|
+ min(a.phone) phone,
|
|
|
+ min(a.legal_name) legal_name,
|
|
|
+ min(a.legal_phone) legal_phone,
|
|
|
+ min(a.head) head,
|
|
|
+ min(a.integral) integral,
|
|
|
+ min(a.balance) balance,
|
|
|
+ min(a.experience) experience,
|
|
|
+ min(a.member_level) member_level,
|
|
|
+ min(a.reg_time) reg_time,
|
|
|
+ min(a.reg_source) reg_source,
|
|
|
+ min(a.org_code) org_code,
|
|
|
+ min(a.city_code) city_code,
|
|
|
+ min(a.detail_address) detail_address,
|
|
|
+ min(a.lat) lat,
|
|
|
+ min(a.lng) lng,
|
|
|
+ min(a.approval) approval,
|
|
|
+ min(a.approval_time) approval_time,
|
|
|
+ min(a.manager) manager,
|
|
|
+ min(a.remark) remark,
|
|
|
+ min(a.status) status,
|
|
|
+ min(a.create_by) create_by,
|
|
|
+ min(a.create_time) create_time,
|
|
|
+ min(a.update_by) update_by,
|
|
|
+ min(a.update_time) update_time,
|
|
|
+ min(a.del_flag) del_flag,
|
|
|
+ ifnull(GROUP_CONCAT(distinct b.type), '') type,
|
|
|
+ min(k.system_type) system_type,
|
|
|
+ min(k.name) createByName,
|
|
|
+ min(ku.name) updateByName,
|
|
|
+ min(d.id) pid,
|
|
|
+ min(d.firm_name) pEntName
|
|
|
from kws_enterprise a
|
|
|
left join kws_user k on a.create_by = k.id
|
|
|
left join kws_user ku on a.update_by = ku.id
|
|
|
left join kws_ent_type b on a.id = b.ent_id and b.del_flag = 0
|
|
|
+ left join kws_ent_dept c on a.id = c.ent_id
|
|
|
+ left join kws_enterprise d on c.ent_pid = d.id
|
|
|
<if test="dto.typeList != null and dto.typeList.size() > 0">and b.type in
|
|
|
<foreach collection="dto.typeList" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
@@ -111,10 +116,10 @@
|
|
|
and (a.contacts like concat('%', #{dto.keywords}, '%') or a.phone like concat('%', #{dto.keywords}, '%') or a.firm_name like concat('%', #{dto.keywords}, '%'))
|
|
|
</if>
|
|
|
<if test="dto.startTime != null">
|
|
|
- and a.update_time >= #{dto.startTime}
|
|
|
+ and a.reg_time >= #{dto.startTime}
|
|
|
</if>
|
|
|
<if test="dto.endTime != null">
|
|
|
- and a.update_time <= #{dto.endTime}
|
|
|
+ and a.reg_time <= #{dto.endTime}
|
|
|
</if>
|
|
|
<if test="dto.approvalStartTime != null">
|
|
|
and a.approval_time >= #{dto.approvalStartTime}
|
|
|
@@ -275,15 +280,13 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="checkEntRepeat" resultType="com.sckw.system.model.KwsEnterprise">
|
|
|
- select * from kws_enterprise where (
|
|
|
- 1 = 1
|
|
|
- <if test="entName != null and entName != ''">
|
|
|
- or firm_name = #{entName}
|
|
|
- </if>
|
|
|
+ select * from kws_enterprise where (
|
|
|
+ firm_name = #{entName}
|
|
|
<if test="phone != null and phone != ''">
|
|
|
or phone = #{phone}
|
|
|
</if>
|
|
|
- ) and del_flag = 0 and approval in (1,3,4)
|
|
|
+ )
|
|
|
+ and del_flag = 0 and approval in (1,3,4)
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAllByKeys" resultType="com.sckw.system.model.KwsEnterprise">
|