123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.system.mapper.CommonMapper">
- <resultMap id="retMap" type="com.ruoyi.system.entity.CommonEntity" autoMapping="true">
- <collection property="resultMap" ofType="map" autoMapping="true"
- javaType="map"></collection>
- </resultMap>
- <select id="selectList" resultMap="retMap">
- select * from ${tableName}
- <where>
- <if test="conditions != null">
- <foreach collection="conditions" item="value" index="key" separator="and">
- ${key}=#{value}
- </foreach>
- </if>
- </where>
- </select>
- <select id="queryTableList" resultMap="retMap">
- ${Sql}
- </select>
- <insert id="batchInsert">
- insert into ${tableName}
- <foreach collection="fieldNames" item="fieldName" open="(" close=")" separator=",">
- ${fieldName}
- </foreach>
- values
- <foreach collection="fieldValues" item="map" separator=",">
- <foreach collection="map" item="value" index="key" separator="," open="(" close=")">
- #{value}
- </foreach>
- </foreach>
- </insert>
- <delete id="batchDelete">
- update ${tableName} set del_flag = '2'
- <where>
- <if test="conditions != null">
- <foreach collection="conditions" item="value" index="key" separator="and">
- ${key} in
- <foreach collection="value" item="v" open="(" close=")" separator=",">
- #{v}
- </foreach>
- </foreach>
- </if>
- </where>
- </delete>
- <update id="edit">
- update ${tableName} set
- <foreach collection="fields" item="field" index="key" separator=",">
- ${key}=#{field}
- </foreach>
- <where>
- <if test="conditions != null">
- <foreach collection="conditions" item="value" index="key" separator="and">
- ${key}=#{value}
- </foreach>
- </if>
- </where>
- </update>
- <select id="selectDropDownList" resultType="map">
- select ${fieldKey} as fieldKey,${fieldName} as fieldName from ${tableName}
- <where>
- <if test="conditions != null">
- <foreach collection="conditions" item="value" index="key" separator="and">
- ${key}=#{value}
- </foreach>
- </if>
- </where>
- </select>
- <select id="selectDropDownListByDict" resultType="map">
- select dict_value as fieldKey,dict_label as fieldName from sys_dict_data where dict_type = #{dictType} and status = '0'
- </select>
- </mapper>
|