123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?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.hssx.cloudmodel.mapper.CompanyMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.hssx.cloudmodel.entity.Company">
- <id column="id" property="id" />
- <result column="company_name" property="companyName" />
- <result column="company_address" property="companyAddress" />
- <result column="company_type" property="companyType" />
- <result column="administrator_id" property="administratorId" />
- <result column="administrator" property="administrator" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, company_name, company_address, company_type, administrator_id, administrator
- </sql>
- <resultMap id="BaseResultMapVO" type="com.hssx.cloudmodel.entity.vo.CompanyVO">
- <id column="id" property="id" />
- <result column="company_name" property="companyName" />
- <result column="company_address" property="companyAddress" />
- <result column="companytype" property="companyType" />
- <result column="administrator_id" property="administratorId" />
- <result column="administrator" property="administrator" />
- <result column="y_lng" property="yLng" />
- <result column="x_lat" property="xLat" />
- <collection property="relateCompanyList" javaType="java.util.List" select="selectRelateCompanyList"
- column="{Id=id,companyType = companytype}"
- ofType="com.hssx.cloudmodel.entity.Company"/>
- </resultMap>
- <resultMap id="BaseResultMapMouldVO" type="com.hssx.cloudmodel.entity.vo.CompanyVO">
- <id column="id" property="id" />
- <result column="company_name" property="companyName" />
- <result column="company_address" property="companyAddress" />
- <result column="company_type" property="companyType" />
- <result column="y_lng" property="yLng" />
- <result column="x_lat" property="xLat" />
- <collection property="list" javaType="java.util.List" select="selectMouldsList" column="id"
- ofType="com.hssx.cloudmodel.entity.Mould"/>
- </resultMap>
- <!--<select id="getListByKeyName" resultMap="BaseResultMapVO">-->
- <!--select-->
- <!--<include refid="Base_Column_List"/>-->
- <!--from-->
- <!--tb_company-->
- <!--<where>-->
- <!--<if test="keyName != null and keyName != ''">-->
- <!--and company_name like concat('%',#{keyName},'%')-->
- <!--</if>-->
- <!--<if test="companyType != null">-->
- <!--and company_type = #{companyType}-->
- <!--</if>-->
- <!--</where>-->
- <!--</select>-->
- <select id="getCustomerListByKeyName" resultMap="BaseResultMapVO">
- select
- t.id, t.company_name, t.company_address, t.company_type companytype,t.administrator_id,t.administrator,tc.y_lng, tc.x_lat
- from
- tb_company t
- left join
- tb_lng_lat_company tc
- on tc.company_id = t.id
- <where>
- <if test="keyName != null and keyName != ''">
- and t.company_name like concat('%',#{keyName},'%')
- </if>
- <if test="companyType != null">
- and t.company_type = #{companyType}
- </if>
- </where>
- </select>
- <select id="selectRelateCompanyList" resultType="com.hssx.cloudmodel.entity.Company" parameterType="java.util.Map">
- SELECT
- t.id, t.company_name,t.company_type
- from
- tb_asset_custom_company tbcc
- left join
- tb_company t
- <if test="companyType == 0">
- on t.id = tbcc.custom_id
- </if>
- <if test="companyType == 1">
- on t.id = tbcc.assert_id
- </if>
- <where>
- <if test="companyType == 0">
- tbcc.assert_id = #{Id}
- </if>
- <if test="companyType == 1">
- tbcc.custom_id = #{Id}
- </if>
- </where>
- </select>
- <select id="getListMould" resultMap="BaseResultMapMouldVO">
- select
- t.id, t.company_name, t.company_address, t.company_type,tbc.y_lng, tbc.x_lat
- from
- tb_mould tm
- LEFT JOIN
- tb_company t
- on
- tm.produce_company_id = t.id
- LEFT JOIN
- tb_lng_lat_company tbc
- ON
- tbc.company_id = t.id
- where t.id IS NOT NULL AND tm.id in
- <foreach item="item" index="index" collection="mouldIds"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- <resultMap id="BaseResultMouldMap" type="com.hssx.cloudmodel.entity.Mould">
- <id column="id" property="id" />
- <result column="model_no" property="modelNo" />
- <result column="model_name" property="modelName" />
- <result column="water_gap" property="waterGap" />
- <result column="tonnage" property="tonnage" />
- <result column="oc_cycle" property="ocCycle" />
- <result column="daily_output" property="dailyOutput" />
- <result column="company_id" property="companyId" />
- <result column="current_version_id" property="currentVersionId" />
- <result column="state" property="state" />
- <result column="is_delete" property="isDelete" />
- <result column="creator_id" property="creatorId" />
- <result column="project_id" property="projectId" />
- <result column="rfid" property="rfid" />
- <result column="setting_life" property="settingLife" />
- <result column="area" property="area" />
- <result column="initial_modulus" property="initialModulus" />
- <result column="equipment_id" property="equipmentId" />
- <result column="belong_project_grade" property="belongProjectGrade" />
- <result column="produce_company_id" property="produceCompanyId" />
- <result column="run_times" property="runTimes" />
- </resultMap>
- <select id="selectMouldsList" resultMap="BaseResultMouldMap">
- select
- id, model_no, model_name, water_gap, tonnage, oc_cycle, daily_output, company_id, current_version_id, state, is_delete, creator_id, project_id, rfid, setting_life, area,
- initial_modulus, equipment_id, belong_project_grade, produce_company_id, run_times
- from
- tb_mould
- where
- produce_company_id = #{id}
- </select>
- </mapper>
|