123456789101112131415161718192021222324252627282930313233343536373839 |
- <?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.ruoyi.web.work.mapper.CompanyMapper">
-
- <select id="selectList" resultType="com.ruoyi.web.work.domain.Company">
- SELECT
- c.id,
- c.company_name,
- c.bank_name,
- c.bank_account,
- c.address,
- c.director,
- c.money,
- c.phone,
- c.create_time,
- c.state,
- c.email,
- ( SELECT COUNT( r.id ) FROM tb_relate r WHERE r.company_id = c.id ) AS peoples
- FROM
- tb_company c
- <where>
- <if test="companyName != null and companyName != ''"> and c.company_name like concat('%', #{companyName}, '%')</if>
- <if test="director != null and director != ''"> and c.director like concat('%', #{director}, '%')</if>
- <if test="phone != null and phone != ''"> and c.phone = #{phone}</if>
- <if test="state != null "> and c.state = #{state}</if>
- <if test="dateBegin != null and dateBegin != ''"> AND c.create_time BETWEEN #{dateBegin} AND #{dateEnd} + INTERVAL 1 DAY</if>
- </where>
- </select>
- <select id="selectCompanyList" resultType="com.ruoyi.web.work.domain.vo.CompanyListVo">
- SELECT * FROM tb_company
- WHERE state=0
- <if test="companyName != null and companyName != ''">AND company_name like concat('%', #{companyName}, '%')</if>
- ORDER BY id DESC
- </select>
- </mapper>
|