|
@@ -28,29 +28,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="remark" column="remark" />
|
|
|
<result property="primaryBusiness" column="primary_business" />
|
|
|
<result property="sort" column="sort" />
|
|
|
+ <result property="goodsCount" column="goodsCount" />
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
<sql id="selectSysCompanyVo">
|
|
|
- select 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,update_by,update_time,remark,status,create_time,primary_business,sort
|
|
|
- from sys_company
|
|
|
+ select sc.id, sc.company_name,sc.company_type,sc.detail_address,sc.longitude,sc.latitude,sc.legal_person,sc.contact_number,sc.establish_date,
|
|
|
+ sc.unified_social_credit_code,sc.business_license_url,sc.default_img_url,sc.propaganda_img_url,sc.company_introduce,sc.version_num,
|
|
|
+ sc.create_by,sc.update_by,sc.update_time,sc.remark,sc.status,sc.create_time,sc.primary_business,sc.sort
|
|
|
+ ,(select count(0) from goods_info gi where gi.company_id = sc.id and gi.putaway_flag = '0' and del_flag='0') goodsCount
|
|
|
+ from sys_company sc
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectSysCompanyList" parameterType="SysCompany" resultMap="SysCompanyResult">
|
|
|
<include refid="selectSysCompanyVo"/>
|
|
|
<where>
|
|
|
- <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName},'%')</if>
|
|
|
- <if test="status != null and status != ''">and status =#{status}</if>
|
|
|
- <if test="companyType != null and companyType != ''">and companyType =#{company_type}</if>
|
|
|
+ <if test="companyName != null and companyName != ''"> and sc.company_name like concat('%', #{companyName},'%')</if>
|
|
|
+ <if test="status != null and status != ''">and sc.status =#{status}</if>
|
|
|
+ <if test="companyType != null and companyType != ''">and sc.companyType =#{company_type}</if>
|
|
|
</where>
|
|
|
order by sort desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSysCompanyById" parameterType="Long" resultMap="SysCompanyResult">
|
|
|
<include refid="selectSysCompanyVo"/>
|
|
|
- where id = #{id}
|
|
|
+ where sc.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertSysCompany" parameterType="SysCompany" useGeneratedKeys="true" keyProperty="id">
|
|
@@ -153,10 +155,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectSysCompanyListExRoot" parameterType="SysCompany" resultMap="SysCompanyResult">
|
|
|
<include refid="selectSysCompanyVo"/>
|
|
|
<where>
|
|
|
- id !=1
|
|
|
- <if test="companyName != null and companyName != ''"> and company_name like concat('%',#{companyName},'%') </if>
|
|
|
+ sc.id !=1
|
|
|
+ <if test="companyName != null and companyName != ''"> and sc.company_name like concat('%',#{companyName},'%') </if>
|
|
|
</where>
|
|
|
- order by sort desc
|
|
|
+ order by sc.sort desc
|
|
|
</select>
|
|
|
|
|
|
|