New file |
| | |
| | | <?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.whyc.mapper.PageParamMapper" > |
| | | |
| | | <update id="updateList"> |
| | | <choose> |
| | | <when test="operationFlag==1"> |
| | | <foreach collection="pageParamList" item="item" separator=";"> |
| | | update db_app_sys.tb_page_param set status = 1 where id = #{item.id} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | <foreach collection="pageParamList" item="item" separator=";"> |
| | | update db_app_sys.tb_page_param set status = 0 where id = #{item.id} |
| | | </foreach> |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | </update> |
| | | <select id="getCount" resultType="java.lang.Integer"> |
| | | select count(*) num from db_app_sys.tb_page_param |
| | | </select> |
| | | <update id="createTable" > |
| | | CREATE TABLE db_app_sys.tb_page_param ( |
| | | id int(11) NOT NULL AUTO_INCREMENT, |
| | | param varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '具体参数', |
| | | status int(1) DEFAULT NULL COMMENT '参数是否页面显示', |
| | | categoryId int(1) DEFAULT NULL COMMENT '参数分类,类目1,类目2', |
| | | PRIMARY KEY (id) USING BTREE |
| | | ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci |
| | | </update> |
| | | <update id="update"> |
| | | update db_app_sys.tb_page_param set status=#{status} where id=#{id} |
| | | </update> |
| | | <update id="updateStatusList"> |
| | | <foreach collection="pageParamList" item="item" separator=";"> |
| | | update db_app_sys.tb_page_param set status = #{item.status} where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | <select id="findByCategoryId" resultType="com.whyc.pojo.db_app_sys.PageParam"> |
| | | select id,param,status,categoryId from db_app_sys.tb_page_param |
| | | <where> |
| | | <if test="#{categoryId}!=null"> |
| | | categoryId=#{categoryId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |