whyclxw
7 天以前 138dead9b8a35d843a74a799e2cfbe1b12b51189
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?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>